Article ID: 152668
Article Last Modified on 2/23/2007
scene->Move(D3DVALUE(1.0)); view->Clear(); view->Render(scene); rmdev->Update();If you want to render without clearing your target surface, you will need to remove your call to Clear. If you do this, however, your z-buffer will not get cleared and your objects will not be rendered properly. If you obtain the immediate mode viewport associated with your retained mode viewport, you can clear the z-buffer without clearing the target. Call IDirect3DRMViewport::GetDirect3DViewport to retrieve the Direct3D immediate mode viewport and then call the immediate mode viewport's Clear method to clear the z-buffer. You can do this by calling IDirect3DViewport::Clear with the D3DCLEAR_ZBUFFER flag set.
LPDIRECT3DVIEWPORT d3dview; scene->Move(D3DVALUE(1.0)); view->GetDirect3DViewport(&d3dview); int clearflags; D3DRECT rc; clearflags = D3DCLEAR_ZBUFFER; rc.x1 = rc.y1 = 0; rc.x2 = 640; rc.y2 = 480; d3dview->Clear(1, &rc, clearflags); view->Render(scene); rmdev->Update();
Additional query words: 4.00
Keywords: kbdirect3drm kbfaq kbhowto KB152668