Original Post
I am making a game engine and cannot get the z-buffer to work. My program currently loads several .x files but the surfaces of the models clearly overlap. I think I've included all the needed code, eg: d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3dpp.EnableAutoDepthStencil = TRUE; and... g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);//Turn on the zbuffer (and cleared the z-buffer on the render fuction) Pixels still show infront of those that should be in the foreground. ???