Why the viewport isn't cleared?

Started by
1 comment, last by Alload 21 years, 10 months ago
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.
Advertisement
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

refrain_from_stupidity( &me );
Oh yeah, I had forgotten to change the flag of the AutoDepthStencilFormat in the D3DPRESENT_PARAMETERS.

This topic is closed to new replies.

Advertisement