The information in this article applies to:
SUMMARYThe IDirect3DRMViewport::Clear function clears a Retained Mode viewport's z-buffer and target rendering surface. You cannot direct this function to clear the z-buffer only. If you need to clear the z-buffer without calling IDirect3DRMViewport::Clear, then you will need to extract the immediate mode viewport from the retained mode viewport and use the low level clear functions in the immediate mode API to clear the z-buffer only. MORE INFORMATIONA set of normal Retained Mode rendering instructions may look like the following:
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.
Sample CodeThe following code shows how you can modify your rendering calls to achieve this functionality:
Additional query words: 4.00
Keywords : kbDirect3dRM KbDirectX kbWinOS2000 kbfaq kbDirect3D |
Last Reviewed: January 21, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |