Render()过程

VOID Render()  
  
{  
  
    //清空后台缓冲区  
  
    g_pd3dDevice->Clear(0, NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,0,255),1.0f,0  
  
 );  
  
    //开始在后台缓冲区绘制图形  
  
    if( SUCCEEDED(g_pd3dDevice->BeginScene()))  
  
    {  
  
        //在后台缓冲区绘制图形  
  
        g_pd3dDevice->SetStreamSource(0, g_pVB,0, sizeof(CUSTOMVERTEX));  
  
        g_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX);  
  
        g_pd3dDevice->SetIndices(g_pIB); //设置索引缓冲区  
  
        g_pd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST,0,0,9,0,8);  
  
        //结束在后台缓冲区渲染图形  
  
        g_pd3dDevice->EndScene();  
  
    } 
  
    //将在后台缓冲区绘制的图形提交到前台缓冲区显示  
  
    g_pd3dDevice->Present(NULL,NULL,NULL,NULL);  
  
    }  

你可能感兴趣的:(null,图形)