What I would do if I were you is enumerate the Z-Buffers. Start checking if it supports the lowest all the way to the highest. Here's what Jack Hoxley did on DirectX4VB:
VB Code:
If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D16) = D3D_OK Then Debug.Print "16 bit Z-Buffers are supported (D3DFMT_D16)" End If If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D16_LOCKABLE) = D3D_OK Then Debug.Print "Lockable 16 bit Z-Buffers are supported (D3DFMT_D16_LOCKABLE)" End If If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D24S8) = D3D_OK Then Debug.Print "32 bit divided between 24 bit Depth and 8 bit stencil are supported (D3DFMT_D24S8)" End If If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D24X4S4) = D3D_OK Then Debug.Print "32 bit divided between 24 bit depth, 4 bit stencil and 4 bit unused (D3DFMT_D24X4S4)" End If If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D24X8) = D3D_OK Then Debug.Print "24 bit Z-Buffer supported (D3DFMT_D24X8)" End If If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _ D3DRTYPE_SURFACE, D3DFMT_D32) = D3D_OK Then Debug.Print "Pure 32 bit Z-buffer supported (D3DFMT_D32)" End If
Comes in handy. It helps my DirectX8 programs become more compatible with the various video cards out there and uses the most precise Z Buffer available. If you are using C++ (I bet you are), converting this snippet of code should be no problem.![]()




Reply With Quote