Index: ddraw/glDirect3D.cpp |
— | — | @@ -289,7 +289,7 @@ |
290 | 290 | {
|
291 | 291 | if(!this) return DDERR_INVALIDPARAMS;
|
292 | 292 | HRESULT ret;
|
293 | | - glDirect3DDevice7 *glD3DDev7 = new glDirect3DDevice7(this,(glDirectDrawSurface7*)lpDDS);
|
| 293 | + glDirect3DDevice7 *glD3DDev7 = new glDirect3DDevice7(rclsid,this,(glDirectDrawSurface7*)lpDDS);
|
294 | 294 | if(!glD3DDev7) return DDERR_OUTOFMEMORY;
|
295 | 295 | if(FAILED(glD3DDev7->err()))
|
296 | 296 | {
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -246,7 +246,7 @@ |
247 | 247 | }
|
248 | 248 |
|
249 | 249 |
|
250 | | -glDirect3DDevice7::glDirect3DDevice7(glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7)
|
| 250 | +glDirect3DDevice7::glDirect3DDevice7(REFCLSID rclsid, glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7)
|
251 | 251 | {
|
252 | 252 | int zbuffer = 0;
|
253 | 253 | glD3DDev3 = NULL;
|
— | — | @@ -1918,6 +1918,7 @@ |
1919 | 1919 | if(!lpDirect3DViewport) return DDERR_INVALIDPARAMS;
|
1920 | 1920 | if(!lpRect) return DDERR_INVALIDPARAMS;
|
1921 | 1921 | FIXME("glDirect3DDevice1::Pick: stub");
|
| 1922 | + ERR(DDERR_GENERIC);
|
1922 | 1923 | }
|
1923 | 1924 |
|
1924 | 1925 | // IDirect3DDevice3 wrapper
|
Index: ddraw/glDirect3DDevice.h |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | class glDirect3DDevice7 : public IDirect3DDevice7
|
72 | 72 | {
|
73 | 73 | public:
|
74 | | - glDirect3DDevice7(glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7);
|
| 74 | + glDirect3DDevice7(REFCLSID rclsid, glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7);
|
75 | 75 | virtual ~glDirect3DDevice7();
|
76 | 76 | HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
|
77 | 77 | ULONG WINAPI AddRef();
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -673,8 +673,10 @@ |
674 | 674 | }
|
675 | 675 | if(riid == IID_IDirect3D)
|
676 | 676 | {
|
677 | | - FIXME("Add IDirect3D Interfaces\n");
|
678 | | - ERR(DDERR_GENERIC);
|
| 677 | + glDirect3D7 *tmp = new glDirect3D7(this);
|
| 678 | + tmp->QueryInterface(IID_IDirect3D,ppvObj);
|
| 679 | + tmp->Release();
|
| 680 | + return DD_OK;
|
679 | 681 | }
|
680 | 682 | if(riid == IID_IDirect3D2)
|
681 | 683 | {
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | #include "ddraw.h"
|
23 | 23 | #include "texture.h"
|
24 | 24 | #include "glRenderer.h"
|
| 25 | +#include "glDirect3D.h"
|
25 | 26 | #include "glDirect3DDevice.h"
|
26 | 27 | #include "glDirectDraw.h"
|
27 | 28 | #include "glDirectDrawSurface.h"
|
— | — | @@ -446,6 +447,32 @@ |
447 | 448 | return DD_OK;
|
448 | 449 | }
|
449 | 450 | }
|
| 451 | + if((riid == IID_IDirect3DDevice) || (riid == IID_IDirect3DHALDevice) || (riid == IID_IDirect3DRGBDevice) ||
|
| 452 | + (riid == IID_IDirect3DRampDevice) || (riid == IID_IDirect3DRefDevice))
|
| 453 | + {
|
| 454 | +
|
| 455 | + if(!device)
|
| 456 | + {
|
| 457 | + glDirect3D7 *tmpd3d;
|
| 458 | + glDirect3DDevice7 *tmpdev;
|
| 459 | + ddInterface->QueryInterface(IID_IDirect3D7,(void**)&tmpd3d);
|
| 460 | + if(!tmpd3d) return E_NOINTERFACE;
|
| 461 | + tmpd3d->CreateDevice(riid,this,(LPDIRECT3DDEVICE7*)&tmpdev);
|
| 462 | + if(!tmpdev)
|
| 463 | + {
|
| 464 | + tmpdev->Release();
|
| 465 | + return E_NOINTERFACE;
|
| 466 | + }
|
| 467 | + HRESULT ret = tmpdev->QueryInterface(IID_IDirect3DDevice,ppvObj);
|
| 468 | + tmpdev->Release();
|
| 469 | + tmpd3d->Release();
|
| 470 | + return ret;
|
| 471 | + }
|
| 472 | + else
|
| 473 | + {
|
| 474 | + return device->QueryInterface(IID_IDirect3DDevice,ppvObj);
|
| 475 | + }
|
| 476 | + }
|
450 | 477 | return E_NOINTERFACE;
|
451 | 478 | }
|
452 | 479 | ULONG WINAPI glDirectDrawSurface7::AddRef()
|