'Device type "D3DDEVTYPE_HAL" not available, ie no Hardware acceleration
MsgBox "Hardware acceleration not supported!", vbCritical
Initialise = False
Exit Function
Else
'Supports Hardware Acceleration...
On Error GoTo ErrHandler 'Restore the error handler because we had changed it to "Resume Next" remember
If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D32) = D3D_OK Then
'We can use a 32 bit Z-Buffer
D3DWindow.AutoDepthStencilFormat = D3DFMT_D32
Else
'Could not support a 32 bit Z-Buffer, try a 24 bit Z-Buffer...
If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24X8) = D3D_OK Then
'We can use a 24 bit Z-Buffer
D3DWindow.AutoDepthStencilFormat = D3DFMT_D24X8
Else
'Could not support a 24 bit Z-Buffer, try a 16 bit Z-Buffer...
If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D16) = D3D_OK Then
'We can use a 16 bit Z-Buffer
D3DWindow.AutoDepthStencilFormat = D3DFMT_D16
Else
MsgBox "Could not find a supported format for a Z-Buffer!", vbCritical
Initialise = False
Exit Function
End If
End If
End If
End If
What depth of Z Buffer are you already using? This should get the biggest it can work with (hopefully ). I have seen this problem occurr before when I was using a 16bit one.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Thanks, but I'm already looking for the biggest possible Z-buffer which is D3DFMT_16 on my laptop.
I hoped there was a way to optimize the precision of the Z-buffer since my game world is nearly flat and I do exactly know in which distance I need a tighter Z-buffer...
Which formats are you checking? My old PC Supported D32 but my new one didn't so I had to add it to check for DM24X8 which does work on my new one. There might be another one that would work on your laptop?
I haven't heard of anything like you mentioned by changing the position of the precission before.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.