6 /* This is needed for GL_LIGHT */
9 DEFINE_GUID(IID_IDirect3D
, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
10 DEFINE_GUID(IID_IDirect3D2
, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
12 DEFINE_GUID(IID_IDirect3DRampDevice
, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
13 DEFINE_GUID(IID_IDirect3DRGBDevice
, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
14 DEFINE_GUID(IID_IDirect3DHALDevice
, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
15 DEFINE_GUID(IID_IDirect3DMMXDevice
, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
17 DEFINE_GUID(IID_IDirect3DDevice
, 0x64108800,0x957d,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29 );
18 DEFINE_GUID(IID_IDirect3DDevice2
, 0x93281501,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
19 DEFINE_GUID(IID_IDirect3DTexture
, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56);
20 DEFINE_GUID(IID_IDirect3DTexture2
, 0x93281502,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
21 DEFINE_GUID(IID_IDirect3DLight
, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
22 DEFINE_GUID(IID_IDirect3DMaterial
, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
23 DEFINE_GUID(IID_IDirect3DMaterial2
, 0x93281503,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
24 DEFINE_GUID(IID_IDirect3DExecuteBuffer
, 0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
25 DEFINE_GUID(IID_IDirect3DViewport
, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
26 DEFINE_GUID(IID_IDirect3DViewport2
, 0x93281500,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
28 typedef struct IDirect3D IDirect3D
,*LPDIRECT3D
;
29 typedef struct IDirect3D2 IDirect3D2
,*LPDIRECT3D2
;
30 typedef struct IDirect3DLight IDirect3DLight
,*LPDIRECT3DLIGHT
;
31 typedef struct IDirect3DDevice IDirect3DDevice
, *LPDIRECT3DDEVICE
;
32 typedef struct IDirect3DDevice2 IDirect3DDevice2
, *LPDIRECT3DDEVICE2
;
33 typedef struct IDirect3DViewport2 IDirect3DViewport
, IDirect3DViewport2
, *LPDIRECT3DVIEWPORT2
, *LPDIRECT3DVIEWPORT
;
34 typedef struct IDirect3DMaterial2 IDirect3DMaterial
, *LPDIRECT3DMATERIAL
, IDirect3DMaterial2
, *LPDIRECT3DMATERIAL2
;
35 typedef struct IDirect3DTexture2 IDirect3DTexture
, *LPDIRECT3DTEXTURE
, IDirect3DTexture2
, *LPDIRECT3DTEXTURE2
;
36 typedef struct IDirect3DExecuteBuffer IDirect3DExecuteBuffer
, *LPDIRECT3DEXECUTEBUFFER
;
38 /* ********************************************************************
40 ******************************************************************** */
42 #define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700)
43 #define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701)
44 #define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705)
45 #define D3DERR_INITFAILED MAKE_DDHRESULT(706)
46 #define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
47 #define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710)
48 #define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711)
49 #define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712)
50 #define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713)
51 #define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714)
52 #define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715)
53 #define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716)
54 #define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717)
55 #define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720)
56 #define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721)
57 #define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722)
58 #define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723)
59 #define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724)
60 #define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725)
61 #define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726)
62 #define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727)
63 #define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728)
64 #define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729)
65 #define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
66 #define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731)
67 #define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732)
68 #define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733)
69 #define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734)
70 #define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735)
71 #define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736)
72 #define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737)
73 #define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738)
74 #define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739)
75 #define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740)
76 #define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741)
77 #define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742)
78 #define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743)
79 #define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744)
80 #define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
81 #define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746)
82 #define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747)
83 #define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750)
84 #define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751)
85 #define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752)
86 #define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760)
87 #define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761)
88 #define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762)
89 #define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763)
90 #define D3DERR_INBEGIN MAKE_DDHRESULT(770)
91 #define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771)
92 #define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772)
93 #define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773)
94 #define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774)
95 #define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775)
97 /* ********************************************************************
99 ******************************************************************** */
100 #define D3DNEXT_NEXT 0x01l
101 #define D3DNEXT_HEAD 0x02l
102 #define D3DNEXT_TAIL 0x04l
107 D3DLIGHT_DIRECTIONAL
= 3,
108 D3DLIGHT_PARALLELPOINT
= 4,
109 D3DLIGHT_FORCE_DWORD
= 0x7fffffff
116 D3DPT_TRIANGLELIST
= 4,
117 D3DPT_TRIANGLESTRIP
= 5,
118 D3DPT_TRIANGLEFAN
= 6,
119 D3DPT_FORCE_DWORD
= 0x7fffffff
124 D3DFILL_WIREFRAME
= 2,
126 D3DFILL_FORCE_DWORD
= 0x7fffffff
131 D3DSHADE_GOURAUD
= 2,
133 D3DSHADE_FORCE_DWORD
= 0x7fffffff
140 D3DCULL_FORCE_DWORD
= 0x7fffffff
146 D3DBLEND_SRCCOLOR
= 3,
147 D3DBLEND_INVSRCCOLOR
= 4,
148 D3DBLEND_SRCALPHA
= 5,
149 D3DBLEND_INVSRCALPHA
= 6,
150 D3DBLEND_DESTALPHA
= 7,
151 D3DBLEND_INVDESTALPHA
= 8,
152 D3DBLEND_DESTCOLOR
= 9,
153 D3DBLEND_INVDESTCOLOR
= 10,
154 D3DBLEND_SRCALPHASAT
= 11,
155 D3DBLEND_BOTHSRCALPHA
= 12,
156 D3DBLEND_BOTHINVSRCALPHA
= 13,
157 D3DBLEND_FORCE_DWORD
= 0x7fffffff
162 D3DTBLEND_MODULATE
= 2,
163 D3DTBLEND_DECALALPHA
= 3,
164 D3DTBLEND_MODULATEALPHA
= 4,
165 D3DTBLEND_DECALMASK
= 5,
166 D3DTBLEND_MODULATEMASK
= 6,
169 D3DTBLEND_FORCE_DWORD
= 0x7fffffff
173 D3DFILTER_NEAREST
= 1,
174 D3DFILTER_LINEAR
= 2,
175 D3DFILTER_MIPNEAREST
= 3,
176 D3DFILTER_MIPLINEAR
= 4,
177 D3DFILTER_LINEARMIPNEAREST
= 5,
178 D3DFILTER_LINEARMIPLINEAR
= 6,
179 D3DFILTER_FORCE_DWORD
= 0x7fffffff
183 D3DRENDERSTATE_TEXTUREHANDLE
= 1, /* Texture handle */
184 D3DRENDERSTATE_ANTIALIAS
= 2, /* D3DANTIALIASMODE */
185 D3DRENDERSTATE_TEXTUREADDRESS
= 3, /* D3DTEXTUREADDRESS */
186 D3DRENDERSTATE_TEXTUREPERSPECTIVE
= 4, /* TRUE for perspective correction */
187 D3DRENDERSTATE_WRAPU
= 5, /* TRUE for wrapping in u */
188 D3DRENDERSTATE_WRAPV
= 6, /* TRUE for wrapping in v */
189 D3DRENDERSTATE_ZENABLE
= 7, /* TRUE to enable z test */
190 D3DRENDERSTATE_FILLMODE
= 8, /* D3DFILL_MODE */
191 D3DRENDERSTATE_SHADEMODE
= 9, /* D3DSHADEMODE */
192 D3DRENDERSTATE_LINEPATTERN
= 10, /* D3DLINEPATTERN */
193 D3DRENDERSTATE_MONOENABLE
= 11, /* TRUE to enable mono rasterization */
194 D3DRENDERSTATE_ROP2
= 12, /* ROP2 */
195 D3DRENDERSTATE_PLANEMASK
= 13, /* DWORD physical plane mask */
196 D3DRENDERSTATE_ZWRITEENABLE
= 14, /* TRUE to enable z writes */
197 D3DRENDERSTATE_ALPHATESTENABLE
= 15, /* TRUE to enable alpha tests */
198 D3DRENDERSTATE_LASTPIXEL
= 16, /* TRUE for last-pixel on lines */
199 D3DRENDERSTATE_TEXTUREMAG
= 17, /* D3DTEXTUREFILTER */
200 D3DRENDERSTATE_TEXTUREMIN
= 18, /* D3DTEXTUREFILTER */
201 D3DRENDERSTATE_SRCBLEND
= 19, /* D3DBLEND */
202 D3DRENDERSTATE_DESTBLEND
= 20, /* D3DBLEND */
203 D3DRENDERSTATE_TEXTUREMAPBLEND
= 21, /* D3DTEXTUREBLEND */
204 D3DRENDERSTATE_CULLMODE
= 22, /* D3DCULL */
205 D3DRENDERSTATE_ZFUNC
= 23, /* D3DCMPFUNC */
206 D3DRENDERSTATE_ALPHAREF
= 24, /* D3DFIXED */
207 D3DRENDERSTATE_ALPHAFUNC
= 25, /* D3DCMPFUNC */
208 D3DRENDERSTATE_DITHERENABLE
= 26, /* TRUE to enable dithering */
209 D3DRENDERSTATE_ALPHABLENDENABLE
= 27, /* TRUE to enable alpha blending */
210 D3DRENDERSTATE_FOGENABLE
= 28, /* TRUE to enable fog */
211 D3DRENDERSTATE_SPECULARENABLE
= 29, /* TRUE to enable specular */
212 D3DRENDERSTATE_ZVISIBLE
= 30, /* TRUE to enable z checking */
213 D3DRENDERSTATE_SUBPIXEL
= 31, /* TRUE to enable subpixel correction */
214 D3DRENDERSTATE_SUBPIXELX
= 32, /* TRUE to enable correction in X only */
215 D3DRENDERSTATE_STIPPLEDALPHA
= 33, /* TRUE to enable stippled alpha */
216 D3DRENDERSTATE_FOGCOLOR
= 34, /* D3DCOLOR */
217 D3DRENDERSTATE_FOGTABLEMODE
= 35, /* D3DFOGMODE */
218 D3DRENDERSTATE_FOGTABLESTART
= 36, /* Fog table start */
219 D3DRENDERSTATE_FOGTABLEEND
= 37, /* Fog table end */
220 D3DRENDERSTATE_FOGTABLEDENSITY
= 38, /* Fog table density */
221 D3DRENDERSTATE_STIPPLEENABLE
= 39, /* TRUE to enable stippling */
222 D3DRENDERSTATE_EDGEANTIALIAS
= 40, /* TRUE to enable edge antialiasing */
223 D3DRENDERSTATE_COLORKEYENABLE
= 41, /* TRUE to enable source colorkeyed textures */
224 D3DRENDERSTATE_BORDERCOLOR
= 43, /* Border color for texturing w/border */
225 D3DRENDERSTATE_TEXTUREADDRESSU
= 44, /* Texture addressing mode for U coordinate */
226 D3DRENDERSTATE_TEXTUREADDRESSV
= 45, /* Texture addressing mode for V coordinate */
227 D3DRENDERSTATE_MIPMAPLODBIAS
= 46, /* D3DVALUE Mipmap LOD bias */
228 D3DRENDERSTATE_ZBIAS
= 47, /* LONG Z bias */
229 D3DRENDERSTATE_RANGEFOGENABLE
= 48, /* Enables range-based fog */
230 D3DRENDERSTATE_ANISOTROPY
= 49, /* Max. anisotropy. 1 = no anisotropy */
231 D3DRENDERSTATE_FLUSHBATCH
= 50, /* Explicit flush for DP batching (DX5 Only) */
232 D3DRENDERSTATE_STIPPLEPATTERN00
= 64, /* Stipple pattern 01... */
233 D3DRENDERSTATE_STIPPLEPATTERN01
= 65,
234 D3DRENDERSTATE_STIPPLEPATTERN02
= 66,
235 D3DRENDERSTATE_STIPPLEPATTERN03
= 67,
236 D3DRENDERSTATE_STIPPLEPATTERN04
= 68,
237 D3DRENDERSTATE_STIPPLEPATTERN05
= 69,
238 D3DRENDERSTATE_STIPPLEPATTERN06
= 70,
239 D3DRENDERSTATE_STIPPLEPATTERN07
= 71,
240 D3DRENDERSTATE_STIPPLEPATTERN08
= 72,
241 D3DRENDERSTATE_STIPPLEPATTERN09
= 73,
242 D3DRENDERSTATE_STIPPLEPATTERN10
= 74,
243 D3DRENDERSTATE_STIPPLEPATTERN11
= 75,
244 D3DRENDERSTATE_STIPPLEPATTERN12
= 76,
245 D3DRENDERSTATE_STIPPLEPATTERN13
= 77,
246 D3DRENDERSTATE_STIPPLEPATTERN14
= 78,
247 D3DRENDERSTATE_STIPPLEPATTERN15
= 79,
248 D3DRENDERSTATE_STIPPLEPATTERN16
= 80,
249 D3DRENDERSTATE_STIPPLEPATTERN17
= 81,
250 D3DRENDERSTATE_STIPPLEPATTERN18
= 82,
251 D3DRENDERSTATE_STIPPLEPATTERN19
= 83,
252 D3DRENDERSTATE_STIPPLEPATTERN20
= 84,
253 D3DRENDERSTATE_STIPPLEPATTERN21
= 85,
254 D3DRENDERSTATE_STIPPLEPATTERN22
= 86,
255 D3DRENDERSTATE_STIPPLEPATTERN23
= 87,
256 D3DRENDERSTATE_STIPPLEPATTERN24
= 88,
257 D3DRENDERSTATE_STIPPLEPATTERN25
= 89,
258 D3DRENDERSTATE_STIPPLEPATTERN26
= 90,
259 D3DRENDERSTATE_STIPPLEPATTERN27
= 91,
260 D3DRENDERSTATE_STIPPLEPATTERN28
= 92,
261 D3DRENDERSTATE_STIPPLEPATTERN29
= 93,
262 D3DRENDERSTATE_STIPPLEPATTERN30
= 94,
263 D3DRENDERSTATE_STIPPLEPATTERN31
= 95,
264 D3DRENDERSTATE_FORCE_DWORD
= 0x7fffffff, /* force 32-bit size enum */
265 } D3DRENDERSTATETYPE
;
271 D3DCMP_LESSEQUAL
= 4,
274 D3DCMP_GREATEREQUAL
= 7,
276 D3DCMP_FORCE_DWORD
= 0x7fffffff
280 D3DLIGHTSTATE_MATERIAL
= 1,
281 D3DLIGHTSTATE_AMBIENT
= 2,
282 D3DLIGHTSTATE_COLORMODEL
= 3,
283 D3DLIGHTSTATE_FOGMODE
= 4,
284 D3DLIGHTSTATE_FOGSTART
= 5,
285 D3DLIGHTSTATE_FOGEND
= 6,
286 D3DLIGHTSTATE_FOGDENSITY
= 7,
287 D3DLIGHTSTATE_FORCE_DWORD
= 0x7fffffff, /* force 32-bit size enum */
294 D3DVT_FORCE_DWORD
= 0x7fffffff, /* force 32-bit size enum */
298 D3DTRANSFORMSTATE_WORLD
= 1,
299 D3DTRANSFORMSTATE_VIEW
= 2,
300 D3DTRANSFORMSTATE_PROJECTION
= 3,
301 D3DTRANSFORMSTATE_FORCE_DWORD
= 0x7fffffff, /* force 32-bit size enum */
302 } D3DTRANSFORMSTATETYPE
;
304 /* ********************************************************************
306 ******************************************************************** */
307 typedef DWORD D3DMATERIALHANDLE
, *LPD3DMATERIALHANDLE
;
308 typedef DWORD D3DTEXTUREHANDLE
, *LPD3DTEXTUREHANDLE
;
309 typedef DWORD D3DVIEWPORTHANDLE
, *LPD3DVIEWPORTHANDLE
;
310 typedef DWORD D3DMATRIXHANDLE
, *LPD3DMATRIXHANDLE
;
312 typedef DWORD D3DCOLOR
, *LPD3DCOLOR
;
317 } D3DTRANSFORMCAPS
,*LPD3DTRANSFORMCAPS
;
319 #define D3DTRANSFORMCAPS_CLIP 0x00000001
324 DWORD dwLightingModel
;
326 } D3DLIGHTINGCAPS
, *LPD3DLIGHTINGCAPS
;
328 #define D3DLIGHTINGMODEL_RGB 0x00000001
329 #define D3DLIGHTINGMODEL_MONO 0x00000002
331 #define D3DLIGHTCAPS_POINT 0x00000001
332 #define D3DLIGHTCAPS_SPOT 0x00000002
333 #define D3DLIGHTCAPS_DIRECTIONAL 0x00000004
334 #define D3DLIGHTCAPS_PARALLELPOINT 0x00000008
337 #define D3DCOLOR_MONO 1
338 #define D3DCOLOR_RGB 2
340 typedef DWORD D3DCOLORMODEL
;
344 DWORD dwMiscCaps
; /* Capability flags */
347 DWORD dwSrcBlendCaps
;
348 DWORD dwDestBlendCaps
;
349 DWORD dwAlphaCmpCaps
;
352 DWORD dwTextureFilterCaps
;
353 DWORD dwTextureBlendCaps
;
354 DWORD dwTextureAddressCaps
;
355 DWORD dwStippleWidth
; /* maximum width and height of */
356 DWORD dwStippleHeight
; /* of supported stipple (up to 32x32) */
357 } D3DPRIMCAPS
, *LPD3DPRIMCAPS
;
359 /* D3DPRIMCAPS.dwMiscCaps */
360 #define D3DPMISCCAPS_MASKPLANES 0x00000001
361 #define D3DPMISCCAPS_MASKZ 0x00000002
362 #define D3DPMISCCAPS_LINEPATTERNREP 0x00000004
363 #define D3DPMISCCAPS_CONFORMANT 0x00000008
364 #define D3DPMISCCAPS_CULLNONE 0x00000010
365 #define D3DPMISCCAPS_CULLCW 0x00000020
366 #define D3DPMISCCAPS_CULLCCW 0x00000040
368 /* D3DPRIMCAPS.dwRasterCaps */
369 #define D3DPRASTERCAPS_DITHER 0x00000001
370 #define D3DPRASTERCAPS_ROP2 0x00000002
371 #define D3DPRASTERCAPS_XOR 0x00000004
372 #define D3DPRASTERCAPS_PAT 0x00000008
373 #define D3DPRASTERCAPS_ZTEST 0x00000010
374 #define D3DPRASTERCAPS_SUBPIXEL 0x00000020
375 #define D3DPRASTERCAPS_SUBPIXELX 0x00000040
376 #define D3DPRASTERCAPS_FOGVERTEX 0x00000080
377 #define D3DPRASTERCAPS_FOGTABLE 0x00000100
378 #define D3DPRASTERCAPS_STIPPLE 0x00000200
379 #define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400
380 #define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800
381 #define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000
382 #define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000
383 #define D3DPRASTERCAPS_ZBIAS 0x00004000
384 #define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000
385 #define D3DPRASTERCAPS_FOGRANGE 0x00010000
386 #define D3DPRASTERCAPS_ANISOTROPY 0x00020000
388 /* D3DPRIMCAPS.dwZCmpCaps and dwAlphaCmpCaps */
389 #define D3DPCMPCAPS_NEVER 0x00000001
390 #define D3DPCMPCAPS_LESS 0x00000002
391 #define D3DPCMPCAPS_EQUAL 0x00000004
392 #define D3DPCMPCAPS_LESSEQUAL 0x00000008
393 #define D3DPCMPCAPS_GREATER 0x00000010
394 #define D3DPCMPCAPS_NOTEQUAL 0x00000020
395 #define D3DPCMPCAPS_GREATEREQUAL 0x00000040
396 #define D3DPCMPCAPS_ALWAYS 0x00000080
398 /* D3DPRIMCAPS.dwSourceBlendCaps, dwDestBlendCaps */
399 #define D3DPBLENDCAPS_ZERO 0x00000001
400 #define D3DPBLENDCAPS_ONE 0x00000002
401 #define D3DPBLENDCAPS_SRCCOLOR 0x00000004
402 #define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008
403 #define D3DPBLENDCAPS_SRCALPHA 0x00000010
404 #define D3DPBLENDCAPS_INVSRCALPHA 0x00000020
405 #define D3DPBLENDCAPS_DESTALPHA 0x00000040
406 #define D3DPBLENDCAPS_INVDESTALPHA 0x00000080
407 #define D3DPBLENDCAPS_DESTCOLOR 0x00000100
408 #define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200
409 #define D3DPBLENDCAPS_SRCALPHASAT 0x00000400
410 #define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800
411 #define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000
413 /* D3DPRIMCAPS.dwShadeCaps */
414 #define D3DPSHADECAPS_COLORFLATMONO 0x00000001
415 #define D3DPSHADECAPS_COLORFLATRGB 0x00000002
416 #define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004
417 #define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008
418 #define D3DPSHADECAPS_COLORPHONGMONO 0x00000010
419 #define D3DPSHADECAPS_COLORPHONGRGB 0x00000020
421 #define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040
422 #define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080
423 #define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100
424 #define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200
425 #define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400
426 #define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800
428 #define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000
429 #define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000
430 #define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000
431 #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000
432 #define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000
433 #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000
435 #define D3DPSHADECAPS_FOGFLAT 0x00040000
436 #define D3DPSHADECAPS_FOGGOURAUD 0x00080000
437 #define D3DPSHADECAPS_FOGPHONG 0x00100000
439 /* D3DPRIMCAPS.dwTextureCaps */
440 #define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001
441 #define D3DPTEXTURECAPS_POW2 0x00000002
442 #define D3DPTEXTURECAPS_ALPHA 0x00000004
443 #define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008
444 #define D3DPTEXTURECAPS_BORDER 0x00000010
445 #define D3DPTEXTURECAPS_SQUAREONLY 0x00000020
447 /* D3DPRIMCAPS.dwTextureFilterCaps */
448 #define D3DPTFILTERCAPS_NEAREST 0x00000001
449 #define D3DPTFILTERCAPS_LINEAR 0x00000002
450 #define D3DPTFILTERCAPS_MIPNEAREST 0x00000004
451 #define D3DPTFILTERCAPS_MIPLINEAR 0x00000008
452 #define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010
453 #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020
455 /* D3DPRIMCAPS.dwTextureBlendCaps */
456 #define D3DPTBLENDCAPS_DECAL 0x00000001
457 #define D3DPTBLENDCAPS_MODULATE 0x00000002
458 #define D3DPTBLENDCAPS_DECALALPHA 0x00000004
459 #define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008
460 #define D3DPTBLENDCAPS_DECALMASK 0x00000010
461 #define D3DPTBLENDCAPS_MODULATEMASK 0x00000020
462 #define D3DPTBLENDCAPS_COPY 0x00000040
463 #define D3DPTBLENDCAPS_ADD 0x00000080
465 /* D3DPRIMCAPS.dwTextureAddressCaps */
466 #define D3DPTADDRESSCAPS_WRAP 0x00000001
467 #define D3DPTADDRESSCAPS_MIRROR 0x00000002
468 #define D3DPTADDRESSCAPS_CLAMP 0x00000004
469 #define D3DPTADDRESSCAPS_BORDER 0x00000008
470 #define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010
473 /* D3DDEVICEDESC.dwFlags */
474 #define D3DDD_COLORMODEL 0x00000001
475 #define D3DDD_DEVCAPS 0x00000002
476 #define D3DDD_TRANSFORMCAPS 0x00000004
477 #define D3DDD_LIGHTINGCAPS 0x00000008
478 #define D3DDD_BCLIPPING 0x00000010
479 #define D3DDD_LINECAPS 0x00000020
480 #define D3DDD_TRICAPS 0x00000040
481 #define D3DDD_DEVICERENDERBITDEPTH 0x00000080
482 #define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100
483 #define D3DDD_MAXBUFFERSIZE 0x00000200
484 #define D3DDD_MAXVERTEXCOUNT 0x00000400
486 /* D3DDEVICEDESC.dwDevCaps */
487 #define D3DDEVCAPS_FLOATTLVERTEX 0x00000001
488 #define D3DDEVCAPS_SORTINCREASINGZ 0x00000002
489 #define D3DDEVCAPS_SORTDECREASINGZ 0X00000004
490 #define D3DDEVCAPS_SORTEXACT 0x00000008
491 #define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010
492 #define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020
493 #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040
494 #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080
495 #define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100
496 #define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200
497 #define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400
498 #define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800
499 #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000
501 typedef struct _D3DDeviceDesc
{
504 D3DCOLORMODEL dcmColorModel
;
506 D3DTRANSFORMCAPS dtcTransformCaps
;
508 D3DLIGHTINGCAPS dlcLightingCaps
;
509 D3DPRIMCAPS dpcLineCaps
;
510 D3DPRIMCAPS dpcTriCaps
;
511 DWORD dwDeviceRenderBitDepth
;
512 DWORD dwDeviceZBufferBitDepth
;
513 DWORD dwMaxBufferSize
;
514 DWORD dwMaxVertexCount
;
515 /* *** New fields for DX5 *** */
516 DWORD dwMinTextureWidth
,dwMinTextureHeight
;
517 DWORD dwMaxTextureWidth
,dwMaxTextureHeight
;
518 DWORD dwMinStippleWidth
,dwMaxStippleWidth
;
519 DWORD dwMinStippleHeight
,dwMaxStippleHeight
;
520 } D3DDEVICEDESC
,*LPD3DDEVICEDESC
;
522 typedef HRESULT (CALLBACK
* LPD3DENUMDEVICESCALLBACK
)(LPGUID lpGuid
,LPSTR lpDeviceDescription
,LPSTR lpDeviceName
,LPD3DDEVICEDESC
,LPD3DDEVICEDESC
,LPVOID
);
523 typedef HRESULT (CALLBACK
* LPD3DVALIDATECALLBACK
)(LPVOID lpUserArg
, DWORD dwOffset
);
526 /* dwflags for FindDevice */
527 #define D3DFDS_COLORMODEL 0x00000001
528 #define D3DFDS_GUID 0x00000002
529 #define D3DFDS_HARDWARE 0x00000004
530 #define D3DFDS_TRIANGLES 0x00000008
531 #define D3DFDS_LINES 0x00000010
532 #define D3DFDS_MISCCAPS 0x00000020
533 #define D3DFDS_RASTERCAPS 0x00000040
534 #define D3DFDS_ZCMPCAPS 0x00000080
535 #define D3DFDS_ALPHACMPCAPS 0x00000100
536 #define D3DFDS_DSTBLENDCAPS 0x00000400
537 #define D3DFDS_SHADECAPS 0x00000800
538 #define D3DFDS_TEXTURECAPS 0x00001000
539 #define D3DFDS_TEXTUREFILTERCAPS 0x00002000
540 #define D3DFDS_TEXTUREBLENDCAPS 0x00004000
541 #define D3DFDS_TEXTUREADDRESSCAPS 0x00008000
547 D3DCOLORMODEL dcmColorModel
;
550 D3DPRIMCAPS dpcPrimCaps
;
551 } D3DFINDDEVICESEARCH
,*LPD3DFINDDEVICESEARCH
;
556 D3DDEVICEDESC ddHwDesc
;
557 D3DDEVICEDESC ddSwDesc
;
558 } D3DFINDDEVICERESULT
,*LPD3DFINDDEVICERESULT
;
560 #define D3DVALP(val, prec) ((float)(val))
561 #define D3DVAL(val) ((float)(val))
562 typedef float D3DVALUE
,*LPD3DVALUE
;
563 #define D3DDivide(a, b) (float)((double) (a) / (double) (b))
564 #define D3DMultiply(a, b) ((a) * (b))
567 DWORD dwFlags
; /* Homogeneous clipping flags */
580 } D3DHVERTEX
, *LPD3DHVERTEX
;
582 * Transformed/lit vertices
586 D3DVALUE sx
; /* Screen coordinates */
598 D3DVALUE rhw
; /* Reciprocal of homogeneous w */
602 D3DCOLOR color
; /* Vertex color */
606 D3DCOLOR specular
; /* Specular component of vertex */
610 D3DVALUE tu
; /* Texture coordinates */
617 } D3DTLVERTEX
, *LPD3DTLVERTEX
;
620 D3DVALUE x
; /* Homogeneous coordinates */
633 D3DCOLOR color
; /* Vertex color */
637 D3DCOLOR specular
; /* Specular component of vertex */
641 D3DVALUE tu
; /* Texture coordinates */
648 } D3DLVERTEX
, *LPD3DLVERTEX
;
651 D3DVALUE x
; /* Homogeneous coordinates */
663 D3DVALUE nx
; /* Normal */
675 D3DVALUE tu
; /* Texture coordinates */
682 } D3DVERTEX
, *LPD3DVERTEX
;
701 } D3DRECT
, *LPD3DRECT
;
716 /* the c++ variant has operator overloads etc. too */
717 } D3DVECTOR
,*LPD3DVECTOR
;
720 D3DVALUE _11
, _12
, _13
, _14
;
721 D3DVALUE _21
, _22
, _23
, _24
;
722 D3DVALUE _31
, _32
, _33
, _34
;
723 D3DVALUE _41
, _42
, _43
, _44
;
724 } D3DMATRIX
, *LPD3DMATRIX
;
726 typedef struct _D3DCOLORVALUE
{
743 } D3DCOLORVALUE
,*LPD3DCOLORVALUE
;
747 D3DLIGHTTYPE dltType
;
748 D3DCOLORVALUE dcvColor
;
749 D3DVECTOR dvPosition
; /* Position in world space */
750 D3DVECTOR dvDirection
; /* Direction in world space */
751 D3DVALUE dvRange
; /* Cutoff range */
752 D3DVALUE dvFalloff
; /* Falloff */
753 D3DVALUE dvAttenuation0
; /* Constant attenuation */
754 D3DVALUE dvAttenuation1
; /* Linear attenuation */
755 D3DVALUE dvAttenuation2
; /* Quadratic attenuation */
756 D3DVALUE dvTheta
; /* Inner angle of spotlight cone */
757 D3DVALUE dvPhi
; /* Outer angle of spotlight cone */
758 } D3DLIGHT
,*LPD3DLIGHT
;
761 #define D3DLIGHT_ACTIVE 0x00000001
762 #define D3DLIGHT_NO_SPECULAR 0x00000002
765 typedef HRESULT (CALLBACK
* LPD3DENUMTEXTUREFORMATSCALLBACK
)(LPDDSURFACEDESC lpDdsd
, LPVOID lpContext
);
768 /* Statistics structure */
771 DWORD dwTrianglesDrawn
;
775 DWORD dwVerticesProcessed
;
776 } D3DSTATS
, *LPD3DSTATS
;
779 typedef struct _D3DCLIPSTATUS
{
780 DWORD dwFlags
; /* Do we set 2d extents, 3D extents or status */
781 DWORD dwStatus
; /* Clip status */
782 float minx
, maxx
; /* X extents */
783 float miny
, maxy
; /* Y extents */
784 float minz
, maxz
; /* Z extents */
785 } D3DCLIPSTATUS
, *LPD3DCLIPSTATUS
;
790 D3DCOLORVALUE diffuse
; /* Diffuse color RGBA */
791 D3DCOLORVALUE dcvDiffuse
;
794 D3DCOLORVALUE ambient
; /* Ambient color RGB */
795 D3DCOLORVALUE dcvAmbient
;
798 D3DCOLORVALUE specular
; /* Specular 'shininess' */
799 D3DCOLORVALUE dcvSpecular
;
802 D3DCOLORVALUE emissive
; /* Emissive color RGB */
803 D3DCOLORVALUE dcvEmissive
;
806 D3DVALUE power
; /* Sharpness if specular highlight */
809 D3DTEXTUREHANDLE hTexture
; /* Handle to texture map */
811 } D3DMATERIAL
, *LPD3DMATERIAL
;
814 D3DVECTOR dvPosition
; /* Lightable point in model space */
815 D3DVECTOR dvNormal
; /* Normalised unit vector */
816 } D3DLIGHTINGELEMENT
, *LPD3DLIGHTINGELEMENT
;
821 DWORD dwY
; /* Top left */
823 DWORD dwHeight
; /* Dimensions */
824 D3DVALUE dvScaleX
; /* Scale homogeneous to screen */
825 D3DVALUE dvScaleY
; /* Scale homogeneous to screen */
826 D3DVALUE dvMaxX
; /* Min/max homogeneous x coord */
827 D3DVALUE dvMaxY
; /* Min/max homogeneous y coord */
829 D3DVALUE dvMaxZ
; /* Min/max homogeneous z coord */
830 } D3DVIEWPORT
, *LPD3DVIEWPORT
;
835 DWORD dwY
; /* Viewport Top left */
837 DWORD dwHeight
; /* Viewport Dimensions */
838 D3DVALUE dvClipX
; /* Top left of clip volume */
840 D3DVALUE dvClipWidth
; /* Clip Volume Dimensions */
841 D3DVALUE dvClipHeight
;
842 D3DVALUE dvMinZ
; /* Min/max of clip Volume */
844 } D3DVIEWPORT2
, *LPD3DVIEWPORT2
;
846 #define D3DTRANSFORM_CLIPPED 0x00000001l
847 #define D3DTRANSFORM_UNCLIPPED 0x00000002l
851 LPVOID lpIn
; /* Input vertices */
852 DWORD dwInSize
; /* Stride of input vertices */
853 LPVOID lpOut
; /* Output vertices */
854 DWORD dwOutSize
; /* Stride of output vertices */
855 LPD3DHVERTEX lpHOut
; /* Output homogeneous vertices */
856 DWORD dwClip
; /* Clipping hint */
857 DWORD dwClipIntersection
;
858 DWORD dwClipUnion
; /* Union of all clip flags */
859 D3DRECT drExtent
; /* Extent of transformed vertices */
860 } D3DTRANSFORMDATA
, *LPD3DTRANSFORMDATA
;
863 #define D3DLIGHT_ACTIVE 0x00000001
864 #define D3DLIGHT_NO_SPECULAR 0x00000002
866 /* maximum valid light range */
867 #define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
869 typedef struct _D3DLIGHT2
{
871 D3DLIGHTTYPE dltType
; /* Type of light source */
872 D3DCOLORVALUE dcvColor
; /* Color of light */
873 D3DVECTOR dvPosition
; /* Position in world space */
874 D3DVECTOR dvDirection
; /* Direction in world space */
875 D3DVALUE dvRange
; /* Cutoff range */
876 D3DVALUE dvFalloff
; /* Falloff */
877 D3DVALUE dvAttenuation0
; /* Constant attenuation */
878 D3DVALUE dvAttenuation1
; /* Linear attenuation */
879 D3DVALUE dvAttenuation2
; /* Quadratic attenuation */
880 D3DVALUE dvTheta
; /* Inner angle of spotlight cone */
881 D3DVALUE dvPhi
; /* Outer angle of spotlight cone */
883 } D3DLIGHT2
, *LPD3DLIGHT2
;
885 typedef struct _D3DLIGHTDATA
{
887 LPD3DLIGHTINGELEMENT lpIn
; /* Input positions and normals */
888 DWORD dwInSize
; /* Stride of input elements */
889 LPD3DTLVERTEX lpOut
; /* Output colors */
890 DWORD dwOutSize
; /* Stride of output colors */
891 } D3DLIGHTDATA
, *LPD3DLIGHTDATA
;
893 typedef struct _D3DPICKRECORD
{
898 } D3DPICKRECORD
, *LPD3DPICKRECORD
;
901 typedef struct _D3DExecuteBufferDesc
{
907 } D3DEXECUTEBUFFERDESC
;
908 typedef D3DEXECUTEBUFFERDESC
*LPD3DEXECUTEBUFFERDESC
;
910 #define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
911 #define D3DDEB_CAPS 0x00000002l /* caps valid */
912 #define D3DDEB_LPDATA 0x00000004l /* lpData valid */
914 #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
915 #define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
916 #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
919 * Values for d3d status.
921 #define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT
922 #define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT
923 #define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP
924 #define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM
925 #define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT
926 #define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK
927 #define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0
928 #define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1
929 #define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2
930 #define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3
931 #define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4
932 #define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5
934 #define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L
935 #define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L
936 #define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L
937 #define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L
938 #define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L
939 #define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L
940 #define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L
941 #define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L
942 #define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L
943 #define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L
944 #define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L
945 #define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L
946 #define D3DSTATUS_ZNOTVISIBLE 0x01000000L
948 #define D3DSTATUS_CLIPUNIONALL ( \
949 D3DSTATUS_CLIPUNIONLEFT | \
950 D3DSTATUS_CLIPUNIONRIGHT | \
951 D3DSTATUS_CLIPUNIONTOP | \
952 D3DSTATUS_CLIPUNIONBOTTOM | \
953 D3DSTATUS_CLIPUNIONFRONT | \
954 D3DSTATUS_CLIPUNIONBACK | \
955 D3DSTATUS_CLIPUNIONGEN0 | \
956 D3DSTATUS_CLIPUNIONGEN1 | \
957 D3DSTATUS_CLIPUNIONGEN2 | \
958 D3DSTATUS_CLIPUNIONGEN3 | \
959 D3DSTATUS_CLIPUNIONGEN4 | \
960 D3DSTATUS_CLIPUNIONGEN5 \
963 #define D3DSTATUS_CLIPINTERSECTIONALL ( \
964 D3DSTATUS_CLIPINTERSECTIONLEFT | \
965 D3DSTATUS_CLIPINTERSECTIONRIGHT | \
966 D3DSTATUS_CLIPINTERSECTIONTOP | \
967 D3DSTATUS_CLIPINTERSECTIONBOTTOM | \
968 D3DSTATUS_CLIPINTERSECTIONFRONT | \
969 D3DSTATUS_CLIPINTERSECTIONBACK | \
970 D3DSTATUS_CLIPINTERSECTIONGEN0 | \
971 D3DSTATUS_CLIPINTERSECTIONGEN1 | \
972 D3DSTATUS_CLIPINTERSECTIONGEN2 | \
973 D3DSTATUS_CLIPINTERSECTIONGEN3 | \
974 D3DSTATUS_CLIPINTERSECTIONGEN4 | \
975 D3DSTATUS_CLIPINTERSECTIONGEN5 \
978 #define D3DSTATUS_DEFAULT ( \
979 D3DSTATUS_CLIPINTERSECTIONALL | \
980 D3DSTATUS_ZNOTVISIBLE)
983 typedef struct _D3DSTATUS
{
987 } D3DSTATUS
, *LPD3DSTATUS
;
990 typedef struct _D3DEXECUTEDATA
{
992 DWORD dwVertexOffset
;
994 DWORD dwInstructionOffset
;
995 DWORD dwInstructionLength
;
996 DWORD dwHVertexOffset
;
998 } D3DEXECUTEDATA
, *LPD3DEXECUTEDATA
;
1000 typedef enum _D3DOPCODE
{
1004 D3DOP_MATRIXLOAD
= 4,
1005 D3DOP_MATRIXMULTIPLY
= 5,
1006 D3DOP_STATETRANSFORM
= 6,
1007 D3DOP_STATELIGHT
= 7,
1008 D3DOP_STATERENDER
= 8,
1009 D3DOP_PROCESSVERTICES
= 9,
1010 D3DOP_TEXTURELOAD
= 10,
1012 D3DOP_BRANCHFORWARD
= 12,
1014 D3DOP_SETSTATUS
= 14,
1016 D3DOP_FORCE_DWORD
= 0x7fffffff,
1019 typedef struct _D3DPOINT
{
1022 } D3DPOINT
, *LPD3DPOINT
;
1024 typedef struct _D3DLINE
{
1033 } D3DLINE
, *LPD3DLINE
;
1035 #define D3DTRIFLAG_START 0x00000000L
1036 #define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */
1037 #define D3DTRIFLAG_ODD 0x0000001eL
1038 #define D3DTRIFLAG_EVEN 0x0000001fL
1040 #define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */
1041 #define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */
1042 #define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */
1043 #define D3DTRIFLAG_EDGEENABLETRIANGLE \
1044 (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
1046 typedef struct _D3DTRIANGLE
{
1060 } D3DTRIANGLE
, *LPD3DTRIANGLE
;
1062 typedef struct _D3DMATRIXLOAD
{
1063 D3DMATRIXHANDLE hDestMatrix
;
1064 D3DMATRIXHANDLE hSrcMatrix
;
1065 } D3DMATRIXLOAD
, *LPD3DMATRIXLOAD
;
1067 typedef struct _D3DMATRIXMULTIPLY
{
1068 D3DMATRIXHANDLE hDestMatrix
;
1069 D3DMATRIXHANDLE hSrcMatrix1
;
1070 D3DMATRIXHANDLE hSrcMatrix2
;
1071 } D3DMATRIXMULTIPLY
, *LPD3DMATRIXMULTIPLY
;
1073 typedef struct _D3DSTATE
{
1075 D3DTRANSFORMSTATETYPE dtstTransformStateType
;
1076 D3DLIGHTSTATETYPE dlstLightStateType
;
1077 D3DRENDERSTATETYPE drstRenderStateType
;
1083 } D3DSTATE
, *LPD3DSTATE
;
1085 #define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
1086 #define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
1087 #define D3DPROCESSVERTICES_COPY 0x00000002L
1088 #define D3DPROCESSVERTICES_OPMASK 0x00000007L
1090 #define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
1091 #define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
1093 typedef struct _D3DPROCESSVERTICES
{
1099 } D3DPROCESSVERTICES
, *LPD3DPROCESSVERTICES
;
1101 typedef struct _D3DTEXTURELOAD
{
1102 D3DTEXTUREHANDLE hDestTexture
;
1103 D3DTEXTUREHANDLE hSrcTexture
;
1104 } D3DTEXTURELOAD
, *LPD3DTEXTURELOAD
;
1106 typedef struct _D3DBRANCH
{
1111 } D3DBRANCH
, *LPD3DBRANCH
;
1113 typedef struct _D3DSPAN
{
1116 } D3DSPAN
, *LPD3DSPAN
;
1118 typedef struct _D3DINSTRUCTION
{
1122 } D3DINSTRUCTION
, *LPD3DINSTRUCTION
;
1125 /* ********************************************************************
1127 ******************************************************************** */
1128 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
1129 #define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
1132 #define THIS_ THIS ,
1134 #define THIS LPDIRECT3D this
1135 typedef struct IDirect3D_VTable
{
1136 /*** IUnknown methods ***/
1137 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1138 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1139 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1140 /*** IDirect3D methods ***/
1141 STDMETHOD(Initialize
) (THIS_ REFIID
) PURE
;
1142 STDMETHOD(EnumDevices
)(THIS_ LPD3DENUMDEVICESCALLBACK
, LPVOID
) PURE
;
1143 STDMETHOD(CreateLight
) (THIS_ LPDIRECT3DLIGHT
*, IUnknown
*) PURE
;
1144 STDMETHOD(CreateMaterial
) (THIS_ LPDIRECT3DMATERIAL
*, IUnknown
*) PURE
;
1145 STDMETHOD(CreateViewport
) (THIS_ LPDIRECT3DVIEWPORT
*, IUnknown
*) PURE
;
1146 STDMETHOD(FindDevice
)(THIS_ LPD3DFINDDEVICESEARCH
, LPD3DFINDDEVICERESULT
) PURE
;
1147 } *LPDIRECT3D_VTABLE
,IDirect3D_VTable
;
1150 LPDIRECT3D_VTABLE lpvtbl
;
1156 /* ********************************************************************
1158 ******************************************************************** */
1159 #define THIS LPDIRECT3D2 this
1160 typedef struct IDirect3D2_VTable
{
1161 /*** IUnknown methods ***/
1162 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1163 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1164 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1165 /*** IDirect3D2 methods ***/
1166 STDMETHOD(EnumDevices
)(THIS_ LPD3DENUMDEVICESCALLBACK
, LPVOID
) PURE
;
1167 STDMETHOD(CreateLight
) (THIS_ LPDIRECT3DLIGHT
*, IUnknown
*) PURE
;
1168 STDMETHOD(CreateMaterial
) (THIS_ LPDIRECT3DMATERIAL2
*, IUnknown
*) PURE
;
1169 STDMETHOD(CreateViewport
) (THIS_ LPDIRECT3DVIEWPORT2
*, IUnknown
*) PURE
;
1170 STDMETHOD(FindDevice
)(THIS_ LPD3DFINDDEVICESEARCH
, LPD3DFINDDEVICERESULT
) PURE
;
1171 STDMETHOD(CreateDevice
)(THIS_ REFCLSID
, LPDIRECTDRAWSURFACE
, LPDIRECT3DDEVICE2
*) PURE
;
1172 } *LPDIRECT3D2_VTABLE
,IDirect3D2_VTable
;
1175 LPDIRECT3D2_VTABLE lpvtbl
;
1181 /* ********************************************************************
1183 ******************************************************************** */
1184 #define THIS LPDIRECT3DLIGHT this
1185 typedef struct IDirect3DLight_VTable
{
1186 /*** IUnknown methods ***/
1187 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1188 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1189 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1190 /*** IDirect3DLight methods ***/
1191 STDMETHOD(Initialize
) (THIS_ LPDIRECT3D
) PURE
;
1192 STDMETHOD(SetLight
) (THIS_ LPD3DLIGHT
) PURE
;
1193 STDMETHOD(GetLight
) (THIS_ LPD3DLIGHT
) PURE
;
1194 } IDirect3DLight_VTable
,*LPDIRECT3DLIGHT_VTABLE
;
1196 struct IDirect3DLight
{
1197 LPDIRECT3DLIGHT_VTABLE lpvtbl
;
1208 /* Chained list used for adding / removing from viewports */
1209 LPDIRECT3DLIGHT next
, prev
;
1211 /* Activation function */
1212 void (*activate
)(THIS
);
1215 /* Awful OpenGL code !!! */
1223 /* ********************************************************************
1225 ******************************************************************** */
1226 #define THIS LPDIRECT3DMATERIAL this
1227 typedef struct IDirect3DMaterial_VTable
{
1228 /*** IUnknown methods ***/
1229 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1230 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1231 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1232 /*** IDirect3DMaterial2 methods ***/
1233 STDMETHOD(Initialize
) (THIS_ LPDIRECT3D
) PURE
;
1234 STDMETHOD(SetMaterial
) (THIS_ LPD3DMATERIAL
) PURE
;
1235 STDMETHOD(GetMaterial
) (THIS_ LPD3DMATERIAL
) PURE
;
1236 STDMETHOD(GetHandle
) (THIS_ LPDIRECT3DDEVICE2
, LPD3DMATERIALHANDLE
) PURE
;
1237 STDMETHOD_(HRESULT
, Reserve
) (THIS
) PURE
;
1238 STDMETHOD_(HRESULT
, Unreserve
) (THIS
) PURE
;
1239 } IDirect3DMaterial_VTable
,*LPDIRECT3DMATERIAL_VTABLE
;
1244 /* ********************************************************************
1246 ******************************************************************** */
1247 #define THIS LPDIRECT3DMATERIAL2 this
1248 typedef struct IDirect3DMaterial2_VTable
{
1249 /*** IUnknown methods ***/
1250 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1251 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1252 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1253 /*** IDirect3DMaterial2 methods ***/
1254 STDMETHOD(SetMaterial
) (THIS_ LPD3DMATERIAL
) PURE
;
1255 STDMETHOD(GetMaterial
) (THIS_ LPD3DMATERIAL
) PURE
;
1256 STDMETHOD(GetHandle
) (THIS_ LPDIRECT3DDEVICE2
, LPD3DMATERIALHANDLE
) PURE
;
1257 } IDirect3DMaterial2_VTable
,*LPDIRECT3DMATERIAL2_VTABLE
;
1259 struct IDirect3DMaterial2
{
1260 LPDIRECT3DMATERIAL2_VTABLE lpvtbl
;
1268 LPDIRECT3DDEVICE active_device1
;
1269 LPDIRECT3DDEVICE2 active_device2
;
1275 void (*activate
)(LPDIRECT3DMATERIAL2
this);
1280 /* ********************************************************************
1282 ******************************************************************** */
1283 #define THIS LPDIRECT3DTEXTURE this
1284 typedef struct IDirect3DTexture_VTable
{
1285 /*** IUnknown methods ***/
1286 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1287 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1288 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1289 /*** IDirect3DTexture methods ***/
1290 STDMETHOD(Initialize
) (THIS_ LPDIRECT3DDEVICE
, LPDIRECTDRAWSURFACE
) PURE
;
1291 STDMETHOD(GetHandle
) (THIS_ LPDIRECT3DDEVICE
, LPD3DTEXTUREHANDLE
) PURE
;
1292 STDMETHOD(PaletteChanged
) (THIS_ DWORD
, DWORD
) PURE
;
1293 STDMETHOD(Load
) (THIS_ LPDIRECT3DTEXTURE
) PURE
;
1294 STDMETHOD_(HRESULT
, Unload
) (THIS
) PURE
;
1295 } IDirect3DTexture_VTable
,*LPDIRECT3DTEXTURE_VTABLE
;
1297 /* The structure is the same as for Direct3DTexture2 */
1301 /* ********************************************************************
1303 ******************************************************************** */
1304 #define THIS LPDIRECT3DTEXTURE2 this
1305 typedef struct IDirect3DTexture2_VTable
{
1306 /*** IUnknown methods ***/
1307 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1308 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1309 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1310 /*** IDirect3DTexture2 methods ***/
1311 STDMETHOD(GetHandle
) (THIS_ LPDIRECT3DDEVICE2
, LPD3DTEXTUREHANDLE
) PURE
;
1312 STDMETHOD(PaletteChanged
) (THIS_ DWORD
, DWORD
) PURE
;
1313 STDMETHOD(Load
) (THIS_ LPDIRECT3DTEXTURE2
) PURE
;
1314 } IDirect3DTexture2_VTable
,*LPDIRECT3DTEXTURE2_VTABLE
;
1316 struct IDirect3DTexture2
{
1317 LPDIRECT3DTEXTURE2_VTABLE lpvtbl
;
1320 void *D3Ddevice
; /* I put (void *) to use the same pointer for both
1321 Direct3D and Direct3D2 */
1325 LPDIRECTDRAWSURFACE4 surface
;
1331 /* ********************************************************************
1333 ******************************************************************** */
1334 #define THIS LPDIRECT3DVIEWPORT this
1335 typedef struct IDirect3Viewport_VTable
{
1336 /*** IUnknown methods ***/
1337 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1338 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1339 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1340 /*** IDirect3DViewport methods ***/
1341 STDMETHOD(Initialize
) (THIS_ LPDIRECT3D
) PURE
;
1342 STDMETHOD(GetViewport
) (THIS_ LPD3DVIEWPORT
) PURE
;
1343 STDMETHOD(SetViewport
) (THIS_ LPD3DVIEWPORT
) PURE
;
1344 STDMETHOD(TransformVertices
) (THIS_ DWORD
, LPD3DTRANSFORMDATA
, DWORD
, LPDWORD
) PURE
;
1345 STDMETHOD(LightElements
) (THIS_ DWORD
, LPD3DLIGHTDATA
) PURE
;
1346 STDMETHOD(SetBackground
) (THIS_ D3DMATERIALHANDLE
) PURE
;
1347 STDMETHOD(GetBackground
) (THIS_ LPD3DMATERIALHANDLE
, LPBOOL32
) PURE
;
1348 STDMETHOD(SetBackgroundDepth
) (THIS_ LPDIRECTDRAWSURFACE
) PURE
;
1349 STDMETHOD(GetBackgroundDepth
) (THIS_ LPDIRECTDRAWSURFACE
*, LPBOOL32
) PURE
;
1350 STDMETHOD(Clear
) (THIS_ DWORD
, LPD3DRECT
, DWORD
) PURE
;
1351 STDMETHOD(AddLight
) (THIS_ LPDIRECT3DLIGHT
) PURE
;
1352 STDMETHOD(DeleteLight
) (THIS_ LPDIRECT3DLIGHT
) PURE
;
1353 STDMETHOD(NextLight
) (THIS_ LPDIRECT3DLIGHT
, LPDIRECT3DLIGHT
*, DWORD
) PURE
;
1354 } IDirect3DViewport_VTable
,*LPDIRECT3DVIEWPORT_VTABLE
;
1359 /* ********************************************************************
1361 ******************************************************************** */
1362 #define THIS LPDIRECT3DVIEWPORT2 this
1363 typedef struct IDirect3Viewport2_VTable
{
1364 /*** IUnknown methods ***/
1365 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1366 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1367 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1368 /*** IDirect3DViewport methods ***/
1369 STDMETHOD(Initialize
) (THIS_ LPDIRECT3D
) PURE
;
1370 STDMETHOD(GetViewport
) (THIS_ LPD3DVIEWPORT
) PURE
;
1371 STDMETHOD(SetViewport
) (THIS_ LPD3DVIEWPORT
) PURE
;
1372 STDMETHOD(TransformVertices
) (THIS_ DWORD
, LPD3DTRANSFORMDATA
, DWORD
, LPDWORD
) PURE
;
1373 STDMETHOD(LightElements
) (THIS_ DWORD
, LPD3DLIGHTDATA
) PURE
;
1374 STDMETHOD(SetBackground
) (THIS_ D3DMATERIALHANDLE
) PURE
;
1375 STDMETHOD(GetBackground
) (THIS_ LPD3DMATERIALHANDLE
, LPBOOL32
) PURE
;
1376 STDMETHOD(SetBackgroundDepth
) (THIS_ LPDIRECTDRAWSURFACE
) PURE
;
1377 STDMETHOD(GetBackgroundDepth
) (THIS_ LPDIRECTDRAWSURFACE
*, LPBOOL32
) PURE
;
1378 STDMETHOD(Clear
) (THIS_ DWORD
, LPD3DRECT
, DWORD
) PURE
;
1379 STDMETHOD(AddLight
) (THIS_ LPDIRECT3DLIGHT
) PURE
;
1380 STDMETHOD(DeleteLight
) (THIS_ LPDIRECT3DLIGHT
) PURE
;
1381 STDMETHOD(NextLight
) (THIS_ LPDIRECT3DLIGHT
, LPDIRECT3DLIGHT
*, DWORD
) PURE
;
1382 /*** IDirect3DViewport2 methods ***/
1383 STDMETHOD(GetViewport2
) (THIS_ LPD3DVIEWPORT2
) PURE
;
1384 STDMETHOD(SetViewport2
) (THIS_ LPD3DVIEWPORT2
) PURE
;
1385 } IDirect3DViewport2_VTable
,*LPDIRECT3DVIEWPORT2_VTABLE
;
1387 struct IDirect3DViewport2
{
1388 LPDIRECT3DVIEWPORT2_VTABLE lpvtbl
;
1395 /* If this viewport is active for one device, put the device here */
1397 LPDIRECT3DDEVICE active_device1
;
1398 LPDIRECT3DDEVICE2 active_device2
;
1408 /* Activation function */
1409 void (*activate
)(THIS
);
1411 /* Field used to chain viewports together */
1412 LPDIRECT3DVIEWPORT2 next
;
1415 LPDIRECT3DLIGHT lights
;
1425 /* ********************************************************************
1426 Direct3DExecuteBuffer
1427 ******************************************************************** */
1428 #define THIS LPDIRECT3DEXECUTEBUFFER this
1429 typedef struct IDirect3DExecuteBuffer_VTable
{
1430 /*** IUnknown methods ***/
1431 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1432 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1433 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1434 /*** IDirect3DExecuteBuffer methods ***/
1435 STDMETHOD(Initialize
) (THIS_ LPDIRECT3DDEVICE
, LPD3DEXECUTEBUFFERDESC
) PURE
;
1436 STDMETHOD(Lock
) (THIS_ LPD3DEXECUTEBUFFERDESC
) PURE
;
1437 STDMETHOD_(HRESULT
, Unlock
) (THIS
) PURE
;
1438 STDMETHOD(SetExecuteData
) (THIS_ LPD3DEXECUTEDATA
) PURE
;
1439 STDMETHOD(GetExecuteData
) (THIS_ LPD3DEXECUTEDATA
) PURE
;
1440 STDMETHOD(Validate
) (THIS_ LPDWORD
, LPD3DVALIDATECALLBACK
, LPVOID
, DWORD
) PURE
;
1441 STDMETHOD(Optimize
) (THIS_ DWORD
) PURE
;
1442 } *LPDIRECT3DEXECUTEBUFFER_VTABLE
,IDirect3DExecuteBuffer_VTable
;
1444 struct IDirect3DExecuteBuffer
{
1445 LPDIRECT3DEXECUTEBUFFER_VTABLE lpvtbl
;
1448 LPDIRECT3DDEVICE d3ddev
;
1450 D3DEXECUTEBUFFERDESC desc
;
1451 D3DEXECUTEDATA data
;
1453 /* This buffer will store the transformed vertices */
1455 D3DVERTEXTYPE vertex_type
;
1457 /* This flags is set to TRUE if we allocated ourselves the
1461 void (*execute
)(LPDIRECT3DEXECUTEBUFFER
this,
1462 LPDIRECT3DDEVICE dev
,
1463 LPDIRECT3DVIEWPORT vp
);
1468 /* ********************************************************************
1470 ******************************************************************** */
1471 #define THIS LPDIRECT3DDEVICE this
1472 typedef struct IDirect3DDevice_VTable
{
1473 /*** IUnknown methods ***/
1474 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1475 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1476 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1477 /*** IDirect3DDevice methods ***/
1478 STDMETHOD(Initialize
) (THIS_ LPDIRECT3D
, LPGUID
, LPD3DDEVICEDESC
) PURE
;
1479 STDMETHOD(GetCaps
) (THIS_ LPD3DDEVICEDESC
, LPD3DDEVICEDESC
) PURE
;
1480 STDMETHOD(SwapTextureHandles
) (THIS_ LPDIRECT3DTEXTURE
, LPDIRECT3DTEXTURE
) PURE
;
1481 STDMETHOD(CreateExecuteBuffer
) (THIS_ LPD3DEXECUTEBUFFERDESC
, LPDIRECT3DEXECUTEBUFFER
*, IUnknown
*) PURE
;
1482 STDMETHOD(GetStats
) (THIS_ LPD3DSTATS
) PURE
;
1483 STDMETHOD(Execute
) (THIS_ LPDIRECT3DEXECUTEBUFFER
, LPDIRECT3DVIEWPORT
, DWORD
) PURE
;
1484 STDMETHOD(AddViewport
) (THIS_ LPDIRECT3DVIEWPORT
) PURE
;
1485 STDMETHOD(DeleteViewport
) (THIS_ LPDIRECT3DVIEWPORT
) PURE
;
1486 STDMETHOD(NextViewport
) (THIS_ LPDIRECT3DVIEWPORT
, LPDIRECT3DVIEWPORT
*, DWORD
) PURE
;
1487 STDMETHOD(Pick
) (THIS_ LPDIRECT3DEXECUTEBUFFER
, LPDIRECT3DVIEWPORT
, DWORD
, LPD3DRECT
) PURE
;
1488 STDMETHOD(GetPickRecords
)(THIS_ LPDWORD
, LPD3DPICKRECORD
) PURE
;
1489 STDMETHOD(EnumTextureFormats
) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK
, LPVOID
) PURE
;
1490 STDMETHOD(CreateMatrix
) (THIS_ LPD3DMATRIXHANDLE
) PURE
;
1491 STDMETHOD(SetMatrix
) (THIS_ D3DMATRIXHANDLE
, const LPD3DMATRIX
) PURE
;
1492 STDMETHOD(GetMatrix
) (THIS_ D3DMATRIXHANDLE
, LPD3DMATRIX
) PURE
;
1493 STDMETHOD(DeleteMatrix
) (THIS_ D3DMATRIXHANDLE
) PURE
;
1494 STDMETHOD_(HRESULT
, BeginScene
) (THIS
) PURE
;
1495 STDMETHOD_(HRESULT
, EndScene
) (THIS
) PURE
;
1496 STDMETHOD(GetDirect3D
) (THIS_ LPDIRECT3D
*) PURE
;
1497 } *LPDIRECT3DDEVICE_VTABLE
,IDirect3DDevice_VTable
;
1499 struct IDirect3DDevice
{
1500 /* This are the fields common to all Direct3DDevice implementations */
1501 LPDIRECT3DDEVICE_VTABLE lpvtbl
;
1505 LPDIRECTDRAWSURFACE surface
;
1507 LPDIRECT3DVIEWPORT viewport_list
;
1508 LPDIRECT3DVIEWPORT current_viewport
;
1510 void (*set_context
)(THIS
) ;
1515 /* ********************************************************************
1517 ******************************************************************** */
1518 #define THIS LPDIRECT3DDEVICE2 this
1519 typedef struct IDirect3DDevice2_VTable
{
1520 /*** IUnknown methods ***/
1521 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
1522 STDMETHOD_(ULONG
, AddRef
) (THIS
) PURE
;
1523 STDMETHOD_(ULONG
, Release
) (THIS
) PURE
;
1524 /*** IDirect3DDevice2 methods ***/
1525 STDMETHOD(GetCaps
) (THIS_ LPD3DDEVICEDESC
, LPD3DDEVICEDESC
) PURE
;
1526 STDMETHOD(SwapTextureHandles
) (THIS_ LPDIRECT3DTEXTURE2
, LPDIRECT3DTEXTURE2
) PURE
;
1527 STDMETHOD(GetStats
) (THIS_ LPD3DSTATS
) PURE
;
1528 STDMETHOD(AddViewport
) (THIS_ LPDIRECT3DVIEWPORT2
) PURE
;
1529 STDMETHOD(DeleteViewport
) (THIS_ LPDIRECT3DVIEWPORT2
) PURE
;
1530 STDMETHOD(NextViewport
) (THIS_ LPDIRECT3DVIEWPORT2
, LPDIRECT3DVIEWPORT2
*, DWORD
) PURE
;
1531 STDMETHOD(EnumTextureFormats
) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK
, LPVOID
) PURE
;
1532 STDMETHOD_(HRESULT
, BeginScene
) (THIS
) PURE
;
1533 STDMETHOD_(HRESULT
, EndScene
) (THIS
) PURE
;
1534 STDMETHOD(GetDirect3D
) (THIS_ LPDIRECT3D2
*) PURE
;
1536 /*** DrawPrimitive API ***/
1537 STDMETHOD(SetCurrentViewport
) (THIS_ LPDIRECT3DVIEWPORT2
) PURE
;
1538 STDMETHOD(GetCurrentViewport
) (THIS_ LPDIRECT3DVIEWPORT2
*) PURE
;
1540 STDMETHOD(SetRenderTarget
) (THIS_ LPDIRECTDRAWSURFACE
, DWORD
) PURE
;
1541 STDMETHOD(GetRenderTarget
) (THIS_ LPDIRECTDRAWSURFACE
*) PURE
;
1543 STDMETHOD(Begin
) (THIS_ D3DPRIMITIVETYPE
, D3DVERTEXTYPE
, DWORD
) PURE
;
1544 STDMETHOD(BeginIndexed
) (THIS_ D3DPRIMITIVETYPE
, D3DVERTEXTYPE
, LPVOID
, DWORD
, DWORD
) PURE
;
1545 STDMETHOD(Vertex
) (THIS_ LPVOID
) PURE
;
1546 STDMETHOD(Index
) (THIS_ WORD
) PURE
;
1547 STDMETHOD(End
) (THIS_ DWORD
) PURE
;
1549 STDMETHOD(GetRenderState
) (THIS_ D3DRENDERSTATETYPE
, LPDWORD
) PURE
;
1550 STDMETHOD(SetRenderState
) (THIS_ D3DRENDERSTATETYPE
, DWORD
) PURE
;
1551 STDMETHOD(GetLightState
) (THIS_ D3DLIGHTSTATETYPE
, LPDWORD
) PURE
;
1552 STDMETHOD(SetLightState
) (THIS_ D3DLIGHTSTATETYPE
, DWORD
) PURE
;
1553 STDMETHOD(SetTransform
) (THIS_ D3DTRANSFORMSTATETYPE
, LPD3DMATRIX
) PURE
;
1554 STDMETHOD(GetTransform
) (THIS_ D3DTRANSFORMSTATETYPE
, LPD3DMATRIX
) PURE
;
1555 STDMETHOD(MultiplyTransform
) (THIS_ D3DTRANSFORMSTATETYPE
, LPD3DMATRIX
) PURE
;
1557 STDMETHOD(DrawPrimitive
) (THIS_ D3DPRIMITIVETYPE
, D3DVERTEXTYPE
, LPVOID
, DWORD
, DWORD
) PURE
;
1558 STDMETHOD(DrawIndexedPrimitive
) (THIS_ D3DPRIMITIVETYPE
, D3DVERTEXTYPE
, LPVOID
, DWORD
, LPWORD
, DWORD
, DWORD
) PURE
;
1560 STDMETHOD(SetClipStatus
) (THIS_ LPD3DCLIPSTATUS
) PURE
;
1561 STDMETHOD(GetClipStatus
) (THIS_ LPD3DCLIPSTATUS
) PURE
;
1562 } *LPDIRECT3DDEVICE2_VTABLE
,IDirect3DDevice2_VTable
;
1564 struct IDirect3DDevice2
{
1565 /* This are the fields common to all Direct3DDevice2 implementations */
1566 LPDIRECT3DDEVICE2_VTABLE lpvtbl
;
1570 LPDIRECTDRAWSURFACE surface
;
1572 LPDIRECT3DVIEWPORT2 viewport_list
;
1573 LPDIRECT3DVIEWPORT2 current_viewport
;
1575 void (*set_context
)(THIS
) ;