   How to use the depth buffer?
  I'm working with a orthographic projection, but I figure that shouldn't matter. I want to draw triangles to the screen in any random order using different Z values to force some triangles to be infront of others. But I can't figure out how to get it to work.I set the autodepthstencil in present parameters, and am using D3DFMT_D16 as the format. I also tried useing SetRenderState(D3DRS_ZWRITEENABLE, true); but the z values don't effect anything, everything is just shown in the order they are drawn.What do I need to do to make use of a depth buffer?   
  did you try SetRenderState(D3DRS_ZENABLE, true); ?   ;  Also, make sure that the near and far parameters of your projection matrix are not the same value. The bits of the depth buffer are effectively spread between the near and far plane.   ;  solved it, A very simple mistake, for got I was still setting all the z values to 0.   