Index: ddraw/glDirect3D.cpp |
— | — | @@ -371,10 +371,10 @@ |
372 | 372 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
373 | 373 | if(!lplpD3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
374 | 374 | if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
375 | | - *lplpD3DViewport = new glDirect3DViewport3();
|
| 375 | + HRESULT ret = glDirect3DViewport3_Create(lplpD3DViewport);
|
376 | 376 | TRACE_VAR("*lplpD3DViewport",14,*lplpD3DViewport);
|
377 | | - TRACE_EXIT(23,D3D_OK);
|
378 | | - return D3D_OK;
|
| 377 | + TRACE_EXIT(23,ret);
|
| 378 | + return ret;
|
379 | 379 | }
|
380 | 380 | HRESULT WINAPI glDirect3D7::EnumDevices(LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback, LPVOID lpUserArg)
|
381 | 381 | {
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -390,9 +390,9 @@ |
391 | 391 | {
|
392 | 392 | if(viewports[i])
|
393 | 393 | {
|
394 | | - viewports[i]->SetDevice(NULL);
|
395 | | - viewports[i]->SetCurrent(false);
|
396 | | - viewports[i]->Release();
|
| 394 | + glDirect3DViewport3_SetDevice(viewports[i], NULL);
|
| 395 | + glDirect3DViewport3_SetCurrent(viewports[i], false);
|
| 396 | + glDirect3DViewport3_Release(viewports[i]);
|
397 | 397 | }
|
398 | 398 | }
|
399 | 399 | for(int i = 0; i < texturecount; i++)
|
— | — | @@ -1915,10 +1915,10 @@ |
1916 | 1916 | if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1917 | 1917 | for(int i = 0; i < maxviewports; i++)
|
1918 | 1918 | {
|
1919 | | - if(viewports[i] == lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 1919 | + if(viewports[i] == (glDirect3DViewport3*)lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1920 | 1920 | }
|
1921 | 1921 | viewports[viewportcount] = (glDirect3DViewport3*)lpDirect3DViewport;
|
1922 | | - viewports[viewportcount]->AddRef();
|
| 1922 | + glDirect3DViewport3_AddRef(viewports[viewportcount]);
|
1923 | 1923 | viewportcount++;
|
1924 | 1924 | if(viewportcount >= maxviewports)
|
1925 | 1925 | {
|
— | — | @@ -1928,13 +1928,13 @@ |
1929 | 1929 | if(!newviewport)
|
1930 | 1930 | {
|
1931 | 1931 | viewports--;
|
1932 | | - viewports[viewportcount]->Release();
|
| 1932 | + glDirect3DViewport3_Release(viewports[viewportcount]);
|
1933 | 1933 | viewports[viewportcount] = NULL;
|
1934 | 1934 | maxviewports -= 32;
|
1935 | 1935 | TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
|
1936 | 1936 | }
|
1937 | 1937 | }
|
1938 | | - viewports[viewportcount-1]->SetDevice(this);
|
| 1938 | + glDirect3DViewport3_SetDevice(viewports[viewportcount-1],this);
|
1939 | 1939 | TRACE_EXIT(23,D3D_OK);
|
1940 | 1940 | return D3D_OK;
|
1941 | 1941 | }
|
— | — | @@ -1946,11 +1946,11 @@ |
1947 | 1947 | if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1948 | 1948 | for(int i = 0; i < maxviewports; i++)
|
1949 | 1949 | {
|
1950 | | - if(viewports[i] == lpDirect3DViewport)
|
| 1950 | + if(viewports[i] == (glDirect3DViewport3*)lpDirect3DViewport)
|
1951 | 1951 | {
|
1952 | | - viewports[i]->SetCurrent(false);
|
1953 | | - viewports[i]->SetDevice(NULL);
|
1954 | | - viewports[i]->Release();
|
| 1952 | + glDirect3DViewport3_SetCurrent(viewports[i],false);
|
| 1953 | + glDirect3DViewport3_SetDevice(viewports[i],NULL);
|
| 1954 | + glDirect3DViewport3_Release(viewports[i]);
|
1955 | 1955 | if(currentviewport == viewports[i]) currentviewport = NULL;
|
1956 | 1956 | viewports[i] = NULL;
|
1957 | 1957 | TRACE_EXIT(23,D3D_OK);
|
— | — | @@ -1978,8 +1978,8 @@ |
1979 | 1979 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1980 | 1980 | if(!lplpd3dViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1981 | 1981 | if(!currentviewport) TRACE_RET(HRESULT,23,D3DERR_NOCURRENTVIEWPORT);
|
1982 | | - *lplpd3dViewport = currentviewport;
|
1983 | | - currentviewport->AddRef();
|
| 1982 | + *lplpd3dViewport = (LPDIRECT3DVIEWPORT3)currentviewport;
|
| 1983 | + glDirect3DViewport3_AddRef(currentviewport);
|
1984 | 1984 | TRACE_VAR("*lplpd3dViewport",14,*lplpd3dViewport);
|
1985 | 1985 | TRACE_EXIT(23,D3D_OK);
|
1986 | 1986 | return D3D_OK;
|
— | — | @@ -1990,12 +1990,12 @@ |
1991 | 1991 | TRACE_ENTER(2,14,this,14,lpd3dViewport);
|
1992 | 1992 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1993 | 1993 | if(!lpd3dViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1994 | | - if(currentviewport == lpd3dViewport) TRACE_RET(HRESULT,23,D3D_OK);
|
| 1994 | + if(currentviewport == (glDirect3DViewport3*)lpd3dViewport) TRACE_RET(HRESULT,23,D3D_OK);
|
1995 | 1995 | for(int i = 0; i < maxviewports; i++)
|
1996 | 1996 | {
|
1997 | | - if(lpd3dViewport == viewports[i])
|
| 1997 | + if(lpd3dViewport == (LPDIRECT3DVIEWPORT3)viewports[i])
|
1998 | 1998 | {
|
1999 | | - viewports[i]->SetCurrent(true);
|
| 1999 | + glDirect3DViewport3_SetCurrent(viewports[i],true);
|
2000 | 2000 | currentviewport = (glDirect3DViewport3*)lpd3dViewport;
|
2001 | 2001 | TRACE_EXIT(23,D3D_OK);
|
2002 | 2002 | return D3D_OK;
|
— | — | @@ -3331,8 +3331,8 @@ |
3332 | 3332 | if(!lpDirect3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
3333 | 3333 | glDirect3DViewport3 *glD3DV3;
|
3334 | 3334 | lpDirect3DViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
|
3335 | | - HRESULT ret = glD3DDev7->AddViewport(glD3DV3);
|
3336 | | - glD3DV3->Release();
|
| 3335 | + HRESULT ret = glD3DDev7->AddViewport((LPDIRECT3DVIEWPORT3)glD3DV3);
|
| 3336 | + glDirect3DViewport3_Release(glD3DV3);
|
3337 | 3337 | TRACE_EXIT(23,ret);
|
3338 | 3338 | return ret;
|
3339 | 3339 | }
|
— | — | @@ -3381,10 +3381,11 @@ |
3382 | 3382 | {
|
3383 | 3383 | TRACE_ENTER(2,14,this,14,lpDirect3DViewport2);
|
3384 | 3384 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 3385 | + if (!lpDirect3DViewport2) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
3385 | 3386 | glDirect3DViewport3 *glD3DV3;
|
3386 | 3387 | lpDirect3DViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
|
3387 | | - HRESULT ret = glD3DDev7->DeleteViewport(glD3DV3);
|
3388 | | - glD3DV3->Release();
|
| 3388 | + HRESULT ret = glD3DDev7->DeleteViewport((LPDIRECT3DVIEWPORT3)glD3DV3);
|
| 3389 | + glDirect3DViewport3_Release(glD3DV3);
|
3389 | 3390 | TRACE_EXIT(23,ret);
|
3390 | 3391 | return ret;
|
3391 | 3392 | }
|
— | — | @@ -3470,8 +3471,8 @@ |
3471 | 3472 | glDirect3DViewport3 *glD3DV3;
|
3472 | 3473 | HRESULT ret = glD3DDev7->GetCurrentViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3);
|
3473 | 3474 | if(!glD3DV3) TRACE_RET(HRESULT,23,ret);
|
3474 | | - glD3DV3->QueryInterface(IID_IDirect3DViewport2,(void**)lplpd3dViewport2);
|
3475 | | - glD3DV3->Release();
|
| 3475 | + glDirect3DViewport3_QueryInterface(glD3DV3,IID_IDirect3DViewport2,(void**)lplpd3dViewport2);
|
| 3476 | + glDirect3DViewport3_Release(glD3DV3);
|
3476 | 3477 | TRACE_VAR("*lplpd3dViewport2",14,*lplpd3dViewport2);
|
3477 | 3478 | TRACE_EXIT(23,ret);
|
3478 | 3479 | return ret;
|
— | — | @@ -3572,8 +3573,8 @@ |
3573 | 3574 | if(!lpd3dViewport2) TRACE_RET(HRESULT,23,glD3DDev7->SetCurrentViewport(NULL));
|
3574 | 3575 | glDirect3DViewport3 *glD3DV3;
|
3575 | 3576 | lpd3dViewport2->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
|
3576 | | - HRESULT ret = glD3DDev7->SetCurrentViewport(glD3DV3);
|
3577 | | - glD3DV3->Release();
|
| 3577 | + HRESULT ret = glD3DDev7->SetCurrentViewport((LPDIRECT3DVIEWPORT3)glD3DV3);
|
| 3578 | + glDirect3DViewport3_Release(glD3DV3);
|
3578 | 3579 | TRACE_EXIT(23,ret);
|
3579 | 3580 | return ret;
|
3580 | 3581 | }
|
— | — | @@ -3681,8 +3682,8 @@ |
3682 | 3683 | if(!lpDirect3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
3683 | 3684 | glDirect3DViewport3 *glD3DV3;
|
3684 | 3685 | lpDirect3DViewport->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
|
3685 | | - HRESULT ret = glD3DDev7->AddViewport(glD3DV3);
|
3686 | | - glD3DV3->Release();
|
| 3686 | + HRESULT ret = glD3DDev7->AddViewport((LPDIRECT3DVIEWPORT3)glD3DV3);
|
| 3687 | + glDirect3DViewport3_Release(glD3DV3);
|
3687 | 3688 | TRACE_EXIT(23,ret);
|
3688 | 3689 | return ret;
|
3689 | 3690 | }
|
— | — | @@ -3715,10 +3716,11 @@ |
3716 | 3717 | {
|
3717 | 3718 | TRACE_ENTER(2,14,this,14,lpDirect3DViewport);
|
3718 | 3719 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 3720 | + if (!lpDirect3DViewport) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
3719 | 3721 | glDirect3DViewport3 *glD3DV3;
|
3720 | 3722 | lpDirect3DViewport->QueryInterface(IID_IDirect3DViewport3,(void**)&glD3DV3);
|
3721 | | - HRESULT ret = glD3DDev7->DeleteViewport(glD3DV3);
|
3722 | | - glD3DV3->Release();
|
| 3723 | + HRESULT ret = glD3DDev7->DeleteViewport((LPDIRECT3DVIEWPORT3)glD3DV3);
|
| 3724 | + glDirect3DViewport3_Release(glD3DV3);
|
3723 | 3725 | TRACE_EXIT(23,ret);
|
3724 | 3726 | return ret;
|
3725 | 3727 | }
|
Index: ddraw/glDirect3DDevice.h |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011-2013 William Feely
|
| 3 | +// Copyright (C) 2011-2014 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | class glDirect3DLight;
|
65 | 65 | class glDirectDrawSurface7;
|
66 | 66 | class glDirect3DMaterial3;
|
67 | | -class glDirect3DViewport3;
|
| 67 | +struct glDirect3DViewport3;
|
68 | 68 | class glDirect3DDevice3;
|
69 | 69 | class glDirect3DDevice2;
|
70 | 70 | class glDirect3DDevice1;
|
Index: ddraw/glDirect3DLight.h |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2012 William Feely
|
| 3 | +// Copyright (C) 2012-2014 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | #ifndef __GLDIRECT3DLIGHT_H
|
21 | 21 | #define __GLDIRECT3DLIGHT_H
|
22 | 22 |
|
23 | | -class glDirect3DViewport3;
|
| 23 | +struct glDirect3DViewport3;
|
24 | 24 | class glDirect3DLight : public IDirect3DLight
|
25 | 25 | {
|
26 | 26 | public:
|
Index: ddraw/glDirect3DViewport.cpp |
— | — | @@ -27,6 +27,8 @@ |
28 | 28 | #include "glDirect3DMaterial.h"
|
29 | 29 | #include "glDirect3DViewport.h"
|
30 | 30 |
|
| 31 | +extern "C" {
|
| 32 | +
|
31 | 33 | inline D3DCOLOR d3dcvtod3dcolor(D3DCOLORVALUE value)
|
32 | 34 | {
|
33 | 35 | int r = (int)(value.r * 255);
|
— | — | @@ -36,44 +38,39 @@ |
37 | 39 | return b|(g<<8)|(r<<16)|(a<<24);
|
38 | 40 | }
|
39 | 41 |
|
40 | | -glDirect3DViewport3::glDirect3DViewport3()
|
| 42 | +HRESULT glDirect3DViewport3_Create(LPDIRECT3DVIEWPORT3 *viewport)
|
41 | 43 | {
|
42 | | - TRACE_ENTER(1,14,this);
|
43 | | - background = 0;
|
44 | | - ZeroMemory(&viewport,sizeof(D3DVIEWPORT2));
|
45 | | - viewport.dwSize = sizeof(D3DVIEWPORT2);
|
46 | | - maxX = maxY = scaleX = scaleY = 0;
|
47 | | - device = NULL;
|
48 | | - backZ = NULL;
|
| 44 | + glDirect3DViewport3 *newvp;
|
| 45 | + TRACE_ENTER(1, 14, viewport);
|
| 46 | + if (!viewport) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 47 | + newvp = (glDirect3DViewport3*)malloc(sizeof(glDirect3DViewport3));
|
| 48 | + if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 49 | + *viewport = (LPDIRECT3DVIEWPORT3)newvp;
|
| 50 | + newvp->background = 0;
|
| 51 | + ZeroMemory(&newvp->viewport,sizeof(D3DVIEWPORT2));
|
| 52 | + newvp->viewport.dwSize = sizeof(D3DVIEWPORT2);
|
| 53 | + newvp->maxX = newvp->maxY = newvp->scaleX = newvp->scaleY = 0;
|
| 54 | + newvp->device = NULL;
|
| 55 | + newvp->backZ = NULL;
|
49 | 56 | for(int i = 0; i < 8; i++)
|
50 | | - lights[i] = NULL;
|
51 | | - refcount = 1;
|
52 | | - current = false;
|
53 | | - glD3DV2 = NULL;
|
54 | | - glD3DV1 = NULL;
|
55 | | - TRACE_EXIT(-1,0);
|
| 57 | + newvp->lights[i] = NULL;
|
| 58 | + newvp->refcount = 1;
|
| 59 | + newvp->current = false;
|
| 60 | + newvp->glD3DV2 = NULL;
|
| 61 | + newvp->glD3DV1 = NULL;
|
| 62 | + TRACE_EXIT(23, DD_OK);
|
| 63 | + return DD_OK;
|
56 | 64 | }
|
57 | 65 |
|
58 | | -glDirect3DViewport3::~glDirect3DViewport3()
|
| 66 | +HRESULT WINAPI glDirect3DViewport3_QueryInterface(glDirect3DViewport3 *This, REFIID riid, void** ppvObj)
|
59 | 67 | {
|
60 | | - TRACE_ENTER(1,14,this);
|
61 | | - if(device) device->Release();
|
62 | | - if(backZ) backZ->Release();
|
63 | | - for(int i = 0; i < 8; i++)
|
64 | | - {
|
65 | | - if(lights[i]) lights[i]->Release();
|
66 | | - }
|
67 | | - TRACE_EXIT(-1,0);
|
68 | | -}
|
69 | | -
|
70 | | -HRESULT WINAPI glDirect3DViewport3::QueryInterface(REFIID riid, void** ppvObj)
|
71 | | -{
|
72 | | - TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
73 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 68 | + HRESULT ret;
|
| 69 | + TRACE_ENTER(3,14,This,24,&riid,14,ppvObj);
|
| 70 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
74 | 71 | if(riid == IID_IUnknown)
|
75 | 72 | {
|
76 | | - this->AddRef();
|
77 | | - *ppvObj = this;
|
| 73 | + glDirect3DViewport3_AddRef(This);
|
| 74 | + *ppvObj = This;
|
78 | 75 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
79 | 76 | TRACE_EXIT(23,D3D_OK);
|
80 | 77 | return D3D_OK;
|
— | — | @@ -80,8 +77,8 @@ |
81 | 78 | }
|
82 | 79 | if(riid == IID_IDirect3DViewport3)
|
83 | 80 | {
|
84 | | - this->AddRef();
|
85 | | - *ppvObj = this;
|
| 81 | + glDirect3DViewport3_AddRef(This);
|
| 82 | + *ppvObj = This;
|
86 | 83 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
87 | 84 | TRACE_EXIT(23,D3D_OK);
|
88 | 85 | return D3D_OK;
|
— | — | @@ -88,10 +85,10 @@ |
89 | 86 | }
|
90 | 87 | if(riid == IID_IDirect3DViewport2)
|
91 | 88 | {
|
92 | | - if(glD3DV2)
|
| 89 | + if(This->glD3DV2)
|
93 | 90 | {
|
94 | | - *ppvObj = glD3DV2;
|
95 | | - glD3DV2->AddRef();
|
| 91 | + *ppvObj = This->glD3DV2;
|
| 92 | + glDirect3DViewport2_AddRef(This->glD3DV2);
|
96 | 93 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
97 | 94 | TRACE_EXIT(23,D3D_OK);
|
98 | 95 | return D3D_OK;
|
— | — | @@ -98,9 +95,10 @@ |
99 | 96 | }
|
100 | 97 | else
|
101 | 98 | {
|
102 | | - this->AddRef();
|
103 | | - *ppvObj = new glDirect3DViewport2(this);
|
104 | | - glD3DV2 = (glDirect3DViewport2*)*ppvObj;
|
| 99 | + ret = glDirect3DViewport2_Create(This, (LPDIRECT3DVIEWPORT2*)*ppvObj);
|
| 100 | + if (ret != DD_OK) TRACE_RET(HRESULT, 23, ret);
|
| 101 | + glDirect3DViewport3_AddRef(This);
|
| 102 | + This->glD3DV2 = (glDirect3DViewport2*)*ppvObj;
|
105 | 103 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
106 | 104 | TRACE_EXIT(23,D3D_OK);
|
107 | 105 | return D3D_OK;
|
— | — | @@ -108,10 +106,10 @@ |
109 | 107 | }
|
110 | 108 | if(riid == IID_IDirect3DViewport)
|
111 | 109 | {
|
112 | | - if(glD3DV1)
|
| 110 | + if(This->glD3DV1)
|
113 | 111 | {
|
114 | | - *ppvObj = glD3DV1;
|
115 | | - glD3DV1->AddRef();
|
| 112 | + *ppvObj = This->glD3DV1;
|
| 113 | + glDirect3DViewport1_AddRef(This->glD3DV1);
|
116 | 114 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
117 | 115 | TRACE_EXIT(23,D3D_OK);
|
118 | 116 | return D3D_OK;
|
— | — | @@ -118,9 +116,10 @@ |
119 | 117 | }
|
120 | 118 | else
|
121 | 119 | {
|
122 | | - this->AddRef();
|
123 | | - *ppvObj = new glDirect3DViewport1(this);
|
124 | | - glD3DV1 = (glDirect3DViewport1*)*ppvObj;
|
| 120 | + ret = glDirect3DViewport1_Create(This, (LPDIRECT3DVIEWPORT*)*ppvObj);
|
| 121 | + if (ret != DD_OK) TRACE_RET(HRESULT, 23, ret);
|
| 122 | + glDirect3DViewport3_AddRef(This);
|
| 123 | + This->glD3DV1 = (glDirect3DViewport1*)*ppvObj;
|
125 | 124 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
126 | 125 | TRACE_EXIT(23,D3D_OK);
|
127 | 126 | return D3D_OK;
|
— | — | @@ -130,42 +129,51 @@ |
131 | 130 | return E_NOINTERFACE;
|
132 | 131 | }
|
133 | 132 |
|
134 | | -ULONG WINAPI glDirect3DViewport3::AddRef()
|
| 133 | +ULONG WINAPI glDirect3DViewport3_AddRef(glDirect3DViewport3 *This)
|
135 | 134 | {
|
136 | | - TRACE_ENTER(1,14,this);
|
137 | | - if(!this) TRACE_RET(ULONG,8,0);
|
138 | | - refcount++;
|
139 | | - TRACE_EXIT(8,refcount);
|
140 | | - return refcount;
|
| 135 | + TRACE_ENTER(1,14,This);
|
| 136 | + if(!This) TRACE_RET(ULONG,8,0);
|
| 137 | + This->refcount++;
|
| 138 | + TRACE_EXIT(8,This->refcount);
|
| 139 | + return This->refcount;
|
141 | 140 | }
|
142 | 141 |
|
143 | | -ULONG WINAPI glDirect3DViewport3::Release()
|
| 142 | +ULONG WINAPI glDirect3DViewport3_Release(glDirect3DViewport3 *This)
|
144 | 143 | {
|
145 | | - TRACE_ENTER(1,14,this);
|
146 | | - if(!this) TRACE_RET(ULONG,8,0);
|
| 144 | + TRACE_ENTER(1,14,This);
|
| 145 | + if(!This) TRACE_RET(ULONG,8,0);
|
147 | 146 | ULONG ret;
|
148 | | - refcount--;
|
149 | | - ret = refcount;
|
150 | | - if(refcount == 0) delete this;
|
151 | | - TRACE_EXIT(8,refcount);
|
| 147 | + This->refcount--;
|
| 148 | + ret = This->refcount;
|
| 149 | + if (This->refcount == 0)
|
| 150 | + {
|
| 151 | + if (This->device) This->device->Release();
|
| 152 | + if (This->backZ) This->backZ->Release();
|
| 153 | + for (int i = 0; i < 8; i++)
|
| 154 | + {
|
| 155 | + if (This->lights[i]) This->lights[i]->Release();
|
| 156 | + }
|
| 157 | + free(This);
|
| 158 | + }
|
| 159 | + TRACE_EXIT(8,ret);
|
152 | 160 | return ret;
|
153 | 161 | }
|
154 | 162 |
|
155 | | -HRESULT WINAPI glDirect3DViewport3::AddLight(LPDIRECT3DLIGHT lpDirect3DLight)
|
| 163 | +HRESULT WINAPI glDirect3DViewport3_AddLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight)
|
156 | 164 | {
|
157 | | - TRACE_ENTER(2,14,this,14,lpDirect3DLight);
|
158 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 165 | + TRACE_ENTER(2,14,This,14,lpDirect3DLight);
|
| 166 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
159 | 167 | if(((glDirect3DLight*)lpDirect3DLight)->viewport) TRACE_RET(HRESULT,23,D3DERR_LIGHTHASVIEWPORT);
|
160 | 168 | for(int i = 0; i < 8; i++)
|
161 | 169 | {
|
162 | | - if(!lights[i])
|
| 170 | + if(!This->lights[i])
|
163 | 171 | {
|
164 | | - if(lights[i] == lpDirect3DLight) return D3D_OK;
|
165 | | - lights[i] = (glDirect3DLight*)lpDirect3DLight;
|
166 | | - lights[i]->AddRef();
|
167 | | - lights[i]->viewport = this;
|
168 | | - if(device) lights[i]->SetDevice(device,i);
|
169 | | - lights[i]->Sync();
|
| 172 | + if(This->lights[i] == lpDirect3DLight) return D3D_OK;
|
| 173 | + This->lights[i] = (glDirect3DLight*)lpDirect3DLight;
|
| 174 | + This->lights[i]->AddRef();
|
| 175 | + This->lights[i]->viewport = This;
|
| 176 | + if(This->device) This->lights[i]->SetDevice(This->device,i);
|
| 177 | + This->lights[i]->Sync();
|
170 | 178 | TRACE_EXIT(23,D3D_OK);
|
171 | 179 | return D3D_OK;
|
172 | 180 | }
|
— | — | @@ -174,36 +182,36 @@ |
175 | 183 | return D3DERR_LIGHT_SET_FAILED;
|
176 | 184 | }
|
177 | 185 |
|
178 | | -HRESULT WINAPI glDirect3DViewport3::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
| 186 | +HRESULT WINAPI glDirect3DViewport3_Clear(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
179 | 187 | {
|
180 | | - TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
|
181 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
182 | | - if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
| 188 | + TRACE_ENTER(4,14,This,8,dwCount,14,lpRects,9,dwFlags);
|
| 189 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 190 | + if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
183 | 191 | D3DCOLORVALUE bgcolor = {0.0,0.0,0.0,0.0};
|
184 | | - if(device->materials[background]) bgcolor = device->materials[background]->material.diffuse;
|
185 | | - TRACE_RET(HRESULT,23,device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0));
|
| 192 | + if(This->device->materials[This->background]) bgcolor = This->device->materials[This->background]->material.diffuse;
|
| 193 | + TRACE_RET(HRESULT,23,This->device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0));
|
186 | 194 | }
|
187 | 195 |
|
188 | | -HRESULT WINAPI glDirect3DViewport3::Clear2(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
|
| 196 | +HRESULT WINAPI glDirect3DViewport3_Clear2(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
|
189 | 197 | {
|
190 | | - TRACE_ENTER(7,14,this,8,dwCount,14,lpRects,9,dwFlags,9,dwColor,19,&dvZ,9,dwStencil);
|
191 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
192 | | - if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
193 | | - TRACE_RET(HRESULT,23,device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
|
| 198 | + TRACE_ENTER(7,14,This,8,dwCount,14,lpRects,9,dwFlags,9,dwColor,19,&dvZ,9,dwStencil);
|
| 199 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 200 | + if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
| 201 | + TRACE_RET(HRESULT,23,This->device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
|
194 | 202 | }
|
195 | 203 |
|
196 | | -HRESULT WINAPI glDirect3DViewport3::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
|
| 204 | +HRESULT WINAPI glDirect3DViewport3_DeleteLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight)
|
197 | 205 | {
|
198 | | - TRACE_ENTER(2,14,this,14,lpDirect3DLight);
|
199 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 206 | + TRACE_ENTER(2,14,This,14,lpDirect3DLight);
|
| 207 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
200 | 208 | if(!lpDirect3DLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
201 | 209 | for(int i = 0; i < 8; i++)
|
202 | 210 | {
|
203 | | - if(lights[i] == lpDirect3DLight)
|
| 211 | + if(This->lights[i] == lpDirect3DLight)
|
204 | 212 | {
|
205 | | - lights[i]->Release();
|
206 | | - lights[i]->SetDevice(NULL,0);
|
207 | | - lights[i] = NULL;
|
| 213 | + This->lights[i]->Release();
|
| 214 | + This->lights[i]->SetDevice(NULL,0);
|
| 215 | + This->lights[i] = NULL;
|
208 | 216 | TRACE_EXIT(23,D3D_OK);
|
209 | 217 | return D3D_OK;
|
210 | 218 | }
|
— | — | @@ -212,501 +220,515 @@ |
213 | 221 | return D3DERR_LIGHTNOTINTHISVIEWPORT;
|
214 | 222 | }
|
215 | 223 |
|
216 | | -HRESULT WINAPI glDirect3DViewport3::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
| 224 | +HRESULT WINAPI glDirect3DViewport3_GetBackground(glDirect3DViewport3 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
217 | 225 | {
|
218 | | - TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
|
219 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 226 | + TRACE_ENTER(3,14,This,14,lphMat,14,lpValid);
|
| 227 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
220 | 228 | if(!lphMat) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
221 | 229 | if(lpValid)
|
222 | 230 | {
|
223 | | - if(background) *lpValid = TRUE;
|
| 231 | + if(This->background) *lpValid = TRUE;
|
224 | 232 | else *lpValid = FALSE;
|
225 | 233 | TRACE_VAR("*lpValid",22,*lpValid);
|
226 | 234 | }
|
227 | | - *lphMat = background;
|
| 235 | + *lphMat = This->background;
|
228 | 236 | TRACE_VAR("*lphMat",9,*lphMat);
|
229 | 237 | TRACE_EXIT(23,D3D_OK);
|
230 | 238 | return D3D_OK;
|
231 | 239 | }
|
232 | 240 |
|
233 | | -HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
| 241 | +HRESULT WINAPI glDirect3DViewport3_GetBackgroundDepth(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
234 | 242 | {
|
235 | | - TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
|
236 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 243 | + TRACE_ENTER(3,14,This,14,lplpDDSurface,14,lpValid);
|
| 244 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
237 | 245 | if(!lplpDDSurface) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
238 | 246 | if(lpValid)
|
239 | 247 | {
|
240 | | - if(backZ) *lpValid = TRUE;
|
| 248 | + if(This->backZ) *lpValid = TRUE;
|
241 | 249 | else *lpValid = FALSE;
|
242 | 250 | TRACE_VAR("*lpValid",22,*lpValid);
|
243 | 251 | }
|
244 | | - if(backZ) backZ->QueryInterface(IID_IDirectDrawSurface,(void**)lplpDDSurface);
|
| 252 | + if(This->backZ) This->backZ->QueryInterface(IID_IDirectDrawSurface,(void**)lplpDDSurface);
|
245 | 253 | else *lplpDDSurface = NULL;
|
246 | 254 | TRACE_VAR("*lplpDDSurface",14,*lplpDDSurface);
|
247 | 255 | TRACE_EXIT(23,D3D_OK);
|
248 | 256 | return D3D_OK;
|
249 | 257 | }
|
250 | | -HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth2(LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid)
|
| 258 | +HRESULT WINAPI glDirect3DViewport3_GetBackgroundDepth2(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid)
|
251 | 259 | {
|
252 | | - TRACE_ENTER(3,14,this,14,lplpDDS,14,lpValid);
|
253 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 260 | + TRACE_ENTER(3,14,This,14,lplpDDS,14,lpValid);
|
| 261 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
254 | 262 | if(!lplpDDS) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
255 | 263 | if(lpValid)
|
256 | 264 | {
|
257 | | - if(backZ) *lpValid = TRUE;
|
| 265 | + if(This->backZ) *lpValid = TRUE;
|
258 | 266 | else *lpValid = FALSE;
|
259 | 267 | TRACE_VAR("*lpValid",22,*lpValid);
|
260 | 268 | }
|
261 | | - if(backZ) backZ->QueryInterface(IID_IDirectDrawSurface4,(void**)lplpDDS);
|
| 269 | + if(This->backZ) This->backZ->QueryInterface(IID_IDirectDrawSurface4,(void**)lplpDDS);
|
262 | 270 | else *lplpDDS = NULL;
|
263 | 271 | TRACE_VAR("*lplpDDS",14,*lplpDDS);
|
264 | 272 | TRACE_EXIT(23,D3D_OK);
|
265 | 273 | return D3D_OK;
|
266 | 274 | }
|
267 | | -HRESULT WINAPI glDirect3DViewport3::GetViewport(LPD3DVIEWPORT lpData)
|
| 275 | +HRESULT WINAPI glDirect3DViewport3_GetViewport(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData)
|
268 | 276 | {
|
269 | | - TRACE_ENTER(2,14,this,14,lpData);
|
270 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 277 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 278 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
271 | 279 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
272 | | - memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
|
273 | | - lpData->dvScaleX = scaleX;
|
274 | | - lpData->dvScaleY = scaleY;
|
275 | | - lpData->dvMaxX = maxX;
|
276 | | - lpData->dvMaxY = maxY;
|
| 280 | + memcpy(lpData,&This->viewport,sizeof(D3DVIEWPORT2));
|
| 281 | + lpData->dvScaleX = This->scaleX;
|
| 282 | + lpData->dvScaleY = This->scaleY;
|
| 283 | + lpData->dvMaxX = This->maxX;
|
| 284 | + lpData->dvMaxY = This->maxY;
|
277 | 285 | TRACE_EXIT(23,D3D_OK);
|
278 | 286 | return D3D_OK;
|
279 | 287 | }
|
280 | | -HRESULT WINAPI glDirect3DViewport3::GetViewport2(LPD3DVIEWPORT2 lpData)
|
| 288 | +HRESULT WINAPI glDirect3DViewport3_GetViewport2(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData)
|
281 | 289 | {
|
282 | | - TRACE_ENTER(2,14,this,14,lpData);
|
283 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 290 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 291 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
284 | 292 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
285 | | - memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
|
| 293 | + memcpy(lpData,&This->viewport,sizeof(D3DVIEWPORT2));
|
286 | 294 | TRACE_EXIT(23,D3D_OK);
|
287 | 295 | return D3D_OK;
|
288 | 296 | }
|
289 | | -HRESULT WINAPI glDirect3DViewport3::Initialize(LPDIRECT3D lpDirect3D)
|
| 297 | +HRESULT WINAPI glDirect3DViewport3_Initialize(glDirect3DViewport3 *This, LPDIRECT3D lpDirect3D)
|
290 | 298 | {
|
291 | | - TRACE_ENTER(2,14,this,14,lpDirect3D);
|
292 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 299 | + TRACE_ENTER(2,14,This,14,lpDirect3D);
|
| 300 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
293 | 301 | TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
|
294 | 302 | return DDERR_ALREADYINITIALIZED;
|
295 | 303 | }
|
296 | | -HRESULT WINAPI glDirect3DViewport3::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
| 304 | +HRESULT WINAPI glDirect3DViewport3_LightElements(glDirect3DViewport3 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
297 | 305 | {
|
298 | | - TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
|
299 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 306 | + TRACE_ENTER(3,14,This,8,dwElementCount,14,lpData);
|
| 307 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
300 | 308 | TRACE_EXIT(23,DDERR_UNSUPPORTED);
|
301 | 309 | return DDERR_UNSUPPORTED;
|
302 | 310 | }
|
303 | | -HRESULT WINAPI glDirect3DViewport3::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
| 311 | +HRESULT WINAPI glDirect3DViewport3_NextLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
304 | 312 | {
|
305 | | - TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
306 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 313 | + TRACE_ENTER(4,14,This,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
| 314 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
307 | 315 | if(!lplpDirect3DLight) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
308 | 316 | FIXME("glDirect3DViewport3::NextLight: stub");
|
309 | 317 | TRACE_EXIT(23,DDERR_GENERIC);
|
310 | 318 | return DDERR_GENERIC;
|
311 | 319 | }
|
312 | | -HRESULT WINAPI glDirect3DViewport3::SetBackground(D3DMATERIALHANDLE hMat)
|
| 320 | +HRESULT WINAPI glDirect3DViewport3_SetBackground(glDirect3DViewport3 *This, D3DMATERIALHANDLE hMat)
|
313 | 321 | {
|
314 | | - TRACE_ENTER(2,14,this,9,hMat);
|
315 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
316 | | - if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
317 | | - if(hMat > device->materialcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
318 | | - background = hMat;
|
| 322 | + TRACE_ENTER(2,14,This,9,hMat);
|
| 323 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 324 | + if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
| 325 | + if(hMat > This->device->materialcount) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 326 | + This->background = hMat;
|
319 | 327 | TRACE_EXIT(23,D3D_OK);
|
320 | 328 | return D3D_OK;
|
321 | 329 | }
|
322 | | -HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
|
| 330 | +HRESULT WINAPI glDirect3DViewport3_SetBackgroundDepth(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
323 | 331 | {
|
324 | | - TRACE_ENTER(2,14,this,14,lpDDSurface);
|
325 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
326 | | - if(!backZ && !lpDDSurface) TRACE_RET(HRESULT,23,D3D_OK);
|
327 | | - if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == backZ) TRACE_RET(HRESULT,23,D3D_OK);
|
328 | | - if(backZ)backZ->Release();
|
329 | | - if(lpDDSurface) lpDDSurface->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
|
330 | | - else backZ = NULL;
|
331 | | - TRACE_EXIT(23,D3D_OK);
|
332 | | - return D3D_OK;
|
| 332 | + HRESULT ret = D3D_OK;
|
| 333 | + TRACE_ENTER(2, 14, This, 14, lpDDSurface);
|
| 334 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 335 | + if(!This->backZ && !lpDDSurface) TRACE_RET(HRESULT,23,D3D_OK);
|
| 336 | + if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == This->backZ) TRACE_RET(HRESULT,23,D3D_OK);
|
| 337 | + if(This->backZ)This->backZ->Release();
|
| 338 | + if(lpDDSurface) ret = lpDDSurface->QueryInterface(IID_IDirectDrawSurface7,(void**)&This->backZ);
|
| 339 | + else This->backZ = NULL;
|
| 340 | + TRACE_EXIT(23,ret);
|
| 341 | + return ret;
|
333 | 342 | }
|
334 | | -HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth2(LPDIRECTDRAWSURFACE4 lpDDS)
|
| 343 | +HRESULT WINAPI glDirect3DViewport3_SetBackgroundDepth2(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4 lpDDS)
|
335 | 344 | {
|
336 | | - TRACE_ENTER(2,14,this,14,lpDDS);
|
337 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
338 | | - if(!backZ && !lpDDS) TRACE_RET(HRESULT,23,D3D_OK);
|
339 | | - if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == backZ) TRACE_RET(HRESULT,23,D3D_OK);
|
340 | | - if(backZ)backZ->Release();
|
341 | | - if(lpDDS) lpDDS->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
|
342 | | - else backZ = NULL;
|
343 | | - TRACE_EXIT(23,D3D_OK);
|
344 | | - return D3D_OK;
|
| 345 | + HRESULT ret = D3D_OK;
|
| 346 | + TRACE_ENTER(2,14,This,14,lpDDS);
|
| 347 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 348 | + if(!This->backZ && !lpDDS) TRACE_RET(HRESULT,23,D3D_OK);
|
| 349 | + if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == This->backZ) TRACE_RET(HRESULT,23,D3D_OK);
|
| 350 | + if(This->backZ)This->backZ->Release();
|
| 351 | + if(lpDDS) ret = lpDDS->QueryInterface(IID_IDirectDrawSurface7,(void**)&This->backZ);
|
| 352 | + else This->backZ = NULL;
|
| 353 | + TRACE_EXIT(23,ret);
|
| 354 | + return ret;
|
345 | 355 | }
|
346 | 356 |
|
347 | | -HRESULT WINAPI glDirect3DViewport3::SetViewport(LPD3DVIEWPORT lpData)
|
| 357 | +HRESULT WINAPI glDirect3DViewport3_SetViewport(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData)
|
348 | 358 | {
|
349 | | - TRACE_ENTER(2,14,this,14,lpData);
|
350 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
351 | | - if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
| 359 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 360 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 361 | + if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
352 | 362 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
353 | 363 | D3DVIEWPORT2 vp;
|
354 | 364 | memcpy(&vp,lpData,sizeof(D3DVIEWPORT));
|
355 | | - vp.dvClipHeight = viewport.dvClipHeight;
|
356 | | - vp.dvClipWidth = viewport.dvClipWidth;
|
357 | | - vp.dvClipX = viewport.dvClipX;
|
358 | | - vp.dvClipY = viewport.dvClipY;
|
| 365 | + vp.dvClipHeight = This->viewport.dvClipHeight;
|
| 366 | + vp.dvClipWidth = This->viewport.dvClipWidth;
|
| 367 | + vp.dvClipX = This->viewport.dvClipX;
|
| 368 | + vp.dvClipY = This->viewport.dvClipY;
|
359 | 369 | if((vp.dvMinZ == 0) && (vp.dvMaxZ == 0)) vp.dvMaxZ = 1.0f;
|
360 | | - viewport = vp;
|
361 | | - maxX = lpData->dvMaxX;
|
362 | | - maxY = lpData->dvMaxY;
|
363 | | - scaleX = lpData->dvScaleX;
|
364 | | - scaleY = lpData->dvScaleY;
|
365 | | - if(current && device) Sync();
|
| 370 | + This->viewport = vp;
|
| 371 | + This->maxX = lpData->dvMaxX;
|
| 372 | + This->maxY = lpData->dvMaxY;
|
| 373 | + This->scaleX = lpData->dvScaleX;
|
| 374 | + This->scaleY = lpData->dvScaleY;
|
| 375 | + if(This->current && This->device) glDirect3DViewport3_Sync(This);
|
366 | 376 | TRACE_EXIT(23,D3D_OK);
|
367 | 377 | return D3D_OK;
|
368 | 378 | }
|
369 | | -HRESULT WINAPI glDirect3DViewport3::SetViewport2(LPD3DVIEWPORT2 lpData)
|
| 379 | +HRESULT WINAPI glDirect3DViewport3_SetViewport2(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData)
|
370 | 380 | {
|
371 | | - TRACE_ENTER(2,14,this,14,lpData);
|
372 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
373 | | - if(!device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
| 381 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 382 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 383 | + if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
374 | 384 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
375 | | - viewport = *lpData;
|
376 | | - if(current && device) Sync();
|
| 385 | + This->viewport = *lpData;
|
| 386 | + if(This->current && This->device) glDirect3DViewport3_Sync(This);
|
377 | 387 | TRACE_EXIT(23,D3D_OK);
|
378 | 388 | return D3D_OK;
|
379 | 389 | }
|
380 | | -HRESULT WINAPI glDirect3DViewport3::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
| 390 | +HRESULT WINAPI glDirect3DViewport3_TransformVertices(glDirect3DViewport3 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
381 | 391 | {
|
382 | | - TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
383 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 392 | + TRACE_ENTER(5,14,This,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
| 393 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
384 | 394 | FIXME("glDirect3DViewport3::TransformVertices: stub");
|
385 | 395 | TRACE_EXIT(23,DDERR_GENERIC);
|
386 | 396 | return DDERR_GENERIC;
|
387 | 397 | }
|
388 | 398 |
|
389 | | -void glDirect3DViewport3::SetCurrent(bool current)
|
| 399 | +void glDirect3DViewport3_SetCurrent(glDirect3DViewport3 *This, bool current)
|
390 | 400 | {
|
391 | | - TRACE_ENTER(2,14,this,21,current);
|
392 | | - if(this->current && current)
|
| 401 | + TRACE_ENTER(2,14,This,21,current);
|
| 402 | + if(This->current && current)
|
393 | 403 | {
|
394 | 404 | TRACE_EXIT(0,0);
|
395 | 405 | return;
|
396 | 406 | }
|
397 | | - this->current = current;
|
398 | | - if(current && device)
|
| 407 | + This->current = current;
|
| 408 | + if(current && This->device)
|
399 | 409 | {
|
400 | | - Sync();
|
401 | | - SyncLights();
|
| 410 | + glDirect3DViewport3_Sync(This);
|
| 411 | + glDirect3DViewport3_SyncLights(This);
|
402 | 412 | }
|
403 | 413 | TRACE_EXIT(0,0);
|
404 | 414 | }
|
405 | 415 |
|
406 | | -void glDirect3DViewport3::Sync()
|
| 416 | +void glDirect3DViewport3_SetDevice(glDirect3DViewport3 *This, glDirect3DDevice7 *device)
|
407 | 417 | {
|
408 | | - TRACE_ENTER(1,14,this);
|
| 418 | + This->device = device;
|
| 419 | +}
|
| 420 | +
|
| 421 | +void glDirect3DViewport3_Sync(glDirect3DViewport3 *This)
|
| 422 | +{
|
| 423 | + TRACE_ENTER(1,14,This);
|
409 | 424 | D3DVIEWPORT7 vp7;
|
410 | | - vp7.dwX = viewport.dwX;
|
411 | | - vp7.dwY = viewport.dwY;
|
412 | | - vp7.dwHeight = viewport.dwHeight;
|
413 | | - vp7.dwWidth = viewport.dwWidth;
|
414 | | - vp7.dvMinZ = viewport.dvMinZ;
|
415 | | - vp7.dvMaxZ = viewport.dvMaxZ;
|
416 | | - device->SetViewport(&vp7);
|
417 | | - device->SetScale(scaleX,scaleY);
|
| 425 | + vp7.dwX = This->viewport.dwX;
|
| 426 | + vp7.dwY = This->viewport.dwY;
|
| 427 | + vp7.dwHeight = This->viewport.dwHeight;
|
| 428 | + vp7.dwWidth = This->viewport.dwWidth;
|
| 429 | + vp7.dvMinZ = This->viewport.dvMinZ;
|
| 430 | + vp7.dvMaxZ = This->viewport.dvMaxZ;
|
| 431 | + This->device->SetViewport(&vp7);
|
| 432 | + This->device->SetScale(This->scaleX,This->scaleY);
|
418 | 433 | TRACE_EXIT(0,0);
|
419 | 434 | }
|
420 | 435 |
|
421 | | -void glDirect3DViewport3::SyncLights()
|
| 436 | +void glDirect3DViewport3_SyncLights(glDirect3DViewport3 *This)
|
422 | 437 | {
|
423 | | - TRACE_ENTER(1,14,this);
|
| 438 | + TRACE_ENTER(1,14,This);
|
424 | 439 | D3DLIGHT7 light;
|
425 | 440 | for(int i = 0; i < 8; i++)
|
426 | 441 | {
|
427 | | - if(lights[i])
|
| 442 | + if(This->lights[i])
|
428 | 443 | {
|
429 | | - lights[i]->SetDevice(device,i);
|
430 | | - lights[i]->GetLight7(&light);
|
431 | | - device->SetLight(i,&light);
|
432 | | - device->LightEnable(i,TRUE);
|
| 444 | + This->lights[i]->SetDevice(This->device,i);
|
| 445 | + This->lights[i]->GetLight7(&light);
|
| 446 | + This->device->SetLight(i,&light);
|
| 447 | + This->device->LightEnable(i,TRUE);
|
433 | 448 | }
|
434 | | - else device->LightEnable(i,FALSE);
|
| 449 | + else This->device->LightEnable(i,FALSE);
|
435 | 450 | }
|
436 | 451 | TRACE_EXIT(0,0);
|
437 | 452 | }
|
438 | 453 |
|
439 | 454 |
|
440 | | -glDirect3DViewport2::glDirect3DViewport2(glDirect3DViewport3 *glD3DV3)
|
| 455 | +HRESULT glDirect3DViewport2_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT2 *viewport)
|
441 | 456 | {
|
442 | | - TRACE_ENTER(2,14,this,14,glD3DV3);
|
443 | | - this->glD3DV3 = glD3DV3;
|
444 | | - refcount = 1;
|
445 | | - TRACE_EXIT(-1,0);
|
| 457 | + glDirect3DViewport2 *newvp;
|
| 458 | + TRACE_ENTER(2, 14, glD3DV3, 14, viewport);
|
| 459 | + if (!viewport) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 460 | + newvp = (glDirect3DViewport2*)malloc(sizeof(glDirect3DViewport2));
|
| 461 | + if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 462 | + *viewport = (LPDIRECT3DVIEWPORT2)newvp;
|
| 463 | + newvp->glD3DV3 = glD3DV3;
|
| 464 | + newvp->refcount = 1;
|
| 465 | + TRACE_EXIT(23, DD_OK);
|
| 466 | + return DD_OK;
|
446 | 467 | }
|
447 | 468 |
|
448 | | -glDirect3DViewport2::~glDirect3DViewport2()
|
| 469 | +ULONG WINAPI glDirect3DViewport2_AddRef(glDirect3DViewport2 *This)
|
449 | 470 | {
|
450 | | - TRACE_ENTER(1,14,this);
|
451 | | - glD3DV3->glD3DV2 = NULL;
|
452 | | - glD3DV3->Release();
|
453 | | - TRACE_EXIT(-1,0);
|
| 471 | + TRACE_ENTER(1,14,This);
|
| 472 | + if(!This) TRACE_RET(ULONG,8,0);
|
| 473 | + This->refcount++;
|
| 474 | + TRACE_EXIT(8,This->refcount);
|
| 475 | + return This->refcount;
|
454 | 476 | }
|
455 | 477 |
|
456 | | -ULONG WINAPI glDirect3DViewport2::AddRef()
|
| 478 | +ULONG WINAPI glDirect3DViewport2_Release(glDirect3DViewport2 *This)
|
457 | 479 | {
|
458 | | - TRACE_ENTER(1,14,this);
|
459 | | - if(!this) TRACE_RET(ULONG,8,0);
|
460 | | - refcount++;
|
461 | | - TRACE_EXIT(8,refcount);
|
462 | | - return refcount;
|
463 | | -}
|
464 | | -
|
465 | | -ULONG WINAPI glDirect3DViewport2::Release()
|
466 | | -{
|
467 | | - TRACE_ENTER(1,14,this);
|
468 | | - if(!this) TRACE_RET(ULONG,8,0);
|
| 480 | + TRACE_ENTER(1,14,This);
|
| 481 | + if(!This) TRACE_RET(ULONG,8,0);
|
469 | 482 | ULONG ret;
|
470 | | - refcount--;
|
471 | | - ret = refcount;
|
472 | | - if(refcount == 0) delete this;
|
473 | | - TRACE_ENTER(8,ret);
|
| 483 | + This->refcount--;
|
| 484 | + ret = This->refcount;
|
| 485 | + if (This->refcount == 0)
|
| 486 | + {
|
| 487 | + This->glD3DV3->glD3DV2 = NULL;
|
| 488 | + glDirect3DViewport3_Release(This->glD3DV3);
|
| 489 | + free(This);
|
| 490 | + }
|
| 491 | + TRACE_EXIT(8,ret);
|
474 | 492 | return ret;
|
475 | 493 | }
|
476 | 494 |
|
477 | | -HRESULT WINAPI glDirect3DViewport2::QueryInterface(REFIID riid, void** ppvObj)
|
| 495 | +HRESULT WINAPI glDirect3DViewport2_QueryInterface(glDirect3DViewport2 *This, REFIID riid, void** ppvObj)
|
478 | 496 | {
|
479 | | - TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
480 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 497 | + TRACE_ENTER(3,14,This,24,&riid,14,ppvObj);
|
| 498 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
481 | 499 | if(riid == IID_IUnknown)
|
482 | 500 | {
|
483 | | - this->AddRef();
|
484 | | - *ppvObj = this;
|
| 501 | + glDirect3DViewport2_AddRef(This);
|
| 502 | + *ppvObj = This;
|
485 | 503 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
486 | 504 | TRACE_EXIT(23,D3D_OK);
|
487 | 505 | return D3D_OK;
|
488 | 506 | }
|
489 | | - TRACE_RET(HRESULT,23,glD3DV3->QueryInterface(riid,ppvObj));
|
| 507 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_QueryInterface(This->glD3DV3,riid,ppvObj));
|
490 | 508 | }
|
491 | 509 |
|
492 | | -HRESULT WINAPI glDirect3DViewport2::AddLight(LPDIRECT3DLIGHT lpLight)
|
| 510 | +HRESULT WINAPI glDirect3DViewport2_AddLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpLight)
|
493 | 511 | {
|
494 | | - TRACE_ENTER(2,14,this,14,lpLight);
|
495 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
496 | | - TRACE_RET(HRESULT,23,glD3DV3->AddLight(lpLight));
|
| 512 | + TRACE_ENTER(2,14,This,14,lpLight);
|
| 513 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 514 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_AddLight(This->glD3DV3,lpLight));
|
497 | 515 | }
|
498 | | -HRESULT WINAPI glDirect3DViewport2::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
| 516 | +HRESULT WINAPI glDirect3DViewport2_Clear(glDirect3DViewport2 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
499 | 517 | {
|
500 | | - TRACE_ENTER(4,14,this,9,dwCount,14,lpRects,9,dwFlags);
|
501 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
502 | | - TRACE_RET(HRESULT,23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
|
| 518 | + TRACE_ENTER(4,14,This,9,dwCount,14,lpRects,9,dwFlags);
|
| 519 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 520 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_Clear(This->glD3DV3,dwCount,lpRects,dwFlags));
|
503 | 521 | }
|
504 | | -HRESULT WINAPI glDirect3DViewport2::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
|
| 522 | +HRESULT WINAPI glDirect3DViewport2_DeleteLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight)
|
505 | 523 | {
|
506 | | - TRACE_ENTER(2,14,this,14,lpDirect3DLight);
|
507 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
508 | | - TRACE_RET(HRESULT,23,glD3DV3->DeleteLight(lpDirect3DLight));
|
| 524 | + TRACE_ENTER(2,14,This,14,lpDirect3DLight);
|
| 525 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 526 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_DeleteLight(This->glD3DV3,lpDirect3DLight));
|
509 | 527 | }
|
510 | | -HRESULT WINAPI glDirect3DViewport2::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
| 528 | +HRESULT WINAPI glDirect3DViewport2_GetBackground(glDirect3DViewport2 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
511 | 529 | {
|
512 | | - TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
|
513 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
514 | | - TRACE_RET(HRESULT,23,glD3DV3->GetBackground(lphMat,lpValid));
|
| 530 | + TRACE_ENTER(3,14,This,14,lphMat,14,lpValid);
|
| 531 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 532 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetBackground(This->glD3DV3,lphMat,lpValid));
|
515 | 533 | }
|
516 | | -HRESULT WINAPI glDirect3DViewport2::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
| 534 | +HRESULT WINAPI glDirect3DViewport2_GetBackgroundDepth(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
517 | 535 | {
|
518 | | - TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
|
519 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
520 | | - TRACE_RET(HRESULT,23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
|
| 536 | + TRACE_ENTER(3,14,This,14,lplpDDSurface,14,lpValid);
|
| 537 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 538 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetBackgroundDepth(This->glD3DV3,lplpDDSurface,lpValid));
|
521 | 539 | }
|
522 | | -HRESULT WINAPI glDirect3DViewport2::GetViewport(LPD3DVIEWPORT lpData)
|
| 540 | +HRESULT WINAPI glDirect3DViewport2_GetViewport(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData)
|
523 | 541 | {
|
524 | | - TRACE_ENTER(2,14,this,14,lpData);
|
525 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
526 | | - TRACE_RET(HRESULT,23,glD3DV3->GetViewport(lpData));
|
| 542 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 543 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 544 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetViewport(This->glD3DV3,lpData));
|
527 | 545 | }
|
528 | | -HRESULT WINAPI glDirect3DViewport2::GetViewport2(LPD3DVIEWPORT2 lpData)
|
| 546 | +HRESULT WINAPI glDirect3DViewport2_GetViewport2(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData)
|
529 | 547 | {
|
530 | | - TRACE_ENTER(2,14,this,14,lpData);
|
531 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
532 | | - TRACE_RET(HRESULT,23,glD3DV3->GetViewport2(lpData));
|
| 548 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 549 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 550 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetViewport2(This->glD3DV3,lpData));
|
533 | 551 | }
|
534 | | -HRESULT WINAPI glDirect3DViewport2::Initialize(LPDIRECT3D lpDirect3D)
|
| 552 | +HRESULT WINAPI glDirect3DViewport2_Initialize(glDirect3DViewport2 *This, LPDIRECT3D lpDirect3D)
|
535 | 553 | {
|
536 | | - TRACE_ENTER(2,14,this,14,lpDirect3D);
|
537 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
538 | | - TRACE_RET(HRESULT,23,glD3DV3->Initialize(lpDirect3D));
|
| 554 | + TRACE_ENTER(2,14,This,14,lpDirect3D);
|
| 555 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 556 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_Initialize(This->glD3DV3,lpDirect3D));
|
539 | 557 | }
|
540 | | -HRESULT WINAPI glDirect3DViewport2::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
| 558 | +HRESULT WINAPI glDirect3DViewport2_LightElements(glDirect3DViewport2 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
541 | 559 | {
|
542 | | - TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
|
543 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
544 | | - TRACE_RET(HRESULT,23,glD3DV3->LightElements(dwElementCount,lpData));
|
| 560 | + TRACE_ENTER(3,14,This,8,dwElementCount,14,lpData);
|
| 561 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 562 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_LightElements(This->glD3DV3,dwElementCount,lpData));
|
545 | 563 | }
|
546 | | -HRESULT WINAPI glDirect3DViewport2::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
| 564 | +HRESULT WINAPI glDirect3DViewport2_NextLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
547 | 565 | {
|
548 | | - TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
549 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
550 | | - TRACE_RET(HRESULT,23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
|
| 566 | + TRACE_ENTER(4,14,This,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
| 567 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 568 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_NextLight(This->glD3DV3,lpDirect3DLight,lplpDirect3DLight,dwFlags));
|
551 | 569 | }
|
552 | | -HRESULT WINAPI glDirect3DViewport2::SetBackground(D3DMATERIALHANDLE hMat)
|
| 570 | +HRESULT WINAPI glDirect3DViewport2_SetBackground(glDirect3DViewport2 *This, D3DMATERIALHANDLE hMat)
|
553 | 571 | {
|
554 | | - TRACE_ENTER(2,14,this,9,hMat);
|
555 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
556 | | - TRACE_RET(HRESULT,23,glD3DV3->SetBackground(hMat));
|
| 572 | + TRACE_ENTER(2,14,This,9,hMat);
|
| 573 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 574 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetBackground(This->glD3DV3,hMat));
|
557 | 575 | }
|
558 | | -HRESULT WINAPI glDirect3DViewport2::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
|
| 576 | +HRESULT WINAPI glDirect3DViewport2_SetBackgroundDepth(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
559 | 577 | {
|
560 | | - TRACE_ENTER(2,14,this,14,lpDDSurface);
|
561 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
562 | | - TRACE_RET(HRESULT,23,glD3DV3->SetBackgroundDepth(lpDDSurface));
|
| 578 | + TRACE_ENTER(2,14,This,14,lpDDSurface);
|
| 579 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 580 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetBackgroundDepth(This->glD3DV3,lpDDSurface));
|
563 | 581 | }
|
564 | | -HRESULT WINAPI glDirect3DViewport2::SetViewport(LPD3DVIEWPORT lpData)
|
| 582 | +HRESULT WINAPI glDirect3DViewport2_SetViewport(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData)
|
565 | 583 | {
|
566 | | - TRACE_ENTER(2,14,this,14,lpData);
|
567 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
568 | | - TRACE_RET(HRESULT,23,glD3DV3->SetViewport(lpData));
|
| 584 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 585 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 586 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetViewport(This->glD3DV3,lpData));
|
569 | 587 | }
|
570 | | -HRESULT WINAPI glDirect3DViewport2::SetViewport2(LPD3DVIEWPORT2 lpData)
|
| 588 | +HRESULT WINAPI glDirect3DViewport2_SetViewport2(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData)
|
571 | 589 | {
|
572 | | - TRACE_ENTER(2,14,this,14,lpData);
|
573 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
574 | | - TRACE_RET(HRESULT,23,glD3DV3->SetViewport2(lpData));
|
| 590 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 591 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 592 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetViewport2(This->glD3DV3,lpData));
|
575 | 593 | }
|
576 | | -HRESULT WINAPI glDirect3DViewport2::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
| 594 | +HRESULT WINAPI glDirect3DViewport2_TransformVertices(glDirect3DViewport2 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
577 | 595 | {
|
578 | | - TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
579 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
580 | | - TRACE_RET(HRESULT,23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
|
| 596 | + TRACE_ENTER(5,14,This,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
| 597 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 598 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_TransformVertices(This->glD3DV3,dwVertexCount,lpData,dwFlags,lpOffscreen));
|
581 | 599 | }
|
582 | 600 |
|
583 | 601 |
|
584 | | -glDirect3DViewport1::glDirect3DViewport1(glDirect3DViewport3 *glD3DV3)
|
| 602 | +HRESULT glDirect3DViewport1_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT *viewport)
|
585 | 603 | {
|
586 | | - TRACE_ENTER(2,14,this,14,glD3DV3);
|
587 | | - this->glD3DV3 = glD3DV3;
|
588 | | - refcount = 1;
|
589 | | - TRACE_EXIT(-1,0);
|
| 604 | + glDirect3DViewport1 *newvp;
|
| 605 | + TRACE_ENTER(2, 14, glD3DV3, 14, viewport);
|
| 606 | + if (!viewport) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 607 | + newvp = (glDirect3DViewport1*)malloc(sizeof(glDirect3DViewport1));
|
| 608 | + if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 609 | + *viewport = (LPDIRECT3DVIEWPORT)newvp;
|
| 610 | + newvp->glD3DV3 = glD3DV3;
|
| 611 | + newvp->refcount = 1;
|
| 612 | + TRACE_EXIT(23, DD_OK);
|
| 613 | + return DD_OK;
|
590 | 614 | }
|
591 | 615 |
|
592 | | -glDirect3DViewport1::~glDirect3DViewport1()
|
| 616 | +ULONG WINAPI glDirect3DViewport1_AddRef(glDirect3DViewport1 *This)
|
593 | 617 | {
|
594 | | - TRACE_ENTER(1,14,this);
|
595 | | - glD3DV3->glD3DV1 = NULL;
|
596 | | - glD3DV3->Release();
|
597 | | - TRACE_EXIT(-1,0);
|
| 618 | + TRACE_ENTER(1,14,This);
|
| 619 | + if(!This) TRACE_RET(ULONG,8,0);
|
| 620 | + This->refcount++;
|
| 621 | + TRACE_EXIT(8,This->refcount);
|
| 622 | + return This->refcount;
|
598 | 623 | }
|
599 | 624 |
|
600 | | -ULONG WINAPI glDirect3DViewport1::AddRef()
|
| 625 | +ULONG WINAPI glDirect3DViewport1_Release(glDirect3DViewport1 *This)
|
601 | 626 | {
|
602 | | - TRACE_ENTER(1,14,this);
|
603 | | - if(!this) TRACE_RET(ULONG,8,0);
|
604 | | - refcount++;
|
605 | | - TRACE_EXIT(8,refcount);
|
606 | | - return refcount;
|
607 | | -}
|
608 | | -
|
609 | | -ULONG WINAPI glDirect3DViewport1::Release()
|
610 | | -{
|
611 | | - TRACE_ENTER(1,14,this);
|
612 | | - if(!this) TRACE_RET(ULONG,8,0);
|
| 627 | + TRACE_ENTER(1,14,This);
|
| 628 | + if(!This) TRACE_RET(ULONG,8,0);
|
613 | 629 | ULONG ret;
|
614 | | - refcount--;
|
615 | | - ret = refcount;
|
616 | | - if(refcount == 0) delete this;
|
617 | | - TRACE_EXIT(8,ret);
|
| 630 | + This->refcount--;
|
| 631 | + ret = This->refcount;
|
| 632 | + if (This->refcount == 0)
|
| 633 | + {
|
| 634 | + This->glD3DV3->glD3DV1 = NULL;
|
| 635 | + glDirect3DViewport3_Release(This->glD3DV3);
|
| 636 | + free(This);
|
| 637 | + }
|
| 638 | + TRACE_EXIT(8, ret);
|
618 | 639 | return ret;
|
619 | 640 | }
|
620 | 641 |
|
621 | | -HRESULT WINAPI glDirect3DViewport1::QueryInterface(REFIID riid, void** ppvObj)
|
| 642 | +HRESULT WINAPI glDirect3DViewport1_QueryInterface(glDirect3DViewport1 *This, REFIID riid, void** ppvObj)
|
622 | 643 | {
|
623 | | - TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
624 | | - TRACE_EXIT(-1,0);
|
| 644 | + TRACE_ENTER(3,14,This,24,&riid,14,ppvObj);
|
625 | 645 | if(riid == IID_IUnknown)
|
626 | 646 | {
|
627 | | - this->AddRef();
|
628 | | - *ppvObj = this;
|
| 647 | + glDirect3DViewport1_AddRef(This);
|
| 648 | + *ppvObj = This;
|
629 | 649 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
630 | 650 | TRACE_EXIT(23,D3D_OK);
|
631 | 651 | return D3D_OK;
|
632 | 652 | }
|
633 | | - TRACE_RET(HRESULT,23,glD3DV3->QueryInterface(riid,ppvObj));
|
| 653 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_QueryInterface(This->glD3DV3,riid,ppvObj));
|
634 | 654 | }
|
635 | 655 |
|
636 | | -HRESULT WINAPI glDirect3DViewport1::AddLight(LPDIRECT3DLIGHT lpLight)
|
| 656 | +HRESULT WINAPI glDirect3DViewport1_AddLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpLight)
|
637 | 657 | {
|
638 | | - TRACE_ENTER(2,14,this,14,lpLight);
|
639 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
640 | | - TRACE_RET(HRESULT,23,glD3DV3->AddLight(lpLight));
|
| 658 | + TRACE_ENTER(2,14,This,14,lpLight);
|
| 659 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 660 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_AddLight(This->glD3DV3,lpLight));
|
641 | 661 | }
|
642 | | -HRESULT WINAPI glDirect3DViewport1::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
| 662 | +HRESULT WINAPI glDirect3DViewport1_Clear(glDirect3DViewport1 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
|
643 | 663 | {
|
644 | | - TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
|
645 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
646 | | - TRACE_RET(HRESULT,23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
|
| 664 | + TRACE_ENTER(4,14,This,8,dwCount,14,lpRects,9,dwFlags);
|
| 665 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 666 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_Clear(This->glD3DV3,dwCount,lpRects,dwFlags));
|
647 | 667 | }
|
648 | | -HRESULT WINAPI glDirect3DViewport1::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
|
| 668 | +HRESULT WINAPI glDirect3DViewport1_DeleteLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight)
|
649 | 669 | {
|
650 | | - TRACE_ENTER(2,14,this,14,lpDirect3DLight);
|
651 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
652 | | - TRACE_RET(HRESULT,23,glD3DV3->DeleteLight(lpDirect3DLight));
|
| 670 | + TRACE_ENTER(2,14,This,14,lpDirect3DLight);
|
| 671 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 672 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_DeleteLight(This->glD3DV3,lpDirect3DLight));
|
653 | 673 | }
|
654 | | -HRESULT WINAPI glDirect3DViewport1::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
| 674 | +HRESULT WINAPI glDirect3DViewport1_GetBackground(glDirect3DViewport1 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
|
655 | 675 | {
|
656 | | - TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
|
657 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
658 | | - TRACE_RET(HRESULT,23,glD3DV3->GetBackground(lphMat,lpValid));
|
| 676 | + TRACE_ENTER(3,14,This,14,lphMat,14,lpValid);
|
| 677 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 678 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetBackground(This->glD3DV3,lphMat,lpValid));
|
659 | 679 | }
|
660 | | -HRESULT WINAPI glDirect3DViewport1::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
| 680 | +HRESULT WINAPI glDirect3DViewport1_GetBackgroundDepth(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
|
661 | 681 | {
|
662 | | - TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
|
663 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
664 | | - TRACE_RET(HRESULT,23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
|
| 682 | + TRACE_ENTER(3,14,This,14,lplpDDSurface,14,lpValid);
|
| 683 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 684 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetBackgroundDepth(This->glD3DV3,lplpDDSurface,lpValid));
|
665 | 685 | }
|
666 | | -HRESULT WINAPI glDirect3DViewport1::GetViewport(LPD3DVIEWPORT lpData)
|
| 686 | +HRESULT WINAPI glDirect3DViewport1_GetViewport(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData)
|
667 | 687 | {
|
668 | | - TRACE_ENTER(2,14,this,14,lpData);
|
669 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
670 | | - TRACE_RET(HRESULT,23,glD3DV3->GetViewport(lpData));
|
| 688 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 689 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 690 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_GetViewport(This->glD3DV3,lpData));
|
671 | 691 | }
|
672 | | -HRESULT WINAPI glDirect3DViewport1::Initialize(LPDIRECT3D lpDirect3D)
|
| 692 | +HRESULT WINAPI glDirect3DViewport1_Initialize(glDirect3DViewport1 *This, LPDIRECT3D lpDirect3D)
|
673 | 693 | {
|
674 | | - TRACE_ENTER(2,14,this,14,lpDirect3D);
|
675 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
676 | | - TRACE_RET(HRESULT,23,glD3DV3->Initialize(lpDirect3D));
|
| 694 | + TRACE_ENTER(2,14,This,14,lpDirect3D);
|
| 695 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 696 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_Initialize(This->glD3DV3,lpDirect3D));
|
677 | 697 | }
|
678 | | -HRESULT WINAPI glDirect3DViewport1::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
| 698 | +HRESULT WINAPI glDirect3DViewport1_LightElements(glDirect3DViewport1 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData)
|
679 | 699 | {
|
680 | | - TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
|
681 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
682 | | - return glD3DV3->LightElements(dwElementCount,lpData);
|
| 700 | + TRACE_ENTER(3,14,This,8,dwElementCount,14,lpData);
|
| 701 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 702 | + return glDirect3DViewport3_LightElements(This->glD3DV3,dwElementCount,lpData);
|
683 | 703 | }
|
684 | | -HRESULT WINAPI glDirect3DViewport1::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
| 704 | +HRESULT WINAPI glDirect3DViewport1_NextLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
|
685 | 705 | {
|
686 | | - TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
687 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
688 | | - TRACE_RET(HRESULT,23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
|
| 706 | + TRACE_ENTER(4,14,This,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
|
| 707 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 708 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_NextLight(This->glD3DV3,lpDirect3DLight,lplpDirect3DLight,dwFlags));
|
689 | 709 | }
|
690 | | -HRESULT WINAPI glDirect3DViewport1::SetBackground(D3DMATERIALHANDLE hMat)
|
| 710 | +HRESULT WINAPI glDirect3DViewport1_SetBackground(glDirect3DViewport1 *This, D3DMATERIALHANDLE hMat)
|
691 | 711 | {
|
692 | | - TRACE_ENTER(2,14,this,9,hMat);
|
693 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
694 | | - TRACE_RET(HRESULT,23,glD3DV3->SetBackground(hMat));
|
| 712 | + TRACE_ENTER(2,14,This,9,hMat);
|
| 713 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 714 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetBackground(This->glD3DV3,hMat));
|
695 | 715 | }
|
696 | | -HRESULT WINAPI glDirect3DViewport1::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
|
| 716 | +HRESULT WINAPI glDirect3DViewport1_SetBackgroundDepth(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
697 | 717 | {
|
698 | | - TRACE_ENTER(2,14,this,14,lpDDSurface);
|
699 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
700 | | - TRACE_RET(HRESULT,23,glD3DV3->SetBackgroundDepth(lpDDSurface));
|
| 718 | + TRACE_ENTER(2,14,This,14,lpDDSurface);
|
| 719 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 720 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetBackgroundDepth(This->glD3DV3,lpDDSurface));
|
701 | 721 | }
|
702 | | -HRESULT WINAPI glDirect3DViewport1::SetViewport(LPD3DVIEWPORT lpData)
|
| 722 | +HRESULT WINAPI glDirect3DViewport1_SetViewport(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData)
|
703 | 723 | {
|
704 | | - TRACE_ENTER(2,14,this,14,lpData);
|
705 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
706 | | - TRACE_RET(HRESULT,23,glD3DV3->SetViewport(lpData));
|
| 724 | + TRACE_ENTER(2,14,This,14,lpData);
|
| 725 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 726 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_SetViewport(This->glD3DV3,lpData));
|
707 | 727 | }
|
708 | | -HRESULT WINAPI glDirect3DViewport1::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
| 728 | +HRESULT WINAPI glDirect3DViewport1_TransformVertices(glDirect3DViewport1 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
|
709 | 729 | {
|
710 | | - TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
711 | | - if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
712 | | - TRACE_RET(HRESULT,23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
|
| 730 | + TRACE_ENTER(5,14,This,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
|
| 731 | + if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 732 | + TRACE_RET(HRESULT,23,glDirect3DViewport3_TransformVertices(This->glD3DV3,dwVertexCount,lpData,dwFlags,lpOffscreen));
|
713 | 733 | }
|
| 734 | +
|
| 735 | +} |
\ No newline at end of file |
Index: ddraw/glDirect3DViewport.h |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011-2013 William Feely
|
| 3 | +// Copyright (C) 2011-2014 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
— | — | @@ -19,44 +19,27 @@ |
20 | 20 | #ifndef __GLDIRECT3DVIEWPORT_H
|
21 | 21 | #define __GLDIRECT3DVIEWPORT_H
|
22 | 22 |
|
| 23 | +#ifdef __cplusplus
|
23 | 24 | class glDirect3DLight;
|
24 | 25 | class glDirect3DDevice7;
|
25 | 26 | class glDirectDrawSurface7;
|
26 | | -class glDirect3DViewport1;
|
27 | | -class glDirect3DViewport2;
|
28 | | -class glDirect3DViewport3 : public IDirect3DViewport3
|
| 27 | +extern "C" {
|
| 28 | +#else
|
| 29 | +typedef int glDirect3DLight;
|
| 30 | +typedef int glDirect3DDevice7;
|
| 31 | +typedef int glDirectDrawSurface7;
|
| 32 | +#endif
|
| 33 | +
|
| 34 | +struct glDirect3DViewport1;
|
| 35 | +struct glDirect3DViewport2;
|
| 36 | +
|
| 37 | +struct glDirect3DViewport3Vtbl;
|
| 38 | +
|
| 39 | +typedef struct glDirect3DViewport3
|
29 | 40 | {
|
30 | | -public:
|
31 | | - glDirect3DViewport3();
|
32 | | - virtual ~glDirect3DViewport3();
|
33 | | - HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
|
34 | | - ULONG WINAPI AddRef();
|
35 | | - ULONG WINAPI Release();
|
36 | | - HRESULT WINAPI AddLight(LPDIRECT3DLIGHT lpDirect3DLight);
|
37 | | - HRESULT WINAPI Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
38 | | - HRESULT WINAPI Clear2(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil);
|
39 | | - HRESULT WINAPI DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight);
|
40 | | - HRESULT WINAPI GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
41 | | - HRESULT WINAPI GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
42 | | - HRESULT WINAPI GetBackgroundDepth2(LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid);
|
43 | | - HRESULT WINAPI GetViewport(LPD3DVIEWPORT lpData);
|
44 | | - HRESULT WINAPI GetViewport2(LPD3DVIEWPORT2 lpData);
|
45 | | - HRESULT WINAPI Initialize(LPDIRECT3D lpDirect3D);
|
46 | | - HRESULT WINAPI LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
47 | | - HRESULT WINAPI NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
48 | | - HRESULT WINAPI SetBackground(D3DMATERIALHANDLE hMat);
|
49 | | - HRESULT WINAPI SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface);
|
50 | | - HRESULT WINAPI SetBackgroundDepth2(LPDIRECTDRAWSURFACE4 lpDDS);
|
51 | | - HRESULT WINAPI SetViewport(LPD3DVIEWPORT lpData);
|
52 | | - HRESULT WINAPI SetViewport2(LPD3DVIEWPORT2 lpData);
|
53 | | - HRESULT WINAPI TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
54 | | - void SetCurrent(bool current);
|
55 | | - void SetDevice(glDirect3DDevice7 *device){this->device = device;};
|
56 | | - void Sync();
|
57 | | - void SyncLights();
|
| 41 | + glDirect3DViewport3Vtbl *lpVtbl;
|
58 | 42 | glDirect3DViewport2 *glD3DV2;
|
59 | 43 | glDirect3DViewport1 *glD3DV1;
|
60 | | -private:
|
61 | 44 | ULONG refcount;
|
62 | 45 | glDirect3DLight *lights[8];
|
63 | 46 | glDirect3DDevice7 *device;
|
— | — | @@ -70,58 +53,163 @@ |
71 | 54 | bool current;
|
72 | 55 | };
|
73 | 56 |
|
74 | | -class glDirect3DViewport2 : public IDirect3DViewport2
|
| 57 | +typedef struct glDirect3DViewportVtbl
|
75 | 58 | {
|
76 | | -public:
|
77 | | - glDirect3DViewport2(glDirect3DViewport3 *glD3DV3);
|
78 | | - virtual ~glDirect3DViewport2();
|
79 | | - HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
|
80 | | - ULONG WINAPI AddRef();
|
81 | | - ULONG WINAPI Release();
|
82 | | - HRESULT WINAPI AddLight(LPDIRECT3DLIGHT lpLight);
|
83 | | - HRESULT WINAPI Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
84 | | - HRESULT WINAPI DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight);
|
85 | | - HRESULT WINAPI GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
86 | | - HRESULT WINAPI GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
87 | | - HRESULT WINAPI GetViewport(LPD3DVIEWPORT lpData);
|
88 | | - HRESULT WINAPI GetViewport2(LPD3DVIEWPORT2 lpData);
|
89 | | - HRESULT WINAPI Initialize(LPDIRECT3D lpDirect3D);
|
90 | | - HRESULT WINAPI LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
91 | | - HRESULT WINAPI NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
92 | | - HRESULT WINAPI SetBackground(D3DMATERIALHANDLE hMat);
|
93 | | - HRESULT WINAPI SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface);
|
94 | | - HRESULT WINAPI SetViewport(LPD3DVIEWPORT lpData);
|
95 | | - HRESULT WINAPI SetViewport2(LPD3DVIEWPORT2 lpData);
|
96 | | - HRESULT WINAPI TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
97 | | -private:
|
| 59 | + HRESULT(WINAPI *QueryInterface)(glDirect3DViewport3 *This, REFIID riid, void** ppvObj);
|
| 60 | + ULONG(WINAPI *AddRef)(glDirect3DViewport3 *This);
|
| 61 | + ULONG(WINAPI *Release)(glDirect3DViewport3 *This);
|
| 62 | + HRESULT(WINAPI *Initialize)(glDirect3DViewport3 *This, LPDIRECT3D lpDirect3D);
|
| 63 | + HRESULT(WINAPI *GetViewport)(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData);
|
| 64 | + HRESULT(WINAPI *SetViewport)(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData);
|
| 65 | + HRESULT(WINAPI *TransformVertices)(glDirect3DViewport3 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 66 | + HRESULT(WINAPI *LightElements)(glDirect3DViewport3 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 67 | + HRESULT(WINAPI *SetBackground)(glDirect3DViewport3 *This, D3DMATERIALHANDLE hMat);
|
| 68 | + HRESULT(WINAPI *GetBackground)(glDirect3DViewport3 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 69 | + HRESULT(WINAPI *SetBackgroundDepth)(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 70 | + HRESULT(WINAPI *GetBackgroundDepth)(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 71 | + HRESULT(WINAPI *Clear)(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 72 | + HRESULT(WINAPI *AddLight)(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 73 | + HRESULT(WINAPI *DeleteLight)(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 74 | + HRESULT(WINAPI *NextLight)(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 75 | + HRESULT(WINAPI *GetViewport2)(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData);
|
| 76 | + HRESULT(WINAPI *SetViewport2)(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData);
|
| 77 | + HRESULT(WINAPI *SetBackgroundDepth2)(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4 lpDDS);
|
| 78 | + HRESULT(WINAPI *GetBackgroundDepth2)(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid);
|
| 79 | + HRESULT(WINAPI *Clear2)(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil);
|
| 80 | +};
|
| 81 | +
|
| 82 | +HRESULT glDirect3DViewport3_Create(LPDIRECT3DVIEWPORT3 *viewport);
|
| 83 | +void glDirect3DViewport3_SetCurrent(glDirect3DViewport3 *This, bool current);
|
| 84 | +void glDirect3DViewport3_SetDevice(glDirect3DViewport3 *This, glDirect3DDevice7 *device);
|
| 85 | +void glDirect3DViewport3_Sync(glDirect3DViewport3 *This);
|
| 86 | +void glDirect3DViewport3_SyncLights(glDirect3DViewport3 *This);
|
| 87 | +
|
| 88 | +HRESULT WINAPI glDirect3DViewport3_QueryInterface(glDirect3DViewport3 *This, REFIID riid, void** ppvObj);
|
| 89 | +ULONG WINAPI glDirect3DViewport3_AddRef(glDirect3DViewport3 *This);
|
| 90 | +ULONG WINAPI glDirect3DViewport3_Release(glDirect3DViewport3 *This);
|
| 91 | +HRESULT WINAPI glDirect3DViewport3_Initialize(glDirect3DViewport3 *This, LPDIRECT3D lpDirect3D);
|
| 92 | +HRESULT WINAPI glDirect3DViewport3_GetViewport(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData);
|
| 93 | +HRESULT WINAPI glDirect3DViewport3_SetViewport(glDirect3DViewport3 *This, LPD3DVIEWPORT lpData);
|
| 94 | +HRESULT WINAPI glDirect3DViewport3_TransformVertices(glDirect3DViewport3 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 95 | +HRESULT WINAPI glDirect3DViewport3_LightElements(glDirect3DViewport3 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 96 | +HRESULT WINAPI glDirect3DViewport3_SetBackground(glDirect3DViewport3 *This, D3DMATERIALHANDLE hMat);
|
| 97 | +HRESULT WINAPI glDirect3DViewport3_GetBackground(glDirect3DViewport3 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 98 | +HRESULT WINAPI glDirect3DViewport3_SetBackgroundDepth(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 99 | +HRESULT WINAPI glDirect3DViewport3_GetBackgroundDepth(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 100 | +HRESULT WINAPI glDirect3DViewport3_Clear(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 101 | +HRESULT WINAPI glDirect3DViewport3_AddLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 102 | +HRESULT WINAPI glDirect3DViewport3_DeleteLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 103 | +HRESULT WINAPI glDirect3DViewport3_NextLight(glDirect3DViewport3 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 104 | +HRESULT WINAPI glDirect3DViewport3_GetViewport2(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData);
|
| 105 | +HRESULT WINAPI glDirect3DViewport3_SetViewport2(glDirect3DViewport3 *This, LPD3DVIEWPORT2 lpData);
|
| 106 | +HRESULT WINAPI glDirect3DViewport3_SetBackgroundDepth2(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4 lpDDS);
|
| 107 | +HRESULT WINAPI glDirect3DViewport3_GetBackgroundDepth2(glDirect3DViewport3 *This, LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid);
|
| 108 | +HRESULT WINAPI glDirect3DViewport3_Clear2(glDirect3DViewport3 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil);
|
| 109 | +
|
| 110 | +
|
| 111 | +struct glDirect3DViewport2Vtbl;
|
| 112 | +
|
| 113 | +typedef struct glDirect3DViewport2
|
| 114 | +{
|
| 115 | + glDirect3DViewport2Vtbl *lpVtbl;
|
98 | 116 | glDirect3DViewport3 *glD3DV3;
|
99 | 117 | int refcount;
|
100 | 118 | };
|
101 | 119 |
|
102 | | -class glDirect3DViewport1 : public IDirect3DViewport
|
| 120 | +typedef struct glDirect3DViewport2Vtbl
|
103 | 121 | {
|
104 | | -public:
|
105 | | - glDirect3DViewport1(glDirect3DViewport3 *glD3DV3);
|
106 | | - virtual ~glDirect3DViewport1();
|
107 | | - HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
|
108 | | - ULONG WINAPI AddRef();
|
109 | | - ULONG WINAPI Release();
|
110 | | - HRESULT WINAPI AddLight(LPDIRECT3DLIGHT lpLight);
|
111 | | - HRESULT WINAPI Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
112 | | - HRESULT WINAPI DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight);
|
113 | | - HRESULT WINAPI GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
114 | | - HRESULT WINAPI GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
115 | | - HRESULT WINAPI GetViewport(LPD3DVIEWPORT lpData);
|
116 | | - HRESULT WINAPI Initialize(LPDIRECT3D lpDirect3D);
|
117 | | - HRESULT WINAPI LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
118 | | - HRESULT WINAPI NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
119 | | - HRESULT WINAPI SetBackground(D3DMATERIALHANDLE hMat);
|
120 | | - HRESULT WINAPI SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface);
|
121 | | - HRESULT WINAPI SetViewport(LPD3DVIEWPORT lpData);
|
122 | | - HRESULT WINAPI TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
123 | | -private:
|
| 122 | + HRESULT(WINAPI *QueryInterface)(glDirect3DViewport2 *This, REFIID riid, void** ppvObj);
|
| 123 | + ULONG(WINAPI *AddRef)(glDirect3DViewport2 *This);
|
| 124 | + ULONG(WINAPI *Release)(glDirect3DViewport2 *This);
|
| 125 | + HRESULT(WINAPI *Initialize)(glDirect3DViewport2 *This, LPDIRECT3D lpDirect3D);
|
| 126 | + HRESULT(WINAPI *GetViewport)(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData);
|
| 127 | + HRESULT(WINAPI *SetViewport)(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData);
|
| 128 | + HRESULT(WINAPI *TransformVertices)(glDirect3DViewport2 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 129 | + HRESULT(WINAPI *LightElements)(glDirect3DViewport2 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 130 | + HRESULT(WINAPI *SetBackground)(glDirect3DViewport2 *This, D3DMATERIALHANDLE hMat);
|
| 131 | + HRESULT(WINAPI *GetBackground)(glDirect3DViewport2 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 132 | + HRESULT(WINAPI *SetBackgroundDepth)(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 133 | + HRESULT(WINAPI *GetBackgroundDepth)(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 134 | + HRESULT(WINAPI *Clear)(glDirect3DViewport2 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 135 | + HRESULT(WINAPI *AddLight)(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpLight);
|
| 136 | + HRESULT(WINAPI *DeleteLight)(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 137 | + HRESULT(WINAPI *NextLight)(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 138 | + HRESULT(WINAPI *GetViewport2)(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData);
|
| 139 | + HRESULT(WINAPI *SetViewport2)(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData);
|
| 140 | +};
|
| 141 | +
|
| 142 | +HRESULT glDirect3DViewport2_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT2 *viewport);
|
| 143 | +
|
| 144 | +HRESULT WINAPI glDirect3DViewport2_QueryInterface(glDirect3DViewport2 *This, REFIID riid, void** ppvObj);
|
| 145 | +ULONG WINAPI glDirect3DViewport2_AddRef(glDirect3DViewport2 *This);
|
| 146 | +ULONG WINAPI glDirect3DViewport2_Release(glDirect3DViewport2 *This);
|
| 147 | +HRESULT WINAPI glDirect3DViewport2_AddLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpLight);
|
| 148 | +HRESULT WINAPI glDirect3DViewport2_Clear(glDirect3DViewport2 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 149 | +HRESULT WINAPI glDirect3DViewport2_DeleteLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 150 | +HRESULT WINAPI glDirect3DViewport2_GetBackground(glDirect3DViewport2 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 151 | +HRESULT WINAPI glDirect3DViewport2_GetBackgroundDepth(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 152 | +HRESULT WINAPI glDirect3DViewport2_GetViewport(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData);
|
| 153 | +HRESULT WINAPI glDirect3DViewport2_GetViewport2(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData);
|
| 154 | +HRESULT WINAPI glDirect3DViewport2_Initialize(glDirect3DViewport2 *This, LPDIRECT3D lpDirect3D);
|
| 155 | +HRESULT WINAPI glDirect3DViewport2_LightElements(glDirect3DViewport2 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 156 | +HRESULT WINAPI glDirect3DViewport2_NextLight(glDirect3DViewport2 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 157 | +HRESULT WINAPI glDirect3DViewport2_SetBackground(glDirect3DViewport2 *This, D3DMATERIALHANDLE hMat);
|
| 158 | +HRESULT WINAPI glDirect3DViewport2_SetBackgroundDepth(glDirect3DViewport2 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 159 | +HRESULT WINAPI glDirect3DViewport2_SetViewport(glDirect3DViewport2 *This, LPD3DVIEWPORT lpData);
|
| 160 | +HRESULT WINAPI glDirect3DViewport2_SetViewport2(glDirect3DViewport2 *This, LPD3DVIEWPORT2 lpData);
|
| 161 | +HRESULT WINAPI glDirect3DViewport2_TransformVertices(glDirect3DViewport2 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 162 | +
|
| 163 | +
|
| 164 | +struct glDirect3DViewport1Vtbl;
|
| 165 | +
|
| 166 | +typedef struct glDirect3DViewport1
|
| 167 | +{
|
| 168 | + glDirect3DViewport1Vtbl *lpVtbl;
|
124 | 169 | glDirect3DViewport3 *glD3DV3;
|
125 | 170 | int refcount;
|
126 | 171 | };
|
127 | 172 |
|
| 173 | +typedef struct glDirect3DViewport1Vtbl
|
| 174 | +{
|
| 175 | + HRESULT(WINAPI *QueryInterface)(glDirect3DViewport1 *This, REFIID riid, void** ppvObj);
|
| 176 | + ULONG(WINAPI *AddRef)(glDirect3DViewport1 *This);
|
| 177 | + ULONG(WINAPI *Release)(glDirect3DViewport1 *This);
|
| 178 | + HRESULT(WINAPI *Initialize)(glDirect3DViewport1 *This, LPDIRECT3D lpDirect3D);
|
| 179 | + HRESULT(WINAPI *GetViewport)(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData);
|
| 180 | + HRESULT(WINAPI *SetViewport)(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData);
|
| 181 | + HRESULT(WINAPI *TransformVertices)(glDirect3DViewport1 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 182 | + HRESULT(WINAPI *LightElements)(glDirect3DViewport1 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 183 | + HRESULT(WINAPI *SetBackground)(glDirect3DViewport1 *This, D3DMATERIALHANDLE hMat);
|
| 184 | + HRESULT(WINAPI *GetBackground)(glDirect3DViewport1 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 185 | + HRESULT(WINAPI *SetBackgroundDepth)(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 186 | + HRESULT(WINAPI *GetBackgroundDepth)(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 187 | + HRESULT(WINAPI *Clear)(glDirect3DViewport1 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 188 | + HRESULT(WINAPI *AddLight)(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpLight);
|
| 189 | + HRESULT(WINAPI *DeleteLight)(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 190 | + HRESULT(WINAPI *NextLight)(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 191 | +};
|
| 192 | +
|
| 193 | +HRESULT glDirect3DViewport1_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT *viewport);
|
| 194 | +
|
| 195 | +HRESULT WINAPI glDirect3DViewport1_QueryInterface(glDirect3DViewport1 *This, REFIID riid, void** ppvObj);
|
| 196 | +ULONG WINAPI glDirect3DViewport1_AddRef(glDirect3DViewport1 *This);
|
| 197 | +ULONG WINAPI glDirect3DViewport1_Release(glDirect3DViewport1 *This);
|
| 198 | +HRESULT WINAPI glDirect3DViewport1_AddLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpLight);
|
| 199 | +HRESULT WINAPI glDirect3DViewport1_Clear(glDirect3DViewport1 *This, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
|
| 200 | +HRESULT WINAPI glDirect3DViewport1_DeleteLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight);
|
| 201 | +HRESULT WINAPI glDirect3DViewport1_GetBackground(glDirect3DViewport1 *This, LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid);
|
| 202 | +HRESULT WINAPI glDirect3DViewport1_GetBackgroundDepth(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid);
|
| 203 | +HRESULT WINAPI glDirect3DViewport1_GetViewport(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData);
|
| 204 | +HRESULT WINAPI glDirect3DViewport1_Initialize(glDirect3DViewport1 *This, LPDIRECT3D lpDirect3D);
|
| 205 | +HRESULT WINAPI glDirect3DViewport1_LightElements(glDirect3DViewport1 *This, DWORD dwElementCount, LPD3DLIGHTDATA lpData);
|
| 206 | +HRESULT WINAPI glDirect3DViewport1_NextLight(glDirect3DViewport1 *This, LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags);
|
| 207 | +HRESULT WINAPI glDirect3DViewport1_SetBackground(glDirect3DViewport1 *This, D3DMATERIALHANDLE hMat);
|
| 208 | +HRESULT WINAPI glDirect3DViewport1_SetBackgroundDepth(glDirect3DViewport1 *This, LPDIRECTDRAWSURFACE lpDDSurface);
|
| 209 | +HRESULT WINAPI glDirect3DViewport1_SetViewport(glDirect3DViewport1 *This, LPD3DVIEWPORT lpData);
|
| 210 | +HRESULT WINAPI glDirect3DViewport1_TransformVertices(glDirect3DViewport1 *This, DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
|
| 211 | +
|
| 212 | +#ifdef __cplusplus
|
| 213 | +}
|
| 214 | +#endif
|
| 215 | +
|
128 | 216 | #endif //__GLDIRECT3DVIEWPORT_H |
\ No newline at end of file |
Index: ddraw/glDirectDrawPalette.h |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011 William Feely
|
| 3 | +// Copyright (C) 2011-2014 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|