Original Post
I'm trying to enable depth buffering because I can see polygons behind other polygons but I can't get it working. Heres my code for it: If I change D3DRS_ZENABLE to false everything works (except for the fact I can see through walls and such) If I set it to true my polygons are rendered but have many of there pixels blacked out and in some cases not rendered at all (even when they should be i think) Any help would be really appreciated
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
if(FAILED(g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3dDevice)))
return E_FAIL;
d3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);