| 1 | #include <memory.h> | 
|---|
| 2 |  | 
|---|
| 3 | #define INITGUID | 
|---|
| 4 | #include "os2ddraw.h" | 
|---|
| 5 | #include "os2clipper.h" | 
|---|
| 6 | #include "os2palette.h" | 
|---|
| 7 | #include "os2surface.h" | 
|---|
| 8 | #define _OS2WIN_H | 
|---|
| 9 | #define FAR | 
|---|
| 10 | #include "misc.h" | 
|---|
| 11 | #include <winerror.h> | 
|---|
| 12 | #include <builtin.h> | 
|---|
| 13 | #undef THIS | 
|---|
| 14 | #define THIS VOID* | 
|---|
| 15 |  | 
|---|
| 16 | //****************************************************************************** | 
|---|
| 17 | //****************************************************************************** | 
|---|
| 18 | HRESULT __stdcall D3DQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj) | 
|---|
| 19 | { | 
|---|
| 20 | dprintf(("D3DQueryInterface\n")); | 
|---|
| 21 | *ppvObj = NULL; | 
|---|
| 22 |  | 
|---|
| 23 | if(IID_IDirect3D != (GUID &)&riid) | 
|---|
| 24 | return E_NOINTERFACE; | 
|---|
| 25 |  | 
|---|
| 26 | *ppvObj = This; | 
|---|
| 27 |  | 
|---|
| 28 | D3DAddRef(This); | 
|---|
| 29 | return(D3D_OK); | 
|---|
| 30 | } | 
|---|
| 31 | //****************************************************************************** | 
|---|
| 32 | //****************************************************************************** | 
|---|
| 33 | ULONG __stdcall D3DAddRef(THIS This) | 
|---|
| 34 | { | 
|---|
| 35 | OS2IDirectDraw *me = (OS2IDirectDraw *)This; | 
|---|
| 36 |  | 
|---|
| 37 | dprintf(("OS2IDirectDraw::AddRef %d\n", me->Referenced+1)); | 
|---|
| 38 | return ++me->Referenced; | 
|---|
| 39 | } | 
|---|
| 40 | //****************************************************************************** | 
|---|
| 41 | //****************************************************************************** | 
|---|
| 42 | ULONG __stdcall D3DRelease(THIS This) | 
|---|
| 43 | { | 
|---|
| 44 | OS2IDirectDraw *me = (OS2IDirectDraw *)This; | 
|---|
| 45 |  | 
|---|
| 46 | dprintf(("OS2IDirectDraw::Release %d\n", me->Referenced-1)); | 
|---|
| 47 | dprintf(("OS2IDirectDraw::%X \n", me)); | 
|---|
| 48 | if(me->Referenced) | 
|---|
| 49 | { | 
|---|
| 50 | me->Referenced--; | 
|---|
| 51 | if(me->Referenced == 0) | 
|---|
| 52 | { | 
|---|
| 53 | delete(me); | 
|---|
| 54 | return(0); | 
|---|
| 55 | } | 
|---|
| 56 | else | 
|---|
| 57 | return me->Referenced; | 
|---|
| 58 | } | 
|---|
| 59 | else | 
|---|
| 60 | return(0); | 
|---|
| 61 | } | 
|---|
| 62 | //****************************************************************************** | 
|---|
| 63 | //****************************************************************************** | 
|---|
| 64 | HRESULT __stdcall D3DInitialize(THIS This, REFIID) | 
|---|
| 65 | { | 
|---|
| 66 | dprintf(("D3DInitialize\n")); | 
|---|
| 67 | return(D3D_OK); | 
|---|
| 68 | } | 
|---|
| 69 | //****************************************************************************** | 
|---|
| 70 | //****************************************************************************** | 
|---|
| 71 | HRESULT __stdcall D3DEnumDevices(THIS This, LPD3DENUMDEVICESCALLBACK, LPVOID) | 
|---|
| 72 | { | 
|---|
| 73 | dprintf(("D3DEnumDevices\n")); | 
|---|
| 74 | return(D3D_OK); | 
|---|
| 75 | } | 
|---|
| 76 | //****************************************************************************** | 
|---|
| 77 | //****************************************************************************** | 
|---|
| 78 | HRESULT __stdcall D3DCreateLight(THIS This, LPDIRECT3DLIGHT*, IUnknown*) | 
|---|
| 79 | { | 
|---|
| 80 | dprintf(("D3DCreateLight\n")); | 
|---|
| 81 | return(D3D_OK); | 
|---|
| 82 | } | 
|---|
| 83 | //****************************************************************************** | 
|---|
| 84 | //****************************************************************************** | 
|---|
| 85 | HRESULT __stdcall D3DCreateMaterial(THIS This, LPDIRECT3DMATERIAL*, IUnknown*) | 
|---|
| 86 | { | 
|---|
| 87 | dprintf(("D3DCreateMaterial\n")); | 
|---|
| 88 | return(D3D_OK); | 
|---|
| 89 | } | 
|---|
| 90 | //****************************************************************************** | 
|---|
| 91 | //****************************************************************************** | 
|---|
| 92 | HRESULT __stdcall D3DCreateViewport(THIS This, LPDIRECT3DVIEWPORT*, IUnknown*) | 
|---|
| 93 | { | 
|---|
| 94 | dprintf(("D3DCreateViewport\n")); | 
|---|
| 95 | return(D3D_OK); | 
|---|
| 96 | } | 
|---|
| 97 | //****************************************************************************** | 
|---|
| 98 | //****************************************************************************** | 
|---|
| 99 | HRESULT __stdcall D3DFindDevice(THIS This, LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) | 
|---|
| 100 | { | 
|---|
| 101 | dprintf(("D3DCreateFindDevice\n")); | 
|---|
| 102 | return(D3D_OK); | 
|---|
| 103 | } | 
|---|
| 104 | //****************************************************************************** | 
|---|
| 105 | //****************************************************************************** | 
|---|