本文整理汇总了C++中MESH::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ MESH::Render方法的具体用法?C++ MESH::Render怎么用?C++ MESH::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MESH
的用法示例。
在下文中一共展示了MESH::Render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
HRESULT APPLICATION::Render()
{
// Clear the viewport
m_pDevice->Clear( 0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0L );
// Begin the scene
if(SUCCEEDED(m_pDevice->BeginScene()))
{
if(m_wireframe)m_pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
else m_pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
//Render either of the meshes
if(m_activeMesh == 0)
m_mesh1.Render();
else m_mesh2.Render();
RECT r[] = {{10, 10, 0, 0}, {10, 30, 0, 0}};
m_pFont->DrawText(NULL, "Space: Next Object", -1, &r[0], DT_LEFT| DT_TOP | DT_NOCLIP, 0xff000000);
m_pFont->DrawText(NULL, "W: Toggle Wireframe", -1, &r[1], DT_LEFT| DT_TOP | DT_NOCLIP, 0xff000000);
// End the scene.
m_pDevice->EndScene();
m_pDevice->Present(0, 0, 0, 0);
}
return S_OK;
}
示例2: Render
HRESULT APPLICATION::Render()
{
// Clear the viewport
m_pDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
//Set camera
D3DXMATRIX view, proj, world, identity;
D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(15.0f, 30.0f, -40.0f), &D3DXVECTOR3(0.0f, 11.0f, 0.0f), &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
D3DXMatrixPerspectiveFovLH(&proj, D3DX_PI * 0.3f, 1.33333f, 0.01f, 1000.0f);
D3DXMatrixIdentity(&identity);
m_pDevice->SetTransform(D3DTS_WORLD, &identity);
m_pDevice->SetTransform(D3DTS_VIEW, &view);
m_pDevice->SetTransform(D3DTS_PROJECTION, &proj);
// Begin the scene
if(SUCCEEDED(m_pDevice->BeginScene()))
{
if(m_buildPrc < 1.0f)
{
m_build1.Render(m_buildPrc);
//Progressbar
m_pDevice->Clear(1, &SetRect(10, 560, 790, 590), D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0);
m_pDevice->Clear(1, &SetRect(12, 562, 788, 588), D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
m_pDevice->Clear(1, &SetRect(12, 562, (int)(12 + 774 * m_buildPrc), 588), D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0);
}
else m_build2.Render();
// End the scene.
m_pDevice->EndScene();
m_pDevice->Present(0, 0, 0, 0);
}
return S_OK;
}