dxgi, directx 11 and code duplication
John Yani
vanuan at gmail.com
Mon May 27 13:53:40 CDT 2013
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).aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130527/0b6fcb0b/attachment.html>
More information about the wine-devel
mailing list