]> icculus.org git repositories - taylor/freespace2.git/blob - include/vd3d.h
Initial revision
[taylor/freespace2.git] / include / vd3d.h
1 /*==========================================================================;
2  *
3  *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
4  *
5  *  File:       d3d.h
6  *  Content:    Direct3D include file
7  *
8  ***************************************************************************/
9
10 #ifndef _D3D_H_
11 #define _D3D_H_
12
13 #include <stdlib.h>
14
15 #ifdef _WIN32
16 #define COM_NO_WINDOWS_H
17 #include <objbase.h>
18 #else
19 #include "d3dcom.h"
20 #endif
21
22 #ifdef _WIN32
23 #define D3DAPI WINAPI
24 #else
25 #define D3DAPI
26 #endif
27
28 /*
29  * Interface IID's
30  */
31 #if defined( _WIN32 ) && !defined( _NO_COM)
32 DEFINE_GUID( IID_IDirect3D,             0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
33 DEFINE_GUID( IID_IDirect3D2,            0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
34
35 DEFINE_GUID( IID_IDirect3DRampDevice,   0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
36 DEFINE_GUID( IID_IDirect3DRGBDevice,    0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
37 DEFINE_GUID( IID_IDirect3DHALDevice,    0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
38 DEFINE_GUID( IID_IDirect3DMMXDevice,    0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
39
40 DEFINE_GUID( IID_IDirect3DDevice,               0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
41 DEFINE_GUID( IID_IDirect3DDevice2,      0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
42 DEFINE_GUID( IID_IDirect3DTexture,      0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
43 DEFINE_GUID( IID_IDirect3DTexture2,     0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
44 DEFINE_GUID( IID_IDirect3DLight,        0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
45 DEFINE_GUID( IID_IDirect3DMaterial,     0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
46 DEFINE_GUID( IID_IDirect3DMaterial2,    0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
47 DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
48 DEFINE_GUID( IID_IDirect3DViewport,     0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
49 DEFINE_GUID( IID_IDirect3DViewport2,    0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
50 #endif
51
52 /*
53  * Data structures
54  */
55 #ifdef __cplusplus
56
57 /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
58 struct IDirect3D;
59 struct IDirect3D2;
60 struct IDirect3DDevice;
61 struct IDirect3DDevice2;
62 struct IDirect3DExecuteBuffer;
63 struct IDirect3DLight;
64 struct IDirect3DMaterial;
65 struct IDirect3DMaterial2;
66 struct IDirect3DTexture;
67 struct IDirect3DTexture2;
68 struct IDirect3DViewport;
69 struct IDirect3DViewport2;
70 typedef struct IDirect3D                *LPDIRECT3D;
71 typedef struct IDirect3D2               *LPDIRECT3D2;
72 typedef struct IDirect3DDevice          *LPDIRECT3DDEVICE;
73 typedef struct IDirect3DDevice2         *LPDIRECT3DDEVICE2;
74 typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
75 typedef struct IDirect3DLight           *LPDIRECT3DLIGHT;
76 typedef struct IDirect3DMaterial        *LPDIRECT3DMATERIAL;
77 typedef struct IDirect3DMaterial2       *LPDIRECT3DMATERIAL2;
78 typedef struct IDirect3DTexture         *LPDIRECT3DTEXTURE;
79 typedef struct IDirect3DTexture2                *LPDIRECT3DTEXTURE2;
80 typedef struct IDirect3DViewport        *LPDIRECT3DVIEWPORT;
81 typedef struct IDirect3DViewport2       *LPDIRECT3DVIEWPORT2;
82
83 #else
84
85 typedef struct IDirect3D                *LPDIRECT3D;
86 typedef struct IDirect3D2       *LPDIRECT3D2;
87 typedef struct IDirect3DDevice          *LPDIRECT3DDEVICE;
88 typedef struct IDirect3DDevice2         *LPDIRECT3DDEVICE2;
89 typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
90 typedef struct IDirect3DLight           *LPDIRECT3DLIGHT;
91 typedef struct IDirect3DMaterial        *LPDIRECT3DMATERIAL;
92 typedef struct IDirect3DMaterial2       *LPDIRECT3DMATERIAL2;
93 typedef struct IDirect3DTexture         *LPDIRECT3DTEXTURE;
94 typedef struct IDirect3DTexture2                *LPDIRECT3DTEXTURE2;
95 typedef struct IDirect3DViewport        *LPDIRECT3DVIEWPORT;
96 typedef struct IDirect3DViewport2       *LPDIRECT3DVIEWPORT2;
97
98 #endif
99
100 #include "vd3dtypes.h"
101 #include "vd3dcaps.h"
102
103 #ifdef __cplusplus
104 extern "C" {
105 #endif
106
107 /*
108  * IDirect3D
109  */
110 #undef INTERFACE
111 #define INTERFACE IDirect3D
112 DECLARE_INTERFACE_(IDirect3D, IUnknown)
113 {
114     /*** IUnknown methods ***/
115     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
116     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
117     STDMETHOD_(ULONG, Release) (THIS) PURE;
118     /*** IDirect3D methods ***/
119     STDMETHOD(Initialize) (THIS_ REFIID) PURE;
120     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
121     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
122     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
123     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
124     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
125 };
126
127 #if !defined(__cplusplus) || defined(CINTERFACE)
128 #define IDirect3D_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
129 #define IDirect3D_AddRef(p)                       (p)->lpVtbl->AddRef(p)
130 #define IDirect3D_Release(p)                      (p)->lpVtbl->Release(p)
131 #define IDirect3D_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
132 #define IDirect3D_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
133 #define IDirect3D_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
134 #define IDirect3D_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
135 #define IDirect3D_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
136 #define IDirect3D_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
137 #else
138 #define IDirect3D_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
139 #define IDirect3D_AddRef(p)                       (p)->AddRef()
140 #define IDirect3D_Release(p)                      (p)->Release()
141 #define IDirect3D_Initialize(p, a)                (p)->Initialize(a)
142 #define IDirect3D_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
143 #define IDirect3D_CreateLight(p, a, b)            (p)->CreateLight(a, b)
144 #define IDirect3D_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
145 #define IDirect3D_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
146 #define IDirect3D_FindDevice(p, a, b)             (p)->FindDevice(a, b)
147 #endif
148
149 /*
150  * IDirect3D2
151  */
152 #undef INTERFACE
153 #define INTERFACE IDirect3D2
154 DECLARE_INTERFACE_(IDirect3D2, IUnknown)
155 {
156     /*** IUnknown methods ***/
157     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
158     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
159     STDMETHOD_(ULONG, Release) (THIS) PURE;
160     /*** IDirect3D methods ***/
161     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
162     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
163     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
164     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
165     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
166
167     STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
168  
169 };
170
171 #if !defined(__cplusplus) || defined(CINTERFACE)
172 #define IDirect3D2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
173 #define IDirect3D2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
174 #define IDirect3D2_Release(p)                      (p)->lpVtbl->Release(p)
175 #define IDirect3D2_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
176 #define IDirect3D2_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
177 #define IDirect3D2_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
178 #define IDirect3D2_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
179 #define IDirect3D2_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
180 #define IDirect3D2_CreateDevice(p, a, b, c)                (p)->lpVtbl->CreateDevice(p, a, b, c)
181 #else
182 #define IDirect3D2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
183 #define IDirect3D2_AddRef(p)                       (p)->AddRef()
184 #define IDirect3D2_Release(p)                      (p)->Release()
185 #define IDirect3D2_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
186 #define IDirect3D2_CreateLight(p, a, b)            (p)->CreateLight(a, b)
187 #define IDirect3D2_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
188 #define IDirect3D2_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
189 #define IDirect3D2_FindDevice(p, a, b)             (p)->FindDevice(a, b)
190 #define IDirect3D2_CreateDevice(p, a, b, c)        (p)->CreateDevice(a, b, c)
191 #endif
192
193 /*
194  * IDirect3DDevice
195  */
196 #undef INTERFACE
197 #define INTERFACE IDirect3DDevice
198 DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
199 {
200     /*** IUnknown methods ***/
201     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
202     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
203     STDMETHOD_(ULONG, Release) (THIS) PURE;
204     /*** IDirect3DDevice methods ***/
205     STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
206     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
207     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
208     STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
209     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
210     STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
211     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
212     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
213     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
214     STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
215     STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
216     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
217     STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
218     STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
219     STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
220     STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
221     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
222     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
223     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
224 };
225
226 #if !defined(__cplusplus) || defined(CINTERFACE)
227 #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
228 #define IDirect3DDevice_AddRef(p)                       (p)->lpVtbl->AddRef(p)
229 #define IDirect3DDevice_Release(p)                      (p)->lpVtbl->Release(p)
230 #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->lpVtbl->Initialize(p, a, b, c)
231 #define IDirect3DDevice_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
232 #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
233 #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
234 #define IDirect3DDevice_GetStats(p, a)                  (p)->lpVtbl->GetStats(p, a)
235 #define IDirect3DDevice_Execute(p, a, b, c)             (p)->lpVtbl->Execute(p, a, b, c)
236 #define IDirect3DDevice_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
237 #define IDirect3DDevice_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
238 #define IDirect3DDevice_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
239 #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->lpVtbl->Pick(p, a, b, c, d)
240 #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->lpVtbl->GetPickRecords(p, a, b)
241 #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
242 #define IDirect3DDevice_CreateMatrix(p, a)              (p)->lpVtbl->CreateMatrix(p, a)
243 #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->lpVtbl->SetMatrix(p, a, b)
244 #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->lpVtbl->GetMatrix(p, a, b)
245 #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->lpVtbl->DeleteMatrix(p, a)
246 #define IDirect3DDevice_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
247 #define IDirect3DDevice_EndScene(p)                     (p)->lpVtbl->EndScene(p)
248 #define IDirect3DDevice_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
249 #else
250 #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
251 #define IDirect3DDevice_AddRef(p)                       (p)->AddRef()
252 #define IDirect3DDevice_Release(p)                      (p)->Release()
253 #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->Initialize(a, b, c)
254 #define IDirect3DDevice_GetCaps(p, a, b)                (p)->GetCaps(a, b)
255 #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
256 #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
257 #define IDirect3DDevice_GetStats(p, a)                  (p)->GetStats(a)
258 #define IDirect3DDevice_Execute(p, a, b, c)             (p)->Execute(a, b, c)
259 #define IDirect3DDevice_AddViewport(p, a)               (p)->AddViewport(a)
260 #define IDirect3DDevice_DeleteViewport(p, a)            (p)->DeleteViewport(a)
261 #define IDirect3DDevice_NextViewport(p, a, b)           (p)->NextViewport(a, b)
262 #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->Pick(a, b, c, d)
263 #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->GetPickRecords(a, b)
264 #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
265 #define IDirect3DDevice_CreateMatrix(p, a)              (p)->CreateMatrix(a)
266 #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->SetMatrix(a, b)
267 #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->GetMatrix(a, b)
268 #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->DeleteMatrix(a)
269 #define IDirect3DDevice_BeginScene(p)                   (p)->BeginScene()
270 #define IDirect3DDevice_EndScene(p)                     (p)->EndScene()
271 #define IDirect3DDevice_GetDirect3D(p, a)               (p)->GetDirect3D(a)
272 #endif
273
274 /*
275  * IDirect3DDevice2
276  */
277 #undef INTERFACE
278 #define INTERFACE IDirect3DDevice2
279 DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
280 {
281     /*** IUnknown methods ***/
282     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
283     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
284     STDMETHOD_(ULONG, Release) (THIS) PURE;
285     /*** IDirect3DDevice2 methods ***/
286     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
287     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
288     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
289     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
290     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
291     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
292     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
293     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
294     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
295     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
296
297     /*** DrawPrimitive API ***/
298     STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
299     STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
300
301     STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
302     STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
303
304     STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
305     STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
306     STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
307     STDMETHOD(Index) (THIS_ WORD) PURE;
308     STDMETHOD(End) (THIS_ DWORD) PURE;
309
310     STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
311     STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
312     STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
313     STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
314     STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
315     STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
316     STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
317
318     STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
319     STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
320
321     STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
322     STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
323 };
324
325 #if !defined(__cplusplus) || defined(CINTERFACE)
326 #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
327 #define IDirect3DDevice2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
328 #define IDirect3DDevice2_Release(p)                      (p)->lpVtbl->Release(p)
329 #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
330 #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
331 #define IDirect3DDevice2_GetStats(p, a)                  (p)->lpVtbl->CreateViewport(p, a)
332 #define IDirect3DDevice2_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
333 #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
334 #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
335 #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
336 #define IDirect3DDevice2_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
337 #define IDirect3DDevice2_EndScene(p)                     (p)->lpVtbl->EndScene(p)
338 #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
339
340 #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->lpVtbl->SetCurrentViewport(p, a)
341 #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->lpVtbl->GetCurrentViewport(p, a)
342
343 #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->lpVtbl->SetRenderTarget(p, a, b)
344 #define IDirect3DDevice2_GetRenderTarget(p, a)                   (p)->lpVtbl->GetRenderTarget(p, a)
345
346 #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->lpVtbl->Begin(p, a, b, c)
347 #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->lpVtbl->Begin(p, a, b, c, d, e)
348 #define IDirect3DDevice2_Vertex(p, a)                    (p)->lpVtbl->Vertex(p, a)
349 #define IDirect3DDevice2_Index(p, a)                     (p)->lpVtbl->Index(p, a)
350 #define IDirect3DDevice2_End(p, a)                       (p)->lpVtbl->End(p, a)
351
352 #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->lpVtbl->GetRenderState(p, a, b)
353 #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->lpVtbl->SetRenderState(p, a, b)
354 #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->lpVtbl->GetLightState(p, a, b)
355 #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->lpVtbl->SetLightState(p, a, b)
356 #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->lpVtbl->SetTransform(p, a, b)
357 #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->lpVtbl->GetTransform(p, a, b)
358 #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->lpVtbl->MultiplyTransform(p, a, b)
359
360 #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
361 #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
362                                                          (p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
363 #define IDirect3DDevice2_SetClipStatus(p, a)                             (p)->lpVtbl->SetClipStatus(p, a)
364 #define IDirect3DDevice2_GetClipStatus(p, a)                             (p)->lpVtbl->GetClipStatus(p, a)
365 #else
366 #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
367 #define IDirect3DDevice2_AddRef(p)                       (p)->AddRef()
368 #define IDirect3DDevice2_Release(p)                      (p)->Release()
369 #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
370 #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
371 #define IDirect3DDevice2_GetStats(p, a)                  (p)->CreateViewport(a)
372 #define IDirect3DDevice2_AddViewport(p, a)               (p)->AddViewport(a)
373 #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->DeleteViewport(a)
374 #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->NextViewport(a, b)
375 #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
376 #define IDirect3DDevice2_BeginScene(p)                   (p)->BeginScene()
377 #define IDirect3DDevice2_EndScene(p)                     (p)->EndScene()
378 #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->GetDirect3D(a)
379
380 #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->SetCurrentViewport(a)
381 #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->GetCurrentViewport(a)
382
383 #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->SetRenderTarget(a, b)
384 #define IDirect3DDevice2_GetRenderTarget(p, a)           (p)->GetRenderTarget(a)
385
386 #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->Begin(a, b, c)
387 #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->Begin(a, b, c, d, e)
388 #define IDirect3DDevice2_Vertex(p, a)                    (p)->Vertex(a)
389 #define IDirect3DDevice2_Index(p, a)                     (p)->Index(a)
390 #define IDirect3DDevice2_End(p, a)                       (p)->End(a)
391
392 #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->GetRenderState(a, b)
393 #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->SetRenderState(a, b)
394 #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->GetLightState(a, b)
395 #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->SetLightState(a, b)
396 #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->SetTransform(a, b)
397 #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->GetTransform(a, b)
398 #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->MultiplyTransform(a, b)
399
400 #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
401 #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
402                                                          (p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
403 #define IDirect3DDevice2_SetClipStatus(p, a)                             (p)->SetClipStatus(a)
404 #define IDirect3DDevice2_GetClipStatus(p, a)                             (p)->GetClipStatus(a)
405
406 #endif
407
408 /*
409  * IDirect3DExecuteBuffer
410  */
411 #undef INTERFACE
412 #define INTERFACE IDirect3DExecuteBuffer
413 DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
414 {
415     /*** IUnknown methods ***/
416     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
417     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
418     STDMETHOD_(ULONG, Release) (THIS) PURE;
419     /*** IDirect3DExecuteBuffer methods ***/
420     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
421     STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
422     STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
423     STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
424     STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
425     STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
426     STDMETHOD(Optimize) (THIS_ DWORD) PURE;
427 };
428
429 #if !defined(__cplusplus) || defined(CINTERFACE)
430 #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
431 #define IDirect3DExecuteBuffer_AddRef(p)               (p)->lpVtbl->AddRef(p)
432 #define IDirect3DExecuteBuffer_Release(p)              (p)->lpVtbl->Release(p)
433 #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
434 #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->lpVtbl->Lock(p, a)
435 #define IDirect3DExecuteBuffer_Unlock(p)               (p)->lpVtbl->Unlock(p)
436 #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->lpVtbl->SetExecuteData(p, a)
437 #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->lpVtbl->GetExecuteData(p, a)
438 #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
439 #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->lpVtbl->Optimize(p, a)
440 #else
441 #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
442 #define IDirect3DExecuteBuffer_AddRef(p)               (p)->AddRef()
443 #define IDirect3DExecuteBuffer_Release(p)              (p)->Release()
444 #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->Initialize(a, b)
445 #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->Lock(a)
446 #define IDirect3DExecuteBuffer_Unlock(p)               (p)->Unlock()
447 #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->SetExecuteData(a)
448 #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->GetExecuteData(a)
449 #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
450 #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->Optimize(a)
451 #endif
452
453 /*
454  * IDirect3DLight
455  */
456 #undef INTERFACE
457 #define INTERFACE IDirect3DLight
458 DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
459 {
460     /*** IUnknown methods ***/
461     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
462     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
463     STDMETHOD_(ULONG, Release) (THIS) PURE;
464     /*** IDirect3DLight methods ***/
465     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
466     STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
467     STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
468 };
469
470 #if !defined(__cplusplus) || defined(CINTERFACE)
471 #define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
472 #define IDirect3DLight_AddRef(p)               (p)->lpVtbl->AddRef(p)
473 #define IDirect3DLight_Release(p)              (p)->lpVtbl->Release(p)
474 #define IDirect3DLight_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
475 #define IDirect3DLight_SetLight(p, a)          (p)->lpVtbl->SetLight(p, a)
476 #define IDirect3DLight_GetLight(p, a)          (p)->lpVtbl->GetLight(p, a)
477 #else
478 #define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
479 #define IDirect3DLight_AddRef(p)               (p)->AddRef()
480 #define IDirect3DLight_Release(p)              (p)->Release()
481 #define IDirect3DLight_Initialize(p, a)        (p)->Initialize(a)
482 #define IDirect3DLight_SetLight(p, a)          (p)->SetLight(a)
483 #define IDirect3DLight_GetLight(p, a)          (p)->GetLight(a)
484 #endif
485
486 /*
487  * IDirect3DMaterial
488  */
489 #undef INTERFACE
490 #define INTERFACE IDirect3DMaterial
491 DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
492 {
493     /*** IUnknown methods ***/
494     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
495     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
496     STDMETHOD_(ULONG, Release) (THIS) PURE;
497     /*** IDirect3DMaterial methods ***/
498     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
499     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
500     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
501     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
502     STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
503     STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
504 };
505
506 #if !defined(__cplusplus) || defined(CINTERFACE)
507 #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
508 #define IDirect3DMaterial_AddRef(p)               (p)->lpVtbl->AddRef(p)
509 #define IDirect3DMaterial_Release(p)              (p)->lpVtbl->Release(p)
510 #define IDirect3DMaterial_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
511 #define IDirect3DMaterial_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
512 #define IDirect3DMaterial_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
513 #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
514 #define IDirect3DMaterial_Reserve(p)              (p)->lpVtbl->Reserve(p)
515 #define IDirect3DMaterial_Unreserve(p)            (p)->lpVtbl->Unreserve(p)
516 #else
517 #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
518 #define IDirect3DMaterial_AddRef(p)               (p)->AddRef()
519 #define IDirect3DMaterial_Release(p)              (p)->Release()
520 #define IDirect3DMaterial_Initialize(p, a)        (p)->Initialize(a)
521 #define IDirect3DMaterial_SetMaterial(p, a)       (p)->SetMaterial(a)
522 #define IDirect3DMaterial_GetMaterial(p, a)       (p)->GetMaterial(a)
523 #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->GetHandle(a, b)
524 #define IDirect3DMaterial_Reserve(p)              (p)->Reserve()
525 #define IDirect3DMaterial_Unreserve(p)            (p)->Unreserve()
526 #endif
527
528 /*
529  * IDirect3DMaterial2
530  */
531 #undef INTERFACE
532 #define INTERFACE IDirect3DMaterial2
533 DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
534 {
535     /*** IUnknown methods ***/
536     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
537     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
538     STDMETHOD_(ULONG, Release) (THIS) PURE;
539     /*** IDirect3DMaterial2 methods ***/
540     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
541     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
542     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
543 };
544
545 #if !defined(__cplusplus) || defined(CINTERFACE)
546 #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
547 #define IDirect3DMaterial2_AddRef(p)               (p)->lpVtbl->AddRef(p)
548 #define IDirect3DMaterial2_Release(p)              (p)->lpVtbl->Release(p)
549 #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
550 #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
551 #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
552 #else
553 #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
554 #define IDirect3DMaterial2_AddRef(p)               (p)->AddRef()
555 #define IDirect3DMaterial2_Release(p)              (p)->Release()
556 #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->SetMaterial(a)
557 #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->GetMaterial(a)
558 #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
559 #endif
560
561 /*
562  * IDirect3DTexture
563  */
564 #undef INTERFACE
565 #define INTERFACE IDirect3DTexture
566 DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
567 {
568     /*** IUnknown methods ***/
569     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
570     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
571     STDMETHOD_(ULONG, Release) (THIS) PURE;
572     /*** IDirect3DTexture methods ***/
573     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
574     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
575     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
576     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
577     STDMETHOD_(HRESULT, Unload) (THIS) PURE;
578 };
579
580 #if !defined(__cplusplus) || defined(CINTERFACE)
581 #define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
582 #define IDirect3DTexture_AddRef(p)               (p)->lpVtbl->AddRef(p)
583 #define IDirect3DTexture_Release(p)              (p)->lpVtbl->Release(p)
584 #define IDirect3DTexture_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
585 #define IDirect3DTexture_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
586 #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
587 #define IDirect3DTexture_Load(p, a)              (p)->lpVtbl->Load(p, a)
588 #define IDirect3DTexture_Unload(p)               (p)->lpVtbl->Unload(p)
589 #else
590 #define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
591 #define IDirect3DTexture_AddRef(p)               (p)->AddRef()
592 #define IDirect3DTexture_Release(p)              (p)->Release()
593 #define IDirect3DTexture_Initialize(p, a, b)     (p)->Initialize(a, b)
594 #define IDirect3DTexture_GetHandle(p, a, b)      (p)->GetHandle(a, b)
595 #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
596 #define IDirect3DTexture_Load(p, a)              (p)->Load(a)
597 #define IDirect3DTexture_Unload(p)               (p)->Unload()
598 #endif
599
600 /*
601  * IDirect3DTexture2
602  */
603 #undef INTERFACE
604 #define INTERFACE IDirect3DTexture2
605 DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
606 {
607     /*** IUnknown methods ***/
608     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
609     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
610     STDMETHOD_(ULONG, Release) (THIS) PURE;
611     /*** IDirect3DTexture2 methods ***/
612     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
613     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
614     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
615 };
616
617 #if !defined(__cplusplus) || defined(CINTERFACE)
618 #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
619 #define IDirect3DTexture2_AddRef(p)               (p)->lpVtbl->AddRef(p)
620 #define IDirect3DTexture2_Release(p)              (p)->lpVtbl->Release(p)
621 #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
622 #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
623 #define IDirect3DTexture2_Load(p, a)              (p)->lpVtbl->Load(p, a)
624 #else
625 #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
626 #define IDirect3DTexture2_AddRef(p)               (p)->AddRef()
627 #define IDirect3DTexture2_Release(p)              (p)->Release()
628 #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
629 #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
630 #define IDirect3DTexture2_Load(p, a)              (p)->Load(a)
631 #endif
632
633 /* 
634  * IDirect3DViewport
635  */
636 #undef INTERFACE
637 #define INTERFACE IDirect3DViewport
638 DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
639 {
640     /*** IUnknown methods ***/
641     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
642     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
643     STDMETHOD_(ULONG, Release) (THIS) PURE;
644     /*** IDirect3DViewport methods ***/
645     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
646     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
647     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
648     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
649     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
650     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
651     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
652     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
653     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
654     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
655     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
656     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
657     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
658 };
659
660 #if !defined(__cplusplus) || defined(CINTERFACE)
661 #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
662 #define IDirect3DViewport_AddRef(p)                        (p)->lpVtbl->AddRef(p)
663 #define IDirect3DViewport_Release(p)                       (p)->lpVtbl->Release(p)
664 #define IDirect3DViewport_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
665 #define IDirect3DViewport_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
666 #define IDirect3DViewport_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
667 #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
668 #define IDirect3DViewport_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
669 #define IDirect3DViewport_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
670 #define IDirect3DViewport_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
671 #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
672 #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
673 #define IDirect3DViewport_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
674 #define IDirect3DViewport_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
675 #define IDirect3DViewport_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
676 #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
677 #else
678 #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
679 #define IDirect3DViewport_AddRef(p)                        (p)->AddRef()
680 #define IDirect3DViewport_Release(p)                       (p)->Release()
681 #define IDirect3DViewport_Initialize(p, a)                 (p)->Initialize(a)
682 #define IDirect3DViewport_GetViewport(p, a)                (p)->GetViewport(a)
683 #define IDirect3DViewport_SetViewport(p, a)                (p)->SetViewport(a)
684 #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
685 #define IDirect3DViewport_LightElements(p, a, b)           (p)->LightElements(a, b)
686 #define IDirect3DViewport_SetBackground(p, a)              (p)->SetBackground(a)
687 #define IDirect3DViewport_GetBackground(p, a, b)           (p)->GetBackground(a, b)
688 #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
689 #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
690 #define IDirect3DViewport_Clear(p, a, b, c)                (p)->Clear(a, b, c)
691 #define IDirect3DViewport_AddLight(p, a)                   (p)->AddLight(a)
692 #define IDirect3DViewport_DeleteLight(p, a)                (p)->DeleteLight(a)
693 #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
694 #endif
695
696 /*
697  * IDirect3DViewport2
698  */
699 #undef INTERFACE
700 #define INTERFACE IDirect3DViewport2
701 DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
702 {
703     /*** IUnknown methods ***/
704     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
705     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
706     STDMETHOD_(ULONG, Release) (THIS) PURE;
707     /*** IDirect3DViewport methods ***/
708     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
709     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
710     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
711     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
712     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
713     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
714     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
715     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
716     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
717     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
718     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
719     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
720     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
721     /*** IDirect3DViewport2 methods ***/
722     STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
723     STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
724 };
725
726 #if !defined(__cplusplus) || defined(CINTERFACE)
727 #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
728 #define IDirect3DViewport2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
729 #define IDirect3DViewport2_Release(p)                       (p)->lpVtbl->Release(p)
730 #define IDirect3DViewport2_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
731 #define IDirect3DViewport2_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
732 #define IDirect3DViewport2_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
733 #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
734 #define IDirect3DViewport2_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
735 #define IDirect3DViewport2_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
736 #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
737 #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
738 #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
739 #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
740 #define IDirect3DViewport2_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
741 #define IDirect3DViewport2_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
742 #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
743 #define IDirect3DViewport2_GetViewport2(p, a)                (p)->lpVtbl->GetViewport2(p, a)
744 #define IDirect3DViewport2_SetViewport2(p, a)                (p)->lpVtbl->SetViewport2(p, a)
745 #else
746 #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
747 #define IDirect3DViewport2_AddRef(p)                        (p)->AddRef()
748 #define IDirect3DViewport2_Release(p)                       (p)->Release()
749 #define IDirect3DViewport2_Initialize(p, a)                 (p)->Initialize(a)
750 #define IDirect3DViewport2_GetViewport(p, a)                (p)->GetViewport(a)
751 #define IDirect3DViewport2_SetViewport(p, a)                (p)->SetViewport(a)
752 #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
753 #define IDirect3DViewport2_LightElements(p, a, b)           (p)->LightElements(a, b)
754 #define IDirect3DViewport2_SetBackground(p, a)              (p)->SetBackground(a)
755 #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->GetBackground(a, b)
756 #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
757 #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
758 #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->Clear(a, b, c)
759 #define IDirect3DViewport2_AddLight(p, a)                   (p)->AddLight(a)
760 #define IDirect3DViewport2_DeleteLight(p, a)                (p)->DeleteLight(a)
761 #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
762 #define IDirect3DViewport2_GetViewport2(p, a)                (p)->GetViewport2(a)
763 #define IDirect3DViewport2_SetViewport2(p, a)                (p)->SetViewport2(a)
764 #endif
765
766
767 /****************************************************************************
768  *
769  * Flags for IDirect3DDevice::NextViewport
770  *
771  ****************************************************************************/
772
773 /*
774  * Return the next viewport
775  */
776 #define D3DNEXT_NEXT    0x00000001l
777
778 /*
779  * Return the first viewport
780  */
781 #define D3DNEXT_HEAD    0x00000002l
782
783 /*
784  * Return the last viewport
785  */
786 #define D3DNEXT_TAIL    0x00000004l
787
788
789 /****************************************************************************
790  *
791  * Flags for DrawPrimitive/DrawIndexedPrimitive
792  *   Also valid for Begin/BeginIndexed
793  *
794  ****************************************************************************/
795
796 /*
797  * Wait until the device is ready to draw the primitive
798  * This will cause DP to not return DDERR_WASSTILLDRAWING
799  */
800 #define D3DDP_WAIT                                      0x00000001l
801
802
803 /*
804  * Hint that the primitives have been clipped by the application.
805  */
806 #define D3DDP_DONOTCLIP                         0x00000004l
807
808 /*
809  * Hint that the extents need not be updated.
810  */
811 #define D3DDP_DONOTUPDATEEXTENTS        0x00000008l
812
813 /*
814  * Direct3D Errors
815  * DirectDraw error codes are used when errors not specified here.
816  */
817 #define D3D_OK                          DD_OK
818 #define D3DERR_BADMAJORVERSION          MAKE_DDHRESULT(700)
819 #define D3DERR_BADMINORVERSION          MAKE_DDHRESULT(701)
820
821 /*
822  * An invalid device was requested by the application.
823  */
824 #define D3DERR_INVALID_DEVICE   MAKE_DDHRESULT(705)
825 #define D3DERR_INITFAILED       MAKE_DDHRESULT(706)
826
827 /*
828  * SetRenderTarget attempted on a device that was
829  * QI'd off the render target.
830  */
831 #define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
832
833 #define D3DERR_EXECUTE_CREATE_FAILED    MAKE_DDHRESULT(710)
834 #define D3DERR_EXECUTE_DESTROY_FAILED   MAKE_DDHRESULT(711)
835 #define D3DERR_EXECUTE_LOCK_FAILED      MAKE_DDHRESULT(712)
836 #define D3DERR_EXECUTE_UNLOCK_FAILED    MAKE_DDHRESULT(713)
837 #define D3DERR_EXECUTE_LOCKED           MAKE_DDHRESULT(714)
838 #define D3DERR_EXECUTE_NOT_LOCKED       MAKE_DDHRESULT(715)
839
840 #define D3DERR_EXECUTE_FAILED           MAKE_DDHRESULT(716)
841 #define D3DERR_EXECUTE_CLIPPED_FAILED   MAKE_DDHRESULT(717)
842
843 #define D3DERR_TEXTURE_NO_SUPPORT       MAKE_DDHRESULT(720)
844 #define D3DERR_TEXTURE_CREATE_FAILED    MAKE_DDHRESULT(721)
845 #define D3DERR_TEXTURE_DESTROY_FAILED   MAKE_DDHRESULT(722)
846 #define D3DERR_TEXTURE_LOCK_FAILED      MAKE_DDHRESULT(723)
847 #define D3DERR_TEXTURE_UNLOCK_FAILED    MAKE_DDHRESULT(724)
848 #define D3DERR_TEXTURE_LOAD_FAILED      MAKE_DDHRESULT(725)
849 #define D3DERR_TEXTURE_SWAP_FAILED      MAKE_DDHRESULT(726)
850 #define D3DERR_TEXTURE_LOCKED           MAKE_DDHRESULT(727)
851 #define D3DERR_TEXTURE_NOT_LOCKED       MAKE_DDHRESULT(728)
852 #define D3DERR_TEXTURE_GETSURF_FAILED   MAKE_DDHRESULT(729)
853
854 #define D3DERR_MATRIX_CREATE_FAILED     MAKE_DDHRESULT(730)
855 #define D3DERR_MATRIX_DESTROY_FAILED    MAKE_DDHRESULT(731)
856 #define D3DERR_MATRIX_SETDATA_FAILED    MAKE_DDHRESULT(732)
857 #define D3DERR_MATRIX_GETDATA_FAILED    MAKE_DDHRESULT(733)
858 #define D3DERR_SETVIEWPORTDATA_FAILED   MAKE_DDHRESULT(734)
859
860 #define D3DERR_INVALIDCURRENTVIEWPORT   MAKE_DDHRESULT(735)
861 #define D3DERR_INVALIDPRIMITIVETYPE     MAKE_DDHRESULT(736)
862 #define D3DERR_INVALIDVERTEXTYPE        MAKE_DDHRESULT(737)
863 #define D3DERR_TEXTURE_BADSIZE          MAKE_DDHRESULT(738)
864 #define D3DERR_INVALIDRAMPTEXTURE               MAKE_DDHRESULT(739)
865
866 #define D3DERR_MATERIAL_CREATE_FAILED   MAKE_DDHRESULT(740)
867 #define D3DERR_MATERIAL_DESTROY_FAILED  MAKE_DDHRESULT(741)
868 #define D3DERR_MATERIAL_SETDATA_FAILED  MAKE_DDHRESULT(742)
869 #define D3DERR_MATERIAL_GETDATA_FAILED  MAKE_DDHRESULT(743)
870 #define D3DERR_INVALIDPALETTE           MAKE_DDHRESULT(744)
871
872 #define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
873 #define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  MAKE_DDHRESULT(746)
874 #define D3DERR_SURFACENOTINVIDMEM       MAKE_DDHRESULT(747)
875
876 #define D3DERR_LIGHT_SET_FAILED         MAKE_DDHRESULT(750)
877 #define D3DERR_LIGHTHASVIEWPORT         MAKE_DDHRESULT(751)
878 #define D3DERR_LIGHTNOTINTHISVIEWPORT           MAKE_DDHRESULT(752)
879
880 #define D3DERR_SCENE_IN_SCENE           MAKE_DDHRESULT(760)
881 #define D3DERR_SCENE_NOT_IN_SCENE       MAKE_DDHRESULT(761)
882 #define D3DERR_SCENE_BEGIN_FAILED       MAKE_DDHRESULT(762)
883 #define D3DERR_SCENE_END_FAILED         MAKE_DDHRESULT(763)
884
885 #define D3DERR_INBEGIN                  MAKE_DDHRESULT(770)
886 #define D3DERR_NOTINBEGIN               MAKE_DDHRESULT(771)
887 #define D3DERR_NOVIEWPORTS              MAKE_DDHRESULT(772)
888 #define D3DERR_VIEWPORTDATANOTSET       MAKE_DDHRESULT(773)
889 #define D3DERR_VIEWPORTHASNODEVICE      MAKE_DDHRESULT(774)
890 #define D3DERR_NOCURRENTVIEWPORT                MAKE_DDHRESULT(775)
891
892 #ifdef __cplusplus
893 };
894 #endif
895
896 #endif /* _D3D_H_ */
897