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