本文整理汇总了C++中CGutModel_DX10::SetLight方法的典型用法代码示例。如果您正苦于以下问题:C++ CGutModel_DX10::SetLight方法的具体用法?C++ CGutModel_DX10::SetLight怎么用?C++ CGutModel_DX10::SetLight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGutModel_DX10
的用法示例。
在下文中一共展示了CGutModel_DX10::SetLight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderFrameDX10
void RenderFrameDX10(void)
{
Vector4 vClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// 取得呼叫GutCreateGraphicsDeviceDX10時所產生的D3D10物件
ID3D10RenderTargetView *pRenderTargetView = GutGetDX10RenderTargetView(); //frame buffer
ID3D10DepthStencilView *pDepthStencilView = GutGetDX10DepthStencilView(); //depth/stencil buffer
IDXGISwapChain *pSwapChain = GutGetDX10SwapChain(); // front/back buffer
g_pDevice->ClearRenderTargetView(pRenderTargetView, &vClearColor[0]);
g_pDevice->ClearDepthStencilView(pDepthStencilView, D3D10_CLEAR_DEPTH|D3D10_CLEAR_STENCIL, 1.0f, 0);
Matrix4x4 camera_matrix = g_Control.GetCameraMatrix();
Matrix4x4 view_matrix = g_Control.GetViewMatrix();
Matrix4x4 world_matrix = g_Control.GetObjectMatrix();
g_Model_DX10.SetLight(0, g_Lights[0]);
g_Model_DX10.SetLight(1, g_Lights[1]);
g_Model_DX10.EnableLighting(true);
g_Model_DX10.SetProjectionMatrix(g_proj_matrix);
g_Model_DX10.SetWorldMatrix(world_matrix);
g_Model_DX10.SetViewMatrix(view_matrix);
g_Model_DX10.SetInvViewMatrix(camera_matrix);
g_Model_DX10.UpdateMatrix();
g_Model_DX10.Render();
// 等待硬體掃結束, 然後才更新畫面
pSwapChain->Present(1, 0);
}