Index: ddraw/glDirect3D.cpp |
— | — | @@ -788,11 +788,11 @@ |
789 | 789 | TRACE_ENTER(3,14,this,14,lplpD3DViewport2,14,pUnkOuter);
|
790 | 790 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
791 | 791 | if(!lplpD3DViewport2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
792 | | - glDirect3DMaterial3 *glD3DV3;
|
| 792 | + glDirect3DViewport3 *glD3DV3;
|
793 | 793 | HRESULT error = glD3D7->CreateViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3,pUnkOuter);
|
794 | 794 | if(FAILED(error)) TRACE_RET(HRESULT,23,error);
|
795 | | - glD3DV3->QueryInterface(IID_IDirect3DViewport2,(void**)lplpD3DViewport2);
|
796 | | - glD3DV3->Release();
|
| 795 | + glDirect3DViewport3_QueryInterface(glD3DV3,IID_IDirect3DViewport2,(void**)lplpD3DViewport2);
|
| 796 | + glDirect3DViewport3_Release(glD3DV3);
|
797 | 797 | TRACE_VAR("*lplpD3DViewport2",14,*lplpD3DViewport2);
|
798 | 798 | TRACE_EXIT(23,D3D_OK);
|
799 | 799 | return D3D_OK;
|
— | — | @@ -891,11 +891,11 @@ |
892 | 892 | TRACE_ENTER(3,14,this,14,lplpD3DViewport,14,pUnkOuter);
|
893 | 893 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
894 | 894 | if(!lplpD3DViewport) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
895 | | - glDirect3DMaterial3 *glD3DV3;
|
| 895 | + glDirect3DViewport3 *glD3DV3;
|
896 | 896 | HRESULT error = glD3D7->CreateViewport((LPDIRECT3DVIEWPORT3*)&glD3DV3,pUnkOuter);
|
897 | 897 | if(FAILED(error)) TRACE_RET(HRESULT,23,error);
|
898 | | - glD3DV3->QueryInterface(IID_IDirect3DViewport,(void**)lplpD3DViewport);
|
899 | | - glD3DV3->Release();
|
| 898 | + glDirect3DViewport3_QueryInterface(glD3DV3,IID_IDirect3DViewport,(void**)lplpD3DViewport);
|
| 899 | + glDirect3DViewport3_Release(glD3DV3);
|
900 | 900 | TRACE_VAR("*lplpD3DViewport",14,*lplpD3DViewport);
|
901 | 901 | TRACE_EXIT(23,D3D_OK);
|
902 | 902 | return D3D_OK;
|
Index: ddraw/glDirect3DViewport.cpp |
— | — | @@ -38,6 +38,31 @@ |
39 | 39 | return b|(g<<8)|(r<<16)|(a<<24);
|
40 | 40 | }
|
41 | 41 |
|
| 42 | +glDirect3DViewport3Vtbl glDirect3DViewport3_iface =
|
| 43 | +{
|
| 44 | + glDirect3DViewport3_QueryInterface,
|
| 45 | + glDirect3DViewport3_AddRef,
|
| 46 | + glDirect3DViewport3_Release,
|
| 47 | + glDirect3DViewport3_Initialize,
|
| 48 | + glDirect3DViewport3_GetViewport,
|
| 49 | + glDirect3DViewport3_SetViewport,
|
| 50 | + glDirect3DViewport3_TransformVertices,
|
| 51 | + glDirect3DViewport3_LightElements,
|
| 52 | + glDirect3DViewport3_SetBackground,
|
| 53 | + glDirect3DViewport3_GetBackground,
|
| 54 | + glDirect3DViewport3_SetBackgroundDepth,
|
| 55 | + glDirect3DViewport3_GetBackgroundDepth,
|
| 56 | + glDirect3DViewport3_Clear,
|
| 57 | + glDirect3DViewport3_AddLight,
|
| 58 | + glDirect3DViewport3_DeleteLight,
|
| 59 | + glDirect3DViewport3_NextLight,
|
| 60 | + glDirect3DViewport3_GetViewport2,
|
| 61 | + glDirect3DViewport3_SetViewport2,
|
| 62 | + glDirect3DViewport3_SetBackgroundDepth2,
|
| 63 | + glDirect3DViewport3_GetBackgroundDepth2,
|
| 64 | + glDirect3DViewport3_Clear2
|
| 65 | +};
|
| 66 | +
|
42 | 67 | HRESULT glDirect3DViewport3_Create(LPDIRECT3DVIEWPORT3 *viewport)
|
43 | 68 | {
|
44 | 69 | glDirect3DViewport3 *newvp;
|
— | — | @@ -46,6 +71,7 @@ |
47 | 72 | newvp = (glDirect3DViewport3*)malloc(sizeof(glDirect3DViewport3));
|
48 | 73 | if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
49 | 74 | *viewport = (LPDIRECT3DVIEWPORT3)newvp;
|
| 75 | + newvp->lpVtbl = &glDirect3DViewport3_iface;
|
50 | 76 | newvp->background = 0;
|
51 | 77 | ZeroMemory(&newvp->viewport,sizeof(D3DVIEWPORT2));
|
52 | 78 | newvp->viewport.dwSize = sizeof(D3DVIEWPORT2);
|
— | — | @@ -95,7 +121,7 @@ |
96 | 122 | }
|
97 | 123 | else
|
98 | 124 | {
|
99 | | - ret = glDirect3DViewport2_Create(This, (LPDIRECT3DVIEWPORT2*)*ppvObj);
|
| 125 | + ret = glDirect3DViewport2_Create(This, (LPDIRECT3DVIEWPORT2*)ppvObj);
|
100 | 126 | if (ret != DD_OK) TRACE_RET(HRESULT, 23, ret);
|
101 | 127 | glDirect3DViewport3_AddRef(This);
|
102 | 128 | This->glD3DV2 = (glDirect3DViewport2*)*ppvObj;
|
— | — | @@ -116,7 +142,7 @@ |
117 | 143 | }
|
118 | 144 | else
|
119 | 145 | {
|
120 | | - ret = glDirect3DViewport1_Create(This, (LPDIRECT3DVIEWPORT*)*ppvObj);
|
| 146 | + ret = glDirect3DViewport1_Create(This, (LPDIRECT3DVIEWPORT*)ppvObj);
|
121 | 147 | if (ret != DD_OK) TRACE_RET(HRESULT, 23, ret);
|
122 | 148 | glDirect3DViewport3_AddRef(This);
|
123 | 149 | This->glD3DV1 = (glDirect3DViewport1*)*ppvObj;
|
— | — | @@ -450,6 +476,27 @@ |
451 | 477 | TRACE_EXIT(0,0);
|
452 | 478 | }
|
453 | 479 |
|
| 480 | +glDirect3DViewport2Vtbl glDirect3DViewport2_iface =
|
| 481 | +{
|
| 482 | + glDirect3DViewport2_QueryInterface,
|
| 483 | + glDirect3DViewport2_AddRef,
|
| 484 | + glDirect3DViewport2_Release,
|
| 485 | + glDirect3DViewport2_Initialize,
|
| 486 | + glDirect3DViewport2_GetViewport,
|
| 487 | + glDirect3DViewport2_SetViewport,
|
| 488 | + glDirect3DViewport2_TransformVertices,
|
| 489 | + glDirect3DViewport2_LightElements,
|
| 490 | + glDirect3DViewport2_SetBackground,
|
| 491 | + glDirect3DViewport2_GetBackground,
|
| 492 | + glDirect3DViewport2_SetBackgroundDepth,
|
| 493 | + glDirect3DViewport2_GetBackgroundDepth,
|
| 494 | + glDirect3DViewport2_Clear,
|
| 495 | + glDirect3DViewport2_AddLight,
|
| 496 | + glDirect3DViewport2_DeleteLight,
|
| 497 | + glDirect3DViewport2_NextLight,
|
| 498 | + glDirect3DViewport2_GetViewport2,
|
| 499 | + glDirect3DViewport2_SetViewport2
|
| 500 | +};
|
454 | 501 |
|
455 | 502 | HRESULT glDirect3DViewport2_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT2 *viewport)
|
456 | 503 | {
|
— | — | @@ -459,6 +506,7 @@ |
460 | 507 | newvp = (glDirect3DViewport2*)malloc(sizeof(glDirect3DViewport2));
|
461 | 508 | if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
462 | 509 | *viewport = (LPDIRECT3DVIEWPORT2)newvp;
|
| 510 | + newvp->lpVtbl = &glDirect3DViewport2_iface;
|
463 | 511 | newvp->glD3DV3 = glD3DV3;
|
464 | 512 | newvp->refcount = 1;
|
465 | 513 | TRACE_EXIT(23, DD_OK);
|
— | — | @@ -598,6 +646,26 @@ |
599 | 647 | }
|
600 | 648 |
|
601 | 649 |
|
| 650 | +glDirect3DViewport1Vtbl glDirect3DViewport1_iface =
|
| 651 | +{
|
| 652 | + glDirect3DViewport1_QueryInterface,
|
| 653 | + glDirect3DViewport1_AddRef,
|
| 654 | + glDirect3DViewport1_Release,
|
| 655 | + glDirect3DViewport1_Initialize,
|
| 656 | + glDirect3DViewport1_GetViewport,
|
| 657 | + glDirect3DViewport1_SetViewport,
|
| 658 | + glDirect3DViewport1_TransformVertices,
|
| 659 | + glDirect3DViewport1_LightElements,
|
| 660 | + glDirect3DViewport1_SetBackground,
|
| 661 | + glDirect3DViewport1_GetBackground,
|
| 662 | + glDirect3DViewport1_SetBackgroundDepth,
|
| 663 | + glDirect3DViewport1_GetBackgroundDepth,
|
| 664 | + glDirect3DViewport1_Clear,
|
| 665 | + glDirect3DViewport1_AddLight,
|
| 666 | + glDirect3DViewport1_DeleteLight,
|
| 667 | + glDirect3DViewport1_NextLight
|
| 668 | +};
|
| 669 | +
|
602 | 670 | HRESULT glDirect3DViewport1_Create(glDirect3DViewport3 *glD3DV3, LPDIRECT3DVIEWPORT *viewport)
|
603 | 671 | {
|
604 | 672 | glDirect3DViewport1 *newvp;
|
— | — | @@ -606,6 +674,7 @@ |
607 | 675 | newvp = (glDirect3DViewport1*)malloc(sizeof(glDirect3DViewport1));
|
608 | 676 | if (!newvp) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
609 | 677 | *viewport = (LPDIRECT3DVIEWPORT)newvp;
|
| 678 | + newvp->lpVtbl = &glDirect3DViewport1_iface;
|
610 | 679 | newvp->glD3DV3 = glD3DV3;
|
611 | 680 | newvp->refcount = 1;
|
612 | 681 | TRACE_EXIT(23, DD_OK);
|
Index: ddraw/glDirect3DViewport.h |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | bool current;
|
55 | 55 | };
|
56 | 56 |
|
57 | | -typedef struct glDirect3DViewportVtbl
|
| 57 | +typedef struct glDirect3DViewport3Vtbl
|
58 | 58 | {
|
59 | 59 | HRESULT(WINAPI *QueryInterface)(glDirect3DViewport3 *This, REFIID riid, void** ppvObj);
|
60 | 60 | ULONG(WINAPI *AddRef)(glDirect3DViewport3 *This);
|