D3D7 -> WineD3D, 2nd attempt

Stefan Dösinger stefandoesinger at gmx.at
Sun Oct 9 17:17:47 CDT 2005


Hello,
I am trying again to Implement Direct3D 7 using WineD3D, and I've made some 
progress. The D3D7 Device implementation seems to initialize correctly, with 
the correct surfaces.

My solution looks like this:

* DirectDraw is unmodified, and it remains in ddraw.dll.
* Direct3D7 uses generally the Direct3D9 interface of WineD3D. The only 
changes made to WineD3D are in WineD3DDeviceImpl_Release and a little change 
in WineD3DSurface.
* WineD3D Surfaces can be attached to DDraw Surfaces, and they receive the 
properties of their parents, including the memory reserved for the surface
* The D3D7 implementation creates a SwapChain and a RenderTarget from the 
DirectDrawSurface it's attached to, as well as a DepthStencil WineD3D surface 
to make WineD3D happy

I've made the following changes to WineD3D so far:
* Make WineD3D handle dxVersion 7, generally with the same code as with 
dxVersion 7
* A new parameter to WineD3DDevice_Create: a pointer, which specifies an 
existing surface memory. If != NULL is passed, no memory is reserved by 
WineD3D, and it's not Released on WineD3DSurface_Release
* When releasing the WineD3DDevice, don't release the parents of the 
RenderTarget, the DepthStencilBuffer, BackBuffer and FrontBuffer, because 
ddraw.dll needs it's surfaces. Instead, release the WineD3DSurfaces only.

The whole thing is far from beeing useable, if anyone is interested in the 
code, I can send it, but be warned, it's quite a mess at the moment. My plan 
is to get some games running, and then I'll send small and clean patches for 
CVS commit and upload a big patch somewhere for prior testing.

Stefan




More information about the wine-devel mailing list