Hi. I'm trying to set up a minimal implementation that will allow to run Assasin's Creed III. It uses these 2 functions:
dxgi.dll.CreateDXGIFactory1 d3d11.dll.D3D11CreateDevice
See http://bugs.winehq.org/show_bug.cgi?id=24517
I need an advice on how to implement CreateDXGIFactory1 without duplicating a lot of code. There are problems with a straight-forward implementation:
interface IWineDXGIFactory : IDXGIFactory { struct wined3d *get_wined3d(); }
interface IWineDXGIFactory1 : IDXGIFactory1 { struct wined3d *get_wined3d(); }
The problem is how to reuse functions where IWineDXGIFactory is used. Obviously we can't pass IWineDXGIFactory1 object where IWineDXGIFactory is required. Because the next time we call get_wined3d, a crash will occur (a different function will be called).
Is there a more elegant solution than duplicating code and replacing all occurencdes of IWineDXGIFactory by IWineDXGIFactory1?
Btw, D3D11CreateDevice accepts both IDXGIFactory and IDXGIFactory1: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476082(v=vs.85).as...
On 28 May 2013 00:36, John Yani vanuan@gmail.com wrote:
Hi. I'm trying to set up a minimal implementation that will allow to run Assasin's Creed III.
It's somewhat unlikely that you'll be able to make the game work just by implementing these functions, your best chance in that regard may be to disable dxgi in winecfg and hope it falls back to d3d9.
I need an advice on how to implement CreateDXGIFactory1 without duplicating a lot of code. There are problems with a straight-forward implementation:
interface IWineDXGIFactory : IDXGIFactory { struct wined3d *get_wined3d(); }
interface IWineDXGIFactory1 : IDXGIFactory1 { struct wined3d *get_wined3d(); }
The problem is how to reuse functions where IWineDXGIFactory is used. Obviously we can't pass IWineDXGIFactory1 object where IWineDXGIFactory is required. Because the next time we call get_wined3d, a crash will occur (a different function will be called).
Is there a more elegant solution than duplicating code and replacing all occurencdes of IWineDXGIFactory by IWineDXGIFactory1?
Note that IDXGIFactory1 is derived from IDXGIFactory. You should probably make IWineDXGIFactory derived from IDXGIFactory1 instead of from IDXGIFactory, and then just add the extra methods to dxgi_factory_vtbl. Depending on if you can QueryInterface a IDXGIFactory1 interface from a dxgi factory created by CreateDXGIFactory() or not you may need to add some kind of flag to struct dxgi_factory to handle that in dxgi_factory_QueryInterface(). See also for example d3d9_QueryInterface() in dlls/d3d9/directx.c, it has a similar construction for IDirect3D9Ex.