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