本文整理汇总了C++中GfxStats::display方法的典型用法代码示例。如果您正苦于以下问题:C++ GfxStats::display方法的具体用法?C++ GfxStats::display怎么用?C++ GfxStats::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GfxStats
的用法示例。
在下文中一共展示了GfxStats::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawScene
void MirrorDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER |
D3DCLEAR_STENCIL, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetValue(mhLightVecW, &mLightVecW, sizeof(D3DXVECTOR3)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientLight, &mAmbientLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecularLight, &mSpecularLight, sizeof(D3DXCOLOR)));
// All objects use the same material.
HR(mFX->SetValue(mhAmbientMtrl, &mWhiteMtrl.ambient, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhDiffuseMtrl, &mWhiteMtrl.diffuse, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecularMtrl, &mWhiteMtrl.spec, sizeof(D3DXCOLOR)));
HR(mFX->SetFloat(mhSpecularPower, mWhiteMtrl.specPower));
drawRoom();
drawMirror();
drawTeapot();
drawReflectedTeapot();
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例2: drawScene
void AmbientDiffuseDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255,255,255), 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetMatrix(mhWVP, &(mWorld*mView*mProj)));
D3DXMATRIX worldInverseTranspose;
D3DXMatrixInverse(&worldInverseTranspose, 0, &mWorld);
D3DXMatrixTranspose(&worldInverseTranspose, &worldInverseTranspose);
HR(mFX->SetMatrix(mhWorldInverseTranspose, &worldInverseTranspose));
HR(mFX->SetValue(mhLightVecW, &mLightVecW, sizeof(D3DXVECTOR3)));
HR(mFX->SetValue(mhDiffuseMtrl, &mDiffuseMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientMtrl, &mAmbientMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientLight, &mAmbientLight, sizeof(D3DXCOLOR)));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
for (UINT i = 0; i < numPasses; ++i)
{
HR(mFX->BeginPass(i));
HR(mTeapot->DrawSubset(0));
HR(mFX->EndPass());
}
HR(mFX->End());
mGfxStats->display(D3DCOLOR_XRGB(0,0,0));
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例3: drawScene
void TriGridDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255,255,255), 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(gd3dDevice->SetStreamSource(0, mVB, 0, sizeof(VertexPos)));
HR(gd3dDevice->SetIndices(mIB));
HR(gd3dDevice->SetVertexDeclaration(VertexPos::Decl));
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetMatrix(mhWVP, &(mView*mProj)));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
for (UINT i = 0; i < numPasses; ++i)
{
HR(mFX->BeginPass(i));
HR(gd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, mNumVertices, 0, mNumTriangles));
HR(mFX->EndPass());
}
HR(mFX->End());
mGfxStats->display(D3DCOLOR_XRGB(0,0,0));
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例4: drawScene
void GfxStatsDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0));
HR(gd3dDevice->BeginScene());
mGfxStats->display();
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例5: drawScene
void MultiTexDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
// Setup the rendering FX
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetMatrix(mhWVP, &(mWorld*mView*mProj)));
D3DXMATRIX worldInvTrans;
D3DXMatrixInverse(&worldInvTrans, 0, &mWorld);
D3DXMatrixTranspose(&worldInvTrans, &worldInvTrans);
HR(mFX->SetMatrix(mhWorldInvTrans, &worldInvTrans));
HR(mFX->SetValue(mhLightVecW, &mLightVecW, sizeof(D3DXVECTOR3)));
HR(mFX->SetValue(mhDiffuseMtrl, &mDiffuseMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientMtrl, &mAmbientMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientLight, &mAmbientLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecularLight, &mSpecularLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecularMtrl, &mSpecularMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetFloat(mhSpecularPower, mSpecularPower));
HR(mFX->SetMatrix(mhWorld, &mWorld));
HR(mFX->SetTexture(mhTex0, mTex0));
HR(mFX->SetTexture(mhTex1, mTex1));
HR(mFX->SetTexture(mhTex2, mTex2));
HR(mFX->SetTexture(mhBlendMap, mBlendMap));
HR(gd3dDevice->SetVertexDeclaration(VertexPNT::Decl));
HR(gd3dDevice->SetStreamSource(0, mGridVB, 0, sizeof(VertexPNT)));
HR(gd3dDevice->SetIndices(mGridIB));
// Begin passes.
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
for(UINT i = 0; i < numPasses; ++i)
{
HR(mFX->BeginPass(i));
HR(gd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, mNumGridVertices, 0, mNumGridTriangles));
HR(mFX->EndPass());
}
HR(mFX->End());
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例6: drawScene
void SolarSysDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(mFX->SetValue(mhLight, &mLight, sizeof(DirLight)));
HR(mFX->SetTechnique(mhTech));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
HR(mFX->BeginPass(0));
// Wrap the texture coordinates that get assigned to TEXCOORD2 in the pixel shader.
HR(gd3dDevice->SetRenderState(D3DRS_WRAP2, D3DWRAP_U));
// Build the world transforms for each frame, then render them.
buildObjectWorldTransforms();
D3DXMATRIX S;
for(int i = 0; i < NUM_OBJECTS; ++i)
{
float s = mObject[i].size;
D3DXMatrixScaling(&S, s, s, s);
// Prefix the frame matrix with a scaling transformation to
// size it relative to the world.
mWorld = S * mObject[i].toWorldXForm;
HR(mFX->SetMatrix(mhWVP, &(mWorld*mView*mProj)));
D3DXMATRIX worldInvTrans;
D3DXMatrixInverse(&worldInvTrans, 0, &mWorld);
D3DXMatrixTranspose(&worldInvTrans, &worldInvTrans);
HR(mFX->SetMatrix(mhWorldInvTrans, &worldInvTrans));
HR(mFX->SetMatrix(mhWorld, &mWorld));
HR(mFX->SetValue(mhMtrl, &mWhiteMtrl, sizeof(Mtrl)));
HR(mFX->SetTexture(mhTex, mObject[i].tex));
HR(mFX->CommitChanges());
mSphere->DrawSubset(0);
}
HR(gd3dDevice->SetRenderState(D3DRS_WRAP2, 0));
HR(mFX->EndPass());
HR(mFX->End());
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例7: drawScene
void WaterDemo::drawScene()
{
HR(gd3dDevice->BeginScene());
mSky->draw();
HR(mFX->SetValue(mhLight, &mLight, sizeof(DirLight)));
HR(mFX->SetMatrix(mhWVP, &(mSceneWorld*gCamera->viewProj())));
HR(mFX->SetValue(mhEyePosW, &gCamera->pos(), sizeof(D3DXVECTOR3)));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
HR(mFX->BeginPass(0));
for(UINT j = 0; j < mSceneMtrls.size(); ++j)
{
HR(mFX->SetValue(mhMtrl, &mSceneMtrls[j], sizeof(Mtrl)));
// If there is a texture, then use.
if(mSceneTextures[j] != 0)
{
HR(mFX->SetTexture(mhTex, mSceneTextures[j]));
}
// But if not, then set a pure white texture. When the texture color
// is multiplied by the color from lighting, it is like multiplying by
// 1 and won't change the color from lighting.
else
{
HR(mFX->SetTexture(mhTex, mWhiteTex));
}
HR(mFX->SetTexture(mhNormalMap, mSceneNormalMaps[j]));
HR(mFX->CommitChanges());
HR(mSceneMesh->DrawSubset(j));
}
HR(mFX->EndPass());
HR(mFX->End());
// Draw alpha blended object last.
mWater->draw();
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例8: drawScene
void DiffusePyramidDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
// Let Direct3D know the vertex buffer, index buffer and vertex
// declaration we are using.
HR(gd3dDevice->SetStreamSource(0, mVB, 0, sizeof(VertexPN)));
HR(gd3dDevice->SetVertexDeclaration(VertexPN::Decl));
// Setup the rendering FX
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetMatrix(mhWVP, &(mWorld*mView*mProj)));
D3DXMATRIX worldInverseTranspose , tmp1;
D3DXMatrixInverse(&worldInverseTranspose, 0, &mWorld);
D3DXMatrixTranspose(&tmp1, &worldInverseTranspose);
////! debug
//if (worldInverseTranspose!=tmp1)
//{
// DebugBreak();
//}
HR(mFX->SetMatrix(mhWorldInverseTranspose, &worldInverseTranspose));
HR(mFX->SetValue(mhLightVecW, &mLightVecW, sizeof(D3DXVECTOR3)));
HR(mFX->SetValue(mhDiffuseMtrl, &mDiffuseMtrl, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
// Begin passes.
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
for(UINT i = 0; i < numPasses; ++i)
{
HR(mFX->BeginPass(i));
HR(gd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 4));
HR(mFX->EndPass());
}
HR(mFX->End());
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例9: drawScene
void TerrainDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
mTerrain->draw(mView, mProj);
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例10: drawScene
void XFileDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(mFX->SetValue(mhLight, &mLight, sizeof(DirLight)));
HR(mFX->SetMatrix(mhWVP, &(mWorld*mView*mProj)));
D3DXMATRIX worldInvTrans;
D3DXMatrixInverse(&worldInvTrans, 0, &mWorld);
D3DXMatrixTranspose(&worldInvTrans, &worldInvTrans);
HR(mFX->SetMatrix(mhWorldInvTrans, &worldInvTrans));
HR(mFX->SetMatrix(mhWorld, &mWorld));
HR(mFX->SetTechnique(mhTech));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
HR(mFX->BeginPass(0));
for (int j = 0; j < mMtrl.size(); ++j)
{
HR(mFX->SetValue(mhMtrl, &mMtrl[j], sizeof(Material)));
if (mTex[j] != 0)
{
HR(mFX->SetTexture(mhTex, mTex[j]));
}
else
{
HR(mFX->SetTexture(mhTex, mWhiteTex));
}
HR(mFX->CommitChanges());
HR(mMesh->DrawSubset(j));
}
HR(mFX->EndPass());
HR(mFX->End());
mGfxStats->display(D3DCOLOR_XRGB(0,0,0));
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例11: drawScene
void CubeDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255,255,255), 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(gd3dDevice->SetStreamSource(0, mVB, 0, sizeof(VertexPos)));
HR(gd3dDevice->SetIndices(mIB));
HR(gd3dDevice->SetVertexDeclaration(VertexPos::Decl));
D3DXMATRIX W;
D3DXMatrixIdentity(&W);
HR(gd3dDevice->SetTransform(D3DTS_WORLD, &W));
HR(gd3dDevice->SetTransform(D3DTS_VIEW, &mView));
HR(gd3dDevice->SetTransform(D3DTS_PROJECTION, &mProj));
HR(gd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME));
HR(gd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8, 0, 12));
mGfxStats->display(D3DCOLOR_XRGB(0,0,0));
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例12: drawScene
void ProjTexDemo::drawScene()
{
HR(gd3dDevice->BeginScene());
// Draw sky first--this also replaces our gd3dDevice->Clear call.
//mSky->draw();
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0));
// Draw the scene mesh.
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetMatrix(mhWorldInvTrans, &mSceneWorld));
HR(mFX->SetMatrix(mhWorld, &mSceneWorld));
HR(mFX->SetValue(mhLight, &mLight, sizeof(SpotLight)));
HR(mFX->SetMatrix(mhWVP, &(mSceneWorld*gCamera->viewProj())));
HR(mFX->SetValue(mhEyePosW, &gCamera->pos(), sizeof(D3DXVECTOR3)));
HR(mFX->SetTexture(mhTex, mSkullTex));
HR(mFX->SetMatrix(mhLightWVP, &mLightWVP));
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
HR(mFX->BeginPass(0));
for(UINT j = 0; j < mSceneMtrls.size(); ++j)
{
HR(mFX->SetValue(mhMtrl, &mSceneMtrls[j], sizeof(Mtrl)));
HR(mFX->CommitChanges());
HR(mSceneMesh->DrawSubset(j));
}
HR(mFX->EndPass());
HR(mFX->End());
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例13: drawScene
void SpotlightDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0));
HR(gd3dDevice->BeginScene());
// Setup the rendering FX
HR(mFX->SetValue(mhAmbientLight, &mAmbientLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecLight, &mSpecLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAttenuation012, &mAttenuation012, sizeof(D3DXVECTOR3)));
HR(mFX->SetFloat(mhSpotPower, mSpotPower));
// Begin passes.
UINT numPasses = 0;
HR(mFX->Begin(&numPasses, 0));
for(UINT i = 0; i < numPasses; ++i)
{
HR(mFX->BeginPass(i));
drawGrid();
drawCylinders();
drawSpheres();
HR(mFX->EndPass());
}
HR(mFX->End());
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例14: drawScene
void GateDemo::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));
HR(gd3dDevice->BeginScene());
// Setup the rendering FX
HR(mFX->SetTechnique(mhTech));
HR(mFX->SetValue(mhLightVecW, &mLightVecW, sizeof(D3DXVECTOR3)));
HR(mFX->SetValue(mhDiffuseLight, &mDiffuseLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhAmbientLight, &mAmbientLight, sizeof(D3DXCOLOR)));
HR(mFX->SetValue(mhSpecularLight, &mSpecularLight, sizeof(D3DXCOLOR)));
drawGround();
drawGate();
mGfxStats->display();
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}
示例15: drawScene
void Evolution::drawScene()
{
// Clear the backbuffer and depth buffer.
HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0));
HR(gd3dDevice->BeginScene());
static char buffer[255];
static RECT clientRect = {0, 0, 0, 0};
GetClientRect(mhMainWnd, &clientRect);
HR(gd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, true));
HR(gd3dDevice->SetRenderState(D3DRS_ALPHAREF, 25));
HR(gd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER));
if (foodList.size() != 0 || eggList.size() != 0)
drawEggsFood();
if (lifeformList.size() != 0)
drawLifeforms();
if (mbDrawInfo)
{
sprintf(buffer, "Carnivore: %d\n"
"Carnivore Parts: %d\n"
"Egg Cycle Length: %f\n"
"Egg Time Length: %f\n"
"Food Cycle Length: %f\n"
"Lifetime Length: %f\n"
"Sight Distance: %f\n"
"Fear Distance: %f\n"
"Pursuit Length: %f\n"
"Speed: %f",
mDrawInfo.carnivore,
mDrawInfo.carnivoreParts,
mDrawInfo.eggCycleLength,
mDrawInfo.eggTimeLength,
mDrawInfo.foodCycleLength,
mDrawInfo.lifeTimeLength,
mDrawInfo.sightDistance,
mDrawInfo.fearDistance,
mDrawInfo.pursuitLength,
mDrawInfo.speed);
RECT N = {clientRect.left, clientRect.top+(4*18), clientRect.left+300, clientRect.top+(14*18)};
HR(mFont->DrawText(0, buffer, -1, &N, DT_LEFT | DT_NOCLIP, D3DCOLOR_XRGB(0, 0, 0)));
}
/*if (foodList.size() + BellyFoods + eggList.size() != mMaxBio || BellyFoods < 0)
{
sprintf(buffer, "BIOMASS LOST/GAINED");
RECT N = {clientRect.left, clientRect.top+(4*18), clientRect.left+300, clientRect.top+(13*18)};
HR(mFont->DrawText(0, buffer, -1, &N, DT_LEFT | DT_NOCLIP, D3DCOLOR_XRGB(255, 0, 0)));
}*/
mGfxStats->display();
HR(gd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, false));
HR(gd3dDevice->EndScene());
// Present the backbuffer.
HR(gd3dDevice->Present(0, 0, 0, 0));
}