-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
One I don't like here is the hardcoded DDSCAPS_SYSTEMEMORY for the Z buffer. You need it on Windows because of the RGB device and Wine doesn't check, so it kinda works. But I recommend to do something like this:
BOOL use_sysmem_zbuffer;
...
hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &d3drm_surface); hr = IDirectDrawSurface_GetAttachedSurface(d3drm_surface, &caps, &ds); hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc);
use_sysmem_zbuffer = desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY;
... /* Release everything */ /* Create new sysmem surface */ when creating the new Z buffer set DDSCAPS_SYSTEMMEMORY only if use_sysmem_zbuffer is true.
Another thing to test: After destroying the d3drm device is the Z buffer removed from the surface when (a) d3drm created it and (b) you created it?
Cheers, Stefan