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