|
一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(9) g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(CUSTOMVERTEX) ); // 我们使用vertex declaration g_pd3dDevice->SetVertexDeclaration( g_pVertexDeclaration); #if VS_TYPE != 0 g_pd3dDevice->SetVertexShader(g_pVS); #endif //g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX ); g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 1 ); #if VS_TYPE != 0 g_pd3dDevice->SetVertexShader(NULL); #endif // End the scene g_pd3dDevice->EndScene(); } // Present the backbuffer contents to the display g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); } //----------------------------------------------------------------------------- // Name: Cleanup() // Desc: Releases all previously initialized objects //----------------------------------------------------------------------------- VOID Cleanup() { SAFE_RELEASE(g_pVertexDeclaration); SAFE_RELEASE(g_pVS); if( g_pVB != NULL ) g_pVB->Release();
if( g_pd3dDevice != NULL ) g_pd3dDevice->Release(); if( g_pD3D != NULL ) g_pD3D->Release(); } //----------------------------------------------------------------------------- // Name: MsgProc() // Desc: The window's message handler //----------------------------------------------------------------------------- LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) {
|