
i
i
i
i
i
i
i
i
13.3. Visualizing a Virtual World Using Direct3D 343
VOID RenderScene(void){
// Clear the backbuffer and the zbuffer
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );
// Begin the scene
if( SUCCEEDED( g_pd3dDevice->BeginScene() ) ) {
// Setup the lights and materials
// and viewing matrices to describe the scene
SetupLightsMatricesMaterials(); // USER FUNCTION
// Render the vertex buffer contents NOTE: g_pVB is a pointer to
// an object describing the scene geometry which must be loaded
// before rendering begins
g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(CUSTOMVERTEX) );
g_pd3dDevice->SetFVF( ...