• Advertisement
Sign in to follow this  

AutoDepthStencilFormat produces garbage?

This topic is 4149 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

Hello everyone, I'm coding a simple DX9 framework for myself. The thing is that when i use D3DFMT_D24S8 or D3DFMT_D24X8 as the stencil format, my triangle produces garbage. But when i use D3DFMT_D16, it works a little better, but still produces garbage. I dont hardcode the format, but i use this code to do the checking: if(SUCCEEDED(m_pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, adapterFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24S8))) { m_D3Dpp.AutoDepthStencilFormat = D3DFMT_D24S8; } So if my graphicscard would not support it, then it would fail right? The GC is a 7600 Go (i'm coding on my laptop). Any ideas what could be wrong? EDIT: D3DFMT_D16 does not work correctly, i still get garbage (though less)!

Share this post


Link to post
Share on other sites
Advertisement
m_pD3DDevice->Clear(0, 0, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 100), 1.0f, 0);

I forgot that you have to clear that every frame too. Doh! Thanks man :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement