AutoDepthStencilFormat produces garbage?

Started by
1 comment, last by Oguz286 17 years, 6 months ago
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)!
Advertisement
Um, are you clearing all of the buffers?
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

This topic is closed to new replies.

Advertisement