Archived

This topic is now archived and is closed to further replies.

Why the viewport isn't cleared?

This topic is 5667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Until now I only used the D3DCLEAR_TARGET and D3DCLEAR_ZBUFFER flags with the IDirect3DDevice8::Clear() function. But when I add the flag D3DCLEAR_STENCIL with the reference value 0, only the part of the screen where pixels are drawn is cleared. I wonder what''s going on... I know I could just trash the D3DCLEAR_STENCIL flag since I don''t use the stencil buffer, but I''d like to understand what Direct3D is doing.

Share this post


Link to post
Share on other sites
Hey there,

Similar things happen if you try to Clear() with D3DCLEAR_ZBUFFER in the flags, and you don''t actually have a Z-Buffer (i.e. EnableAutoDepthStencil is false and no other Z buffer is present). If you don''t have a stencil buffer then I imagine similar things should take place when you specify D3DCLEAR_STENCIL.

Take your own advice and trash D3DCLEAR_STENCIL unless you use a stencil buffer for something

Share this post


Link to post
Share on other sites