Compile fix if HAVE_OSS is not defined.
[wine/multimedia.git] / include / d3dtypes.h
blob955a5901d7ccb8c356b704be484c438c8b853887
1 /* FIXME: Need to add C++ code for certain structs for headers - this is going to be a problem
2 if WINE continues to only use C code - I suppose that we could always inline in
3 the header file to get around that little problem... */
4 /* FIXME: We need to implement versioning on everything directx 5 and up if these headers
5 are going to be generically useful for directx stuff */
7 #ifndef __WINE_D3DTYPES_H
8 #define __WINE_D3DTYPES_H
10 /* #include <windows.h> FIXME: Need to include for compatibility. Inclusion caused compile fail */
12 #include <float.h>
13 #include "ddraw.h"
15 #define D3DVALP(val, prec) ((float)(val))
16 #define D3DVAL(val) ((float)(val))
17 typedef float D3DVALUE,*LPD3DVALUE;
18 #define D3DDivide(a, b) (float)((double) (a) / (double) (b))
19 #define D3DMultiply(a, b) ((a) * (b))
21 typedef LONG D3DFIXED;
24 #ifndef RGB_MAKE
25 #define CI_GETALPHA(ci) ((ci) >> 24)
26 #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
27 #define CI_GETFRACTION(ci) ((ci) & 0xff)
28 #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
29 #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
30 #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
32 #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
33 #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
34 #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
35 #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
36 #define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
38 #define D3DRGB(r, g, b) \
39 (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
40 #define D3DRGBA(r, g, b, a) \
41 ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
42 | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
45 #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
46 #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
47 #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
48 #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
49 #define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b)))
50 #define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff))
51 #define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000))
53 #endif
55 #define D3DENUMRET_CANCEL DDENUMRET_CANCEL
56 #define D3DENUMRET_OK DDENUMRET_OK
58 typedef HRESULT CALLBACK (*LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
59 typedef HRESULT CALLBACK (*LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
60 typedef HRESULT CALLBACK (*LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
62 typedef DWORD D3DCOLOR, *LPD3DCOLOR;
64 typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
65 typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
66 typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
68 typedef struct _D3DCOLORVALUE {
69 union {
70 D3DVALUE r;
71 D3DVALUE dvR;
72 } DUMMYUNIONNAME1;
73 union {
74 D3DVALUE g;
75 D3DVALUE dvG;
76 } DUMMYUNIONNAME2;
77 union {
78 D3DVALUE b;
79 D3DVALUE dvB;
80 } DUMMYUNIONNAME3;
81 union {
82 D3DVALUE a;
83 D3DVALUE dvA;
84 } DUMMYUNIONNAME4;
85 } D3DCOLORVALUE,*LPD3DCOLORVALUE;
87 typedef struct _D3DRECT {
88 union {
89 LONG x1;
90 LONG lX1;
91 } DUMMYUNIONNAME1;
92 union {
93 LONG y1;
94 LONG lY1;
95 } DUMMYUNIONNAME2;
96 union {
97 LONG x2;
98 LONG lX2;
99 } DUMMYUNIONNAME3;
100 union {
101 LONG y2;
102 LONG lY2;
103 } DUMMYUNIONNAME4;
104 } D3DRECT, *LPD3DRECT;
106 typedef struct _D3DVECTOR {
107 union {
108 D3DVALUE x;
109 D3DVALUE dvX;
110 } DUMMYUNIONNAME1;
111 union {
112 D3DVALUE y;
113 D3DVALUE dvY;
114 } DUMMYUNIONNAME2;
115 union {
116 D3DVALUE z;
117 D3DVALUE dvZ;
118 } DUMMYUNIONNAME3;
119 #if defined(__cplusplus) && defined(D3D_OVERLOADS)
120 /* the definitions for these methods are in d3dvec.inl */
121 public:
122 /*** constructors ***/
123 _D3DVECTOR() {}
124 _D3DVECTOR(D3DVALUE f);
125 _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
126 _D3DVECTOR(const D3DVALUE f[3]);
128 /*** assignment operators ***/
129 _D3DVECTOR& operator += (const _D3DVECTOR& v);
130 _D3DVECTOR& operator -= (const _D3DVECTOR& v);
131 _D3DVECTOR& operator *= (const _D3DVECTOR& v);
132 _D3DVECTOR& operator /= (const _D3DVECTOR& v);
133 _D3DVECTOR& operator *= (D3DVALUE s);
134 _D3DVECTOR& operator /= (D3DVALUE s);
136 /*** binary operators ***/
137 friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
138 friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
140 friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
141 friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
142 friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
144 friend D3DVALUE SquareMagnitude(const _D3DVECTOR& v);
145 friend D3DVALUE Magnitude(const _D3DVECTOR& v);
147 friend _D3DVECTOR Normalize(const _D3DVECTOR& v);
149 friend D3DVALUE DotProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2);
150 friend _D3DVECTOR CrossProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2);
151 #endif
152 } D3DVECTOR,*LPD3DVECTOR;
154 typedef struct _D3DHVERTEX {
155 DWORD dwFlags;
156 union {
157 D3DVALUE hx;
158 D3DVALUE dvHX;
159 } DUMMYUNIONNAME1;
160 union {
161 D3DVALUE hy;
162 D3DVALUE dvHY;
163 } DUMMYUNIONNAME2;
164 union {
165 D3DVALUE hz;
166 D3DVALUE dvHZ;
167 } DUMMYUNIONNAME3;
168 } D3DHVERTEX, *LPD3DHVERTEX;
171 * Transformed/lit vertices
173 typedef struct {
174 union {
175 D3DVALUE sx;
176 D3DVALUE dvSX;
177 } DUMMYUNIONNAME1;
178 union {
179 D3DVALUE sy;
180 D3DVALUE dvSY;
181 } DUMMYUNIONNAME2;
182 union {
183 D3DVALUE sz;
184 D3DVALUE dvSZ;
185 } DUMMYUNIONNAME3;
186 union {
187 D3DVALUE rhw;
188 D3DVALUE dvRHW;
189 } DUMMYUNIONNAME4;
190 union {
191 D3DCOLOR color;
192 D3DCOLOR dcColor;
193 } DUMMYUNIONNAME5;
194 union {
195 D3DCOLOR specular;
196 D3DCOLOR dcSpecular;
197 } DUMMYUNIONNAME6;
198 union {
199 D3DVALUE tu;
200 D3DVALUE dvTU;
201 } DUMMYUNIONNAME7;
202 union {
203 D3DVALUE tv;
204 D3DVALUE dvTV;
205 } DUMMYUNIONNAME8;
206 /* There are C++ members associated with this class */
207 } D3DTLVERTEX, *LPD3DTLVERTEX;
209 typedef struct _D3DLVERTEX {
210 union {
211 D3DVALUE x;
212 D3DVALUE dvX;
213 } DUMMYUNIONNAME1;
214 union {
215 D3DVALUE y;
216 D3DVALUE dvY;
217 } DUMMYUNIONNAME2;
218 union {
219 D3DVALUE z;
220 D3DVALUE dvZ;
221 } DUMMYUNIONNAME3;
222 DWORD dwReserved;
223 union {
224 D3DCOLOR color;
225 D3DCOLOR dcColor;
226 } DUMMYUNIONNAME4;
227 union {
228 D3DCOLOR specular;
229 D3DCOLOR dcSpecular;
230 } DUMMYUNIONNAME5;
231 union {
232 D3DVALUE tu;
233 D3DVALUE dvTU;
234 } DUMMYUNIONNAME6;
235 union {
236 D3DVALUE tv;
237 D3DVALUE dvTV;
238 } DUMMYUNIONNAME7;
239 } D3DLVERTEX, *LPD3DLVERTEX;
241 typedef struct _D3DVERTEX {
242 union {
243 D3DVALUE x;
244 D3DVALUE dvX;
245 } DUMMYUNIONNAME1;
246 union {
247 D3DVALUE y;
248 D3DVALUE dvY;
249 } DUMMYUNIONNAME2;
250 union {
251 D3DVALUE z;
252 D3DVALUE dvZ;
253 } DUMMYUNIONNAME3;
254 union {
255 D3DVALUE nx;
256 D3DVALUE dvNX;
257 } DUMMYUNIONNAME4;
258 union {
259 D3DVALUE ny;
260 D3DVALUE dvNY;
261 } DUMMYUNIONNAME5;
262 union {
263 D3DVALUE nz;
264 D3DVALUE dvNZ;
265 } DUMMYUNIONNAME6;
266 union {
267 D3DVALUE tu;
268 D3DVALUE dvTU;
269 } DUMMYUNIONNAME7;
270 union {
271 D3DVALUE tv;
272 D3DVALUE dvTV;
273 } DUMMYUNIONNAME8;
274 /* FIXME: Some C++ stuff to go here */
275 } D3DVERTEX, *LPD3DVERTEX;
277 typedef struct {
278 D3DVALUE _11, _12, _13, _14;
279 D3DVALUE _21, _22, _23, _24;
280 D3DVALUE _31, _32, _33, _34;
281 D3DVALUE _41, _42, _43, _44;
282 /* FIXME: Some C++ stuff here */
283 } D3DMATRIX, *LPD3DMATRIX;
285 #if defined(__cplusplus) && defined(D3D_OVERLOADS)
286 #include "d3dvec.inl"
287 #endif
289 typedef struct _D3DVIEWPORT {
290 DWORD dwSize;
291 DWORD dwX;
292 DWORD dwY;
293 DWORD dwWidth;
294 DWORD dwHeight;
295 D3DVALUE dvScaleX;
296 D3DVALUE dvScaleY;
297 D3DVALUE dvMaxX;
298 D3DVALUE dvMaxY;
299 D3DVALUE dvMinZ;
300 D3DVALUE dvMaxZ;
301 } D3DVIEWPORT, *LPD3DVIEWPORT;
303 typedef struct _D3DVIEWPORT2 {
304 DWORD dwSize;
305 DWORD dwX;
306 DWORD dwY;
307 DWORD dwWidth;
308 DWORD dwHeight;
309 D3DVALUE dvClipX;
310 D3DVALUE dvClipY;
311 D3DVALUE dvClipWidth;
312 D3DVALUE dvClipHeight;
313 D3DVALUE dvMinZ;
314 D3DVALUE dvMaxZ;
315 } D3DVIEWPORT2, *LPD3DVIEWPORT2;
317 typedef struct _D3DVIEWPORT7 {
318 DWORD dwX;
319 DWORD dwY;
320 DWORD dwWidth;
321 DWORD dwHeight;
322 D3DVALUE dvMinZ;
323 D3DVALUE dvMaxZ;
324 } D3DVIEWPORT7, *LPD3DVIEWPORT7;
326 #define D3DMAXUSERCLIPPLANES 32
328 #define D3DCLIPPLANE0 (1 << 0)
329 #define D3DCLIPPLANE1 (1 << 1)
330 #define D3DCLIPPLANE2 (1 << 2)
331 #define D3DCLIPPLANE3 (1 << 3)
332 #define D3DCLIPPLANE4 (1 << 4)
333 #define D3DCLIPPLANE5 (1 << 5)
335 #define D3DCLIP_LEFT 0x00000001
336 #define D3DCLIP_RIGHT 0x00000002
337 #define D3DCLIP_TOP 0x00000004
338 #define D3DCLIP_BOTTOM 0x00000008
339 #define D3DCLIP_FRONT 0x00000010
340 #define D3DCLIP_BACK 0x00000020
341 #define D3DCLIP_GEN0 0x00000040
342 #define D3DCLIP_GEN1 0x00000080
343 #define D3DCLIP_GEN2 0x00000100
344 #define D3DCLIP_GEN3 0x00000200
345 #define D3DCLIP_GEN4 0x00000400
346 #define D3DCLIP_GEN5 0x00000800
348 #define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT
349 #define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT
350 #define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP
351 #define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM
352 #define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT
353 #define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK
354 #define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0
355 #define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1
356 #define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2
357 #define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3
358 #define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4
359 #define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5
361 #define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000
362 #define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000
363 #define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000
364 #define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000
365 #define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000
366 #define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000
367 #define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000
368 #define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000
369 #define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000
370 #define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000
371 #define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000
372 #define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000
373 #define D3DSTATUS_ZNOTVISIBLE 0x01000000
375 #define D3DSTATUS_CLIPUNIONALL ( \
376 D3DSTATUS_CLIPUNIONLEFT | \
377 D3DSTATUS_CLIPUNIONRIGHT | \
378 D3DSTATUS_CLIPUNIONTOP | \
379 D3DSTATUS_CLIPUNIONBOTTOM | \
380 D3DSTATUS_CLIPUNIONFRONT | \
381 D3DSTATUS_CLIPUNIONBACK | \
382 D3DSTATUS_CLIPUNIONGEN0 | \
383 D3DSTATUS_CLIPUNIONGEN1 | \
384 D3DSTATUS_CLIPUNIONGEN2 | \
385 D3DSTATUS_CLIPUNIONGEN3 | \
386 D3DSTATUS_CLIPUNIONGEN4 | \
387 D3DSTATUS_CLIPUNIONGEN5 \
390 #define D3DSTATUS_CLIPINTERSECTIONALL ( \
391 D3DSTATUS_CLIPINTERSECTIONLEFT | \
392 D3DSTATUS_CLIPINTERSECTIONRIGHT | \
393 D3DSTATUS_CLIPINTERSECTIONTOP | \
394 D3DSTATUS_CLIPINTERSECTIONBOTTOM | \
395 D3DSTATUS_CLIPINTERSECTIONFRONT | \
396 D3DSTATUS_CLIPINTERSECTIONBACK | \
397 D3DSTATUS_CLIPINTERSECTIONGEN0 | \
398 D3DSTATUS_CLIPINTERSECTIONGEN1 | \
399 D3DSTATUS_CLIPINTERSECTIONGEN2 | \
400 D3DSTATUS_CLIPINTERSECTIONGEN3 | \
401 D3DSTATUS_CLIPINTERSECTIONGEN4 | \
402 D3DSTATUS_CLIPINTERSECTIONGEN5 \
405 #define D3DSTATUS_DEFAULT ( \
406 D3DSTATUS_CLIPINTERSECTIONALL | \
407 D3DSTATUS_ZNOTVISIBLE)
409 #define D3DTRANSFORM_CLIPPED 0x00000001
410 #define D3DTRANSFORM_UNCLIPPED 0x00000002
412 typedef struct _D3DTRANSFORMDATA {
413 DWORD dwSize;
414 LPVOID lpIn;
415 DWORD dwInSize;
416 LPVOID lpOut;
417 DWORD dwOutSize;
418 LPD3DHVERTEX lpHOut;
419 DWORD dwClip;
420 DWORD dwClipIntersection;
421 DWORD dwClipUnion;
422 D3DRECT drExtent;
423 } D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
425 typedef struct _D3DLIGHTINGELEMENT {
426 D3DVECTOR dvPosition;
427 D3DVECTOR dvNormal;
428 } D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
430 typedef struct _D3DMATERIAL {
431 DWORD dwSize;
432 union {
433 D3DCOLORVALUE diffuse;
434 D3DCOLORVALUE dcvDiffuse;
435 } DUMMYUNIONNAME;
436 union {
437 D3DCOLORVALUE ambient;
438 D3DCOLORVALUE dcvAmbient;
439 } DUMMYUNIONNAME1;
440 union {
441 D3DCOLORVALUE specular;
442 D3DCOLORVALUE dcvSpecular;
443 } DUMMYUNIONNAME2;
444 union {
445 D3DCOLORVALUE emissive;
446 D3DCOLORVALUE dcvEmissive;
447 } DUMMYUNIONNAME3;
448 union {
449 D3DVALUE power;
450 D3DVALUE dvPower;
451 } DUMMYUNIONNAME4;
452 D3DTEXTUREHANDLE hTexture;
453 DWORD dwRampSize;
454 } D3DMATERIAL, *LPD3DMATERIAL;
456 typedef struct _D3DMATERIAL7 {
457 union {
458 D3DCOLORVALUE diffuse;
459 D3DCOLORVALUE dcvDiffuse;
460 } DUMMYUNIONNAME;
461 union {
462 D3DCOLORVALUE ambient;
463 D3DCOLORVALUE dcvAmbient;
464 } DUMMYUNIONNAME1;
465 union {
466 D3DCOLORVALUE specular;
467 D3DCOLORVALUE dcvSpecular;
468 } DUMMYUNIONNAME2;
469 union {
470 D3DCOLORVALUE emissive;
471 D3DCOLORVALUE dcvEmissive;
472 } DUMMYUNIONNAME3;
473 union {
474 D3DVALUE power;
475 D3DVALUE dvPower;
476 } DUMMYUNIONNAME4;
477 } D3DMATERIAL7, *LPD3DMATERIAL7;
479 typedef enum {
480 D3DLIGHT_POINT = 1,
481 D3DLIGHT_SPOT = 2,
482 D3DLIGHT_DIRECTIONAL = 3,
483 D3DLIGHT_PARALLELPOINT = 4,
484 D3DLIGHT_GLSPOT = 5,
485 D3DLIGHT_FORCE_DWORD = 0x7fffffff
486 } D3DLIGHTTYPE;
488 typedef struct _D3DLIGHT {
489 DWORD dwSize;
490 D3DLIGHTTYPE dltType;
491 D3DCOLORVALUE dcvColor;
492 D3DVECTOR dvPosition;
493 D3DVECTOR dvDirection;
494 D3DVALUE dvRange;
495 D3DVALUE dvFalloff;
496 D3DVALUE dvAttenuation0;
497 D3DVALUE dvAttenuation1;
498 D3DVALUE dvAttenuation2;
499 D3DVALUE dvTheta;
500 D3DVALUE dvPhi;
501 } D3DLIGHT,*LPD3DLIGHT;
503 typedef struct _D3DLIGHT7 {
504 D3DLIGHTTYPE dltType;
505 D3DCOLORVALUE dcvDiffuse;
506 D3DCOLORVALUE dcvSpecular;
507 D3DCOLORVALUE dcvAmbient;
508 D3DVECTOR dvPosition;
509 D3DVECTOR dvDirection;
510 D3DVALUE dvRange;
511 D3DVALUE dvFalloff;
512 D3DVALUE dvAttenuation0;
513 D3DVALUE dvAttenuation1;
514 D3DVALUE dvAttenuation2;
515 D3DVALUE dvTheta;
516 D3DVALUE dvPhi;
517 } D3DLIGHT7, *LPD3DLIGHT7;
519 #define D3DLIGHT_ACTIVE 0x00000001
520 #define D3DLIGHT_NO_SPECULAR 0x00000002
521 #define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) /* 0x3 */
523 #define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
525 typedef struct _D3DLIGHT2 {
526 DWORD dwSize;
527 D3DLIGHTTYPE dltType;
528 D3DCOLORVALUE dcvColor;
529 D3DVECTOR dvPosition;
530 D3DVECTOR dvDirection;
531 D3DVALUE dvRange;
532 D3DVALUE dvFalloff;
533 D3DVALUE dvAttenuation0;
534 D3DVALUE dvAttenuation1;
535 D3DVALUE dvAttenuation2;
536 D3DVALUE dvTheta;
537 D3DVALUE dvPhi;
538 DWORD dwFlags;
539 } D3DLIGHT2, *LPD3DLIGHT2;
541 typedef struct _D3DLIGHTDATA {
542 DWORD dwSize;
543 LPD3DLIGHTINGELEMENT lpIn;
544 DWORD dwInSize;
545 LPD3DTLVERTEX lpOut;
546 DWORD dwOutSize;
547 } D3DLIGHTDATA, *LPD3DLIGHTDATA;
549 #define D3DCOLOR_MONO 1
550 #define D3DCOLOR_RGB 2
552 typedef DWORD D3DCOLORMODEL;
555 #define D3DCLEAR_TARGET 0x00000001
556 #define D3DCLEAR_ZBUFFER 0x00000002
557 #define D3DCLEAR_STENCIL 0x00000004
559 typedef enum _D3DOPCODE {
560 D3DOP_POINT = 1,
561 D3DOP_LINE = 2,
562 D3DOP_TRIANGLE = 3,
563 D3DOP_MATRIXLOAD = 4,
564 D3DOP_MATRIXMULTIPLY = 5,
565 D3DOP_STATETRANSFORM = 6,
566 D3DOP_STATELIGHT = 7,
567 D3DOP_STATERENDER = 8,
568 D3DOP_PROCESSVERTICES = 9,
569 D3DOP_TEXTURELOAD = 10,
570 D3DOP_EXIT = 11,
571 D3DOP_BRANCHFORWARD = 12,
572 D3DOP_SPAN = 13,
573 D3DOP_SETSTATUS = 14,
575 D3DOP_FORCE_DWORD = 0x7fffffff
576 } D3DOPCODE;
578 typedef struct _D3DINSTRUCTION {
579 BYTE bOpcode;
580 BYTE bSize;
581 WORD wCount;
582 } D3DINSTRUCTION, *LPD3DINSTRUCTION;
584 typedef struct _D3DTEXTURELOAD {
585 D3DTEXTUREHANDLE hDestTexture;
586 D3DTEXTUREHANDLE hSrcTexture;
587 } D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
589 typedef struct _D3DPICKRECORD {
590 BYTE bOpcode;
591 BYTE bPad;
592 DWORD dwOffset;
593 D3DVALUE dvZ;
594 } D3DPICKRECORD, *LPD3DPICKRECORD;
596 typedef enum {
597 D3DSHADE_FLAT = 1,
598 D3DSHADE_GOURAUD = 2,
599 D3DSHADE_PHONG = 3,
600 D3DSHADE_FORCE_DWORD = 0x7fffffff
601 } D3DSHADEMODE;
603 typedef enum {
604 D3DFILL_POINT = 1,
605 D3DFILL_WIREFRAME = 2,
606 D3DFILL_SOLID = 3,
607 D3DFILL_FORCE_DWORD = 0x7fffffff
608 } D3DFILLMODE;
610 typedef struct _D3DLINEPATTERN {
611 WORD wRepeatFactor;
612 WORD wLinePattern;
613 } D3DLINEPATTERN;
615 typedef enum {
616 D3DFILTER_NEAREST = 1,
617 D3DFILTER_LINEAR = 2,
618 D3DFILTER_MIPNEAREST = 3,
619 D3DFILTER_MIPLINEAR = 4,
620 D3DFILTER_LINEARMIPNEAREST = 5,
621 D3DFILTER_LINEARMIPLINEAR = 6,
622 D3DFILTER_FORCE_DWORD = 0x7fffffff
623 } D3DTEXTUREFILTER;
625 typedef enum {
626 D3DBLEND_ZERO = 1,
627 D3DBLEND_ONE = 2,
628 D3DBLEND_SRCCOLOR = 3,
629 D3DBLEND_INVSRCCOLOR = 4,
630 D3DBLEND_SRCALPHA = 5,
631 D3DBLEND_INVSRCALPHA = 6,
632 D3DBLEND_DESTALPHA = 7,
633 D3DBLEND_INVDESTALPHA = 8,
634 D3DBLEND_DESTCOLOR = 9,
635 D3DBLEND_INVDESTCOLOR = 10,
636 D3DBLEND_SRCALPHASAT = 11,
637 D3DBLEND_BOTHSRCALPHA = 12,
638 D3DBLEND_BOTHINVSRCALPHA = 13,
639 D3DBLEND_FORCE_DWORD = 0x7fffffff
640 } D3DBLEND;
642 typedef enum {
643 D3DTBLEND_DECAL = 1,
644 D3DTBLEND_MODULATE = 2,
645 D3DTBLEND_DECALALPHA = 3,
646 D3DTBLEND_MODULATEALPHA = 4,
647 D3DTBLEND_DECALMASK = 5,
648 D3DTBLEND_MODULATEMASK = 6,
649 D3DTBLEND_COPY = 7,
650 D3DTBLEND_ADD = 8,
651 D3DTBLEND_FORCE_DWORD = 0x7fffffff
652 } D3DTEXTUREBLEND;
654 typedef enum _D3DTEXTUREADDRESS {
655 D3DTADDRESS_WRAP = 1,
656 D3DTADDRESS_MIRROR = 2,
657 D3DTADDRESS_CLAMP = 3,
658 D3DTADDRESS_BORDER = 4,
659 D3DTADDRESS_FORCE_DWORD = 0x7fffffff
660 } D3DTEXTUREADDRESS;
662 typedef enum {
663 D3DCULL_NONE = 1,
664 D3DCULL_CW = 2,
665 D3DCULL_CCW = 3,
666 D3DCULL_FORCE_DWORD = 0x7fffffff
667 } D3DCULL;
669 typedef enum {
670 D3DCMP_NEVER = 1,
671 D3DCMP_LESS = 2,
672 D3DCMP_EQUAL = 3,
673 D3DCMP_LESSEQUAL = 4,
674 D3DCMP_GREATER = 5,
675 D3DCMP_NOTEQUAL = 6,
676 D3DCMP_GREATEREQUAL = 7,
677 D3DCMP_ALWAYS = 8,
678 D3DCMP_FORCE_DWORD = 0x7fffffff
679 } D3DCMPFUNC;
681 typedef enum _D3DSTENCILOP {
682 D3DSTENCILOP_KEEP = 1,
683 D3DSTENCILOP_ZERO = 2,
684 D3DSTENCILOP_REPLACE = 3,
685 D3DSTENCILOP_INCRSAT = 4,
686 D3DSTENCILOP_DECRSAT = 5,
687 D3DSTENCILOP_INVERT = 6,
688 D3DSTENCILOP_INCR = 7,
689 D3DSTENCILOP_DECR = 8,
690 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
691 } D3DSTENCILOP;
693 typedef enum _D3DFOGMODE {
694 D3DFOG_NONE = 0,
695 D3DFOG_EXP = 1,
696 D3DFOG_EXP2 = 2,
697 D3DFOG_LINEAR = 3,
698 D3DFOG_FORCE_DWORD = 0x7fffffff
699 } D3DFOGMODE;
701 typedef enum _D3DZBUFFERTYPE {
702 D3DZB_FALSE = 0,
703 D3DZB_TRUE = 1,
704 D3DZB_USEW = 2,
705 D3DZB_FORCE_DWORD = 0x7fffffff
706 } D3DZBUFFERTYPE;
708 typedef enum _D3DANTIALIASMODE {
709 D3DANTIALIAS_NONE = 0,
710 D3DANTIALIAS_SORTDEPENDENT = 1,
711 D3DANTIALIAS_SORTINDEPENDENT = 2,
712 D3DANTIALIAS_FORCE_DWORD = 0x7fffffff
713 } D3DANTIALIASMODE;
715 typedef enum {
716 D3DVT_VERTEX = 1,
717 D3DVT_LVERTEX = 2,
718 D3DVT_TLVERTEX = 3,
719 D3DVT_FORCE_DWORD = 0x7fffffff
720 } D3DVERTEXTYPE;
722 typedef enum {
723 D3DPT_POINTLIST = 1,
724 D3DPT_LINELIST = 2,
725 D3DPT_LINESTRIP = 3,
726 D3DPT_TRIANGLELIST = 4,
727 D3DPT_TRIANGLESTRIP = 5,
728 D3DPT_TRIANGLEFAN = 6,
729 D3DPT_FORCE_DWORD = 0x7fffffff
730 } D3DPRIMITIVETYPE;
732 #define D3DSTATE_OVERRIDE_BIAS 256
734 #define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
736 typedef enum _D3DTRANSFORMSTATETYPE {
737 D3DTRANSFORMSTATE_WORLD = 1,
738 D3DTRANSFORMSTATE_VIEW = 2,
739 D3DTRANSFORMSTATE_PROJECTION = 3,
740 D3DTRANSFORMSTATE_WORLD1 = 4,
741 D3DTRANSFORMSTATE_WORLD2 = 5,
742 D3DTRANSFORMSTATE_WORLD3 = 6,
743 D3DTRANSFORMSTATE_TEXTURE0 = 16,
744 D3DTRANSFORMSTATE_TEXTURE1 = 17,
745 D3DTRANSFORMSTATE_TEXTURE2 = 18,
746 D3DTRANSFORMSTATE_TEXTURE3 = 19,
747 D3DTRANSFORMSTATE_TEXTURE4 = 20,
748 D3DTRANSFORMSTATE_TEXTURE5 = 21,
749 D3DTRANSFORMSTATE_TEXTURE6 = 22,
750 D3DTRANSFORMSTATE_TEXTURE7 = 23,
751 D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff
752 } D3DTRANSFORMSTATETYPE;
754 typedef enum {
755 D3DLIGHTSTATE_MATERIAL = 1,
756 D3DLIGHTSTATE_AMBIENT = 2,
757 D3DLIGHTSTATE_COLORMODEL = 3,
758 D3DLIGHTSTATE_FOGMODE = 4,
759 D3DLIGHTSTATE_FOGSTART = 5,
760 D3DLIGHTSTATE_FOGEND = 6,
761 D3DLIGHTSTATE_FOGDENSITY = 7,
762 D3DLIGHTSTATE_COLORVERTEX = 8,
763 D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff
764 } D3DLIGHTSTATETYPE;
766 typedef enum {
767 D3DRENDERSTATE_TEXTUREHANDLE = 1,
768 D3DRENDERSTATE_ANTIALIAS = 2,
769 D3DRENDERSTATE_TEXTUREADDRESS = 3,
770 D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,
771 D3DRENDERSTATE_WRAPU = 5,
772 D3DRENDERSTATE_WRAPV = 6,
773 D3DRENDERSTATE_ZENABLE = 7,
774 D3DRENDERSTATE_FILLMODE = 8,
775 D3DRENDERSTATE_SHADEMODE = 9,
776 D3DRENDERSTATE_LINEPATTERN = 10,
777 D3DRENDERSTATE_MONOENABLE = 11,
778 D3DRENDERSTATE_ROP2 = 12,
779 D3DRENDERSTATE_PLANEMASK = 13,
780 D3DRENDERSTATE_ZWRITEENABLE = 14,
781 D3DRENDERSTATE_ALPHATESTENABLE = 15,
782 D3DRENDERSTATE_LASTPIXEL = 16,
783 D3DRENDERSTATE_TEXTUREMAG = 17,
784 D3DRENDERSTATE_TEXTUREMIN = 18,
785 D3DRENDERSTATE_SRCBLEND = 19,
786 D3DRENDERSTATE_DESTBLEND = 20,
787 D3DRENDERSTATE_TEXTUREMAPBLEND = 21,
788 D3DRENDERSTATE_CULLMODE = 22,
789 D3DRENDERSTATE_ZFUNC = 23,
790 D3DRENDERSTATE_ALPHAREF = 24,
791 D3DRENDERSTATE_ALPHAFUNC = 25,
792 D3DRENDERSTATE_DITHERENABLE = 26,
793 D3DRENDERSTATE_ALPHABLENDENABLE = 27,
794 D3DRENDERSTATE_FOGENABLE = 28,
795 D3DRENDERSTATE_SPECULARENABLE = 29,
796 D3DRENDERSTATE_ZVISIBLE = 30,
797 D3DRENDERSTATE_SUBPIXEL = 31,
798 D3DRENDERSTATE_SUBPIXELX = 32,
799 D3DRENDERSTATE_STIPPLEDALPHA = 33,
800 D3DRENDERSTATE_FOGCOLOR = 34,
801 D3DRENDERSTATE_FOGTABLEMODE = 35,
802 D3DRENDERSTATE_FOGTABLESTART = 36,
803 D3DRENDERSTATE_FOGTABLEEND = 37,
804 D3DRENDERSTATE_FOGTABLEDENSITY = 38,
805 D3DRENDERSTATE_STIPPLEENABLE = 39,
806 D3DRENDERSTATE_EDGEANTIALIAS = 40,
807 D3DRENDERSTATE_COLORKEYENABLE = 41,
808 D3DRENDERSTATE_BORDERCOLOR = 43,
809 D3DRENDERSTATE_TEXTUREADDRESSU = 44,
810 D3DRENDERSTATE_TEXTUREADDRESSV = 45,
811 D3DRENDERSTATE_MIPMAPLODBIAS = 46,
812 D3DRENDERSTATE_ZBIAS = 47,
813 D3DRENDERSTATE_RANGEFOGENABLE = 48,
814 D3DRENDERSTATE_ANISOTROPY = 49,
815 D3DRENDERSTATE_FLUSHBATCH = 50,
817 D3DRENDERSTATE_STENCILENABLE = 52,
818 D3DRENDERSTATE_STENCILFAIL = 53,
819 D3DRENDERSTATE_STENCILZFAIL = 54,
820 D3DRENDERSTATE_STENCILPASS = 55,
821 D3DRENDERSTATE_STENCILFUNC = 56,
822 D3DRENDERSTATE_STENCILREF = 57,
823 D3DRENDERSTATE_STENCILMASK = 58,
824 D3DRENDERSTATE_STENCILWRITEMASK = 59,
825 D3DRENDERSTATE_TEXTUREFACTOR = 60,
827 D3DRENDERSTATE_STIPPLEPATTERN00 = 64,
828 D3DRENDERSTATE_STIPPLEPATTERN01 = 65,
829 D3DRENDERSTATE_STIPPLEPATTERN02 = 66,
830 D3DRENDERSTATE_STIPPLEPATTERN03 = 67,
831 D3DRENDERSTATE_STIPPLEPATTERN04 = 68,
832 D3DRENDERSTATE_STIPPLEPATTERN05 = 69,
833 D3DRENDERSTATE_STIPPLEPATTERN06 = 70,
834 D3DRENDERSTATE_STIPPLEPATTERN07 = 71,
835 D3DRENDERSTATE_STIPPLEPATTERN08 = 72,
836 D3DRENDERSTATE_STIPPLEPATTERN09 = 73,
837 D3DRENDERSTATE_STIPPLEPATTERN10 = 74,
838 D3DRENDERSTATE_STIPPLEPATTERN11 = 75,
839 D3DRENDERSTATE_STIPPLEPATTERN12 = 76,
840 D3DRENDERSTATE_STIPPLEPATTERN13 = 77,
841 D3DRENDERSTATE_STIPPLEPATTERN14 = 78,
842 D3DRENDERSTATE_STIPPLEPATTERN15 = 79,
843 D3DRENDERSTATE_STIPPLEPATTERN16 = 80,
844 D3DRENDERSTATE_STIPPLEPATTERN17 = 81,
845 D3DRENDERSTATE_STIPPLEPATTERN18 = 82,
846 D3DRENDERSTATE_STIPPLEPATTERN19 = 83,
847 D3DRENDERSTATE_STIPPLEPATTERN20 = 84,
848 D3DRENDERSTATE_STIPPLEPATTERN21 = 85,
849 D3DRENDERSTATE_STIPPLEPATTERN22 = 86,
850 D3DRENDERSTATE_STIPPLEPATTERN23 = 87,
851 D3DRENDERSTATE_STIPPLEPATTERN24 = 88,
852 D3DRENDERSTATE_STIPPLEPATTERN25 = 89,
853 D3DRENDERSTATE_STIPPLEPATTERN26 = 90,
854 D3DRENDERSTATE_STIPPLEPATTERN27 = 91,
855 D3DRENDERSTATE_STIPPLEPATTERN28 = 92,
856 D3DRENDERSTATE_STIPPLEPATTERN29 = 93,
857 D3DRENDERSTATE_STIPPLEPATTERN30 = 94,
858 D3DRENDERSTATE_STIPPLEPATTERN31 = 95,
860 D3DRENDERSTATE_WRAP0 = 128,
861 D3DRENDERSTATE_WRAP1 = 129,
862 D3DRENDERSTATE_WRAP2 = 130,
863 D3DRENDERSTATE_WRAP3 = 131,
864 D3DRENDERSTATE_WRAP4 = 132,
865 D3DRENDERSTATE_WRAP5 = 133,
866 D3DRENDERSTATE_WRAP6 = 134,
867 D3DRENDERSTATE_WRAP7 = 135,
868 D3DRENDERSTATE_CLIPPING = 136,
869 D3DRENDERSTATE_LIGHTING = 137,
870 D3DRENDERSTATE_EXTENTS = 138,
871 D3DRENDERSTATE_AMBIENT = 139,
872 D3DRENDERSTATE_FOGVERTEXMODE = 140,
873 D3DRENDERSTATE_COLORVERTEX = 141,
874 D3DRENDERSTATE_LOCALVIEWER = 142,
875 D3DRENDERSTATE_NORMALIZENORMALS = 143,
876 D3DRENDERSTATE_COLORKEYBLENDENABLE = 144,
877 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145,
878 D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146,
879 D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147,
880 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148,
881 D3DRENDERSTATE_VERTEXBLEND = 151,
882 D3DRENDERSTATE_CLIPPLANEENABLE = 152,
884 D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff
886 /* FIXME: We have some retired values that are being reused for DirectX 7 */
887 } D3DRENDERSTATETYPE;
889 typedef enum _D3DMATERIALCOLORSOURCE
891 D3DMCS_MATERIAL = 0,
892 D3DMCS_COLOR1 = 1,
893 D3DMCS_COLOR2 = 2,
894 D3DMCS_FORCE_DWORD = 0x7fffffff
895 } D3DMATERIALCOLORSOURCE;
897 #define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE
898 #define D3DRENDERSTATE_WRAPBIAS 128UL
899 #define D3DWRAP_U 0x00000001L
900 #define D3DWRAP_V 0x00000002L
902 #define D3DWRAPCOORD_0 0x00000001L
903 #define D3DWRAPCOORD_1 0x00000002L
904 #define D3DWRAPCOORD_2 0x00000004L
905 #define D3DWRAPCOORD_3 0x00000008L
907 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
909 typedef struct _D3DSTATE {
910 union {
911 D3DTRANSFORMSTATETYPE dtstTransformStateType;
912 D3DLIGHTSTATETYPE dlstLightStateType;
913 D3DRENDERSTATETYPE drstRenderStateType;
914 } DUMMYUNIONNAME1;
915 union {
916 DWORD dwArg[1];
917 D3DVALUE dvArg[1];
918 } DUMMYUNIONNAME2;
919 } D3DSTATE, *LPD3DSTATE;
921 typedef struct _D3DMATRIXLOAD {
922 D3DMATRIXHANDLE hDestMatrix;
923 D3DMATRIXHANDLE hSrcMatrix;
924 } D3DMATRIXLOAD, *LPD3DMATRIXLOAD;
926 typedef struct _D3DMATRIXMULTIPLY {
927 D3DMATRIXHANDLE hDestMatrix;
928 D3DMATRIXHANDLE hSrcMatrix1;
929 D3DMATRIXHANDLE hSrcMatrix2;
930 } D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY;
932 typedef struct _D3DPROCESSVERTICES {
933 DWORD dwFlags;
934 WORD wStart;
935 WORD wDest;
936 DWORD dwCount;
937 DWORD dwReserved;
938 } D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES;
940 #define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
941 #define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
942 #define D3DPROCESSVERTICES_COPY 0x00000002L
943 #define D3DPROCESSVERTICES_OPMASK 0x00000007L
945 #define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
946 #define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
948 typedef enum _D3DTEXTURESTAGESTATETYPE
950 D3DTSS_COLOROP = 1,
951 D3DTSS_COLORARG1 = 2,
952 D3DTSS_COLORARG2 = 3,
953 D3DTSS_ALPHAOP = 4,
954 D3DTSS_ALPHAARG1 = 5,
955 D3DTSS_ALPHAARG2 = 6,
956 D3DTSS_BUMPENVMAT00 = 7,
957 D3DTSS_BUMPENVMAT01 = 8,
958 D3DTSS_BUMPENVMAT10 = 9,
959 D3DTSS_BUMPENVMAT11 = 10,
960 D3DTSS_TEXCOORDINDEX = 11,
961 D3DTSS_ADDRESS = 12,
962 D3DTSS_ADDRESSU = 13,
963 D3DTSS_ADDRESSV = 14,
964 D3DTSS_BORDERCOLOR = 15,
965 D3DTSS_MAGFILTER = 16,
966 D3DTSS_MINFILTER = 17,
967 D3DTSS_MIPFILTER = 18,
968 D3DTSS_MIPMAPLODBIAS = 19,
969 D3DTSS_MAXMIPLEVEL = 20,
970 D3DTSS_MAXANISOTROPY = 21,
971 D3DTSS_BUMPENVLSCALE = 22,
972 D3DTSS_BUMPENVLOFFSET = 23,
973 D3DTSS_TEXTURETRANSFORMFLAGS = 24,
974 D3DTSS_FORCE_DWORD = 0x7fffffff
975 } D3DTEXTURESTAGESTATETYPE;
977 #define D3DTSS_TCI_PASSTHRU 0x00000000
978 #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
979 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
980 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
982 typedef enum _D3DTEXTUREOP
984 D3DTOP_DISABLE = 1,
985 D3DTOP_SELECTARG1 = 2,
986 D3DTOP_SELECTARG2 = 3,
988 D3DTOP_MODULATE = 4,
989 D3DTOP_MODULATE2X = 5,
990 D3DTOP_MODULATE4X = 6,
992 D3DTOP_ADD = 7,
993 D3DTOP_ADDSIGNED = 8,
994 D3DTOP_ADDSIGNED2X = 9,
995 D3DTOP_SUBTRACT = 10,
996 D3DTOP_ADDSMOOTH = 11,
998 D3DTOP_BLENDDIFFUSEALPHA = 12,
999 D3DTOP_BLENDTEXTUREALPHA = 13,
1000 D3DTOP_BLENDFACTORALPHA = 14,
1001 D3DTOP_BLENDTEXTUREALPHAPM = 15,
1002 D3DTOP_BLENDCURRENTALPHA = 16,
1004 D3DTOP_PREMODULATE = 17,
1005 D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
1006 D3DTOP_MODULATECOLOR_ADDALPHA = 19,
1007 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
1008 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
1010 D3DTOP_BUMPENVMAP = 22,
1011 D3DTOP_BUMPENVMAPLUMINANCE = 23,
1012 D3DTOP_DOTPRODUCT3 = 24,
1014 D3DTOP_FORCE_DWORD = 0x7fffffff
1015 } D3DTEXTUREOP;
1017 #define D3DTA_SELECTMASK 0x0000000f
1018 #define D3DTA_DIFFUSE 0x00000000
1019 #define D3DTA_CURRENT 0x00000001
1020 #define D3DTA_TEXTURE 0x00000002
1021 #define D3DTA_TFACTOR 0x00000003
1022 #define D3DTA_SPECULAR 0x00000004
1023 #define D3DTA_COMPLEMENT 0x00000010
1024 #define D3DTA_ALPHAREPLICATE 0x00000020
1026 typedef enum _D3DTEXTUREMAGFILTER
1028 D3DTFG_POINT = 1,
1029 D3DTFG_LINEAR = 2,
1030 D3DTFG_FLATCUBIC = 3,
1031 D3DTFG_GAUSSIANCUBIC = 4,
1032 D3DTFG_ANISOTROPIC = 5,
1033 D3DTFG_FORCE_DWORD = 0x7fffffff
1034 } D3DTEXTUREMAGFILTER;
1036 typedef enum _D3DTEXTUREMINFILTER
1038 D3DTFN_POINT = 1,
1039 D3DTFN_LINEAR = 2,
1040 D3DTFN_ANISOTROPIC = 3,
1041 D3DTFN_FORCE_DWORD = 0x7fffffff
1042 } D3DTEXTUREMINFILTER;
1044 typedef enum _D3DTEXTUREMIPFILTER
1046 D3DTFP_NONE = 1,
1047 D3DTFP_POINT = 2,
1048 D3DTFP_LINEAR = 3,
1049 D3DTFP_FORCE_DWORD = 0x7fffffff
1050 } D3DTEXTUREMIPFILTER;
1052 #define D3DTRIFLAG_START 0x00000000L
1053 #define D3DTRIFLAG_STARTFLAT(len) (len)
1054 #define D3DTRIFLAG_ODD 0x0000001eL
1055 #define D3DTRIFLAG_EVEN 0x0000001fL
1057 #define D3DTRIFLAG_EDGEENABLE1 0x00000100L
1058 #define D3DTRIFLAG_EDGEENABLE2 0x00000200L
1059 #define D3DTRIFLAG_EDGEENABLE3 0x00000400L
1060 #define D3DTRIFLAG_EDGEENABLETRIANGLE \
1061 (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
1063 typedef struct _D3DTRIANGLE {
1064 union {
1065 WORD v1;
1066 WORD wV1;
1067 } DUMMYUNIONNAME1;
1068 union {
1069 WORD v2;
1070 WORD wV2;
1071 } DUMMYUNIONNAME2;
1072 union {
1073 WORD v3;
1074 WORD wV3;
1075 } DUMMYUNIONNAME3;
1076 WORD wFlags;
1077 } D3DTRIANGLE, *LPD3DTRIANGLE;
1079 typedef struct _D3DLINE {
1080 union {
1081 WORD v1;
1082 WORD wV1;
1083 } DUMMYUNIONNAME1;
1084 union {
1085 WORD v2;
1086 WORD wV2;
1087 } DUMMYUNIONNAME2;
1088 } D3DLINE, *LPD3DLINE;
1090 typedef struct _D3DSPAN {
1091 WORD wCount;
1092 WORD wFirst;
1093 } D3DSPAN, *LPD3DSPAN;
1095 typedef struct _D3DPOINT {
1096 WORD wCount;
1097 WORD wFirst;
1098 } D3DPOINT, *LPD3DPOINT;
1100 typedef struct _D3DBRANCH {
1101 DWORD dwMask;
1102 DWORD dwValue;
1103 BOOL bNegate;
1104 DWORD dwOffset;
1105 } D3DBRANCH, *LPD3DBRANCH;
1107 typedef struct _D3DSTATUS {
1108 DWORD dwFlags;
1109 DWORD dwStatus;
1110 D3DRECT drExtent;
1111 } D3DSTATUS, *LPD3DSTATUS;
1113 #define D3DSETSTATUS_STATUS 0x00000001L
1114 #define D3DSETSTATUS_EXTENTS 0x00000002L
1115 #define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
1117 typedef struct _D3DCLIPSTATUS {
1118 DWORD dwFlags;
1119 DWORD dwStatus;
1120 float minx, maxx;
1121 float miny, maxy;
1122 float minz, maxz;
1123 } D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
1125 #define D3DCLIPSTATUS_STATUS 0x00000001L
1126 #define D3DCLIPSTATUS_EXTENTS2 0x00000002L
1127 #define D3DCLIPSTATUS_EXTENTS3 0x00000004L
1129 typedef struct {
1130 DWORD dwSize;
1131 DWORD dwTrianglesDrawn;
1132 DWORD dwLinesDrawn;
1133 DWORD dwPointsDrawn;
1134 DWORD dwSpansDrawn;
1135 DWORD dwVerticesProcessed;
1136 } D3DSTATS, *LPD3DSTATS;
1138 #define D3DEXECUTE_CLIPPED 0x00000001l
1139 #define D3DEXECUTE_UNCLIPPED 0x00000002l
1141 typedef struct _D3DEXECUTEDATA {
1142 DWORD dwSize;
1143 DWORD dwVertexOffset;
1144 DWORD dwVertexCount;
1145 DWORD dwInstructionOffset;
1146 DWORD dwInstructionLength;
1147 DWORD dwHVertexOffset;
1148 D3DSTATUS dsStatus;
1149 } D3DEXECUTEDATA, *LPD3DEXECUTEDATA;
1151 #define D3DPAL_FREE 0x00
1152 #define D3DPAL_READONLY 0x40
1153 #define D3DPAL_RESERVED 0x80
1155 typedef struct _D3DVERTEXBUFFERDESC {
1156 DWORD dwSize;
1157 DWORD dwCaps;
1158 DWORD dwFVF;
1159 DWORD dwNumVertices;
1160 } D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
1162 #define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
1163 #define D3DVBCAPS_WRITEONLY 0x00010000l
1164 #define D3DVBCAPS_OPTIMIZED 0x80000000l
1165 #define D3DVBCAPS_DONOTCLIP 0x00000001l
1167 #define D3DVOP_LIGHT (1 << 10)
1168 #define D3DVOP_TRANSFORM (1 << 0)
1169 #define D3DVOP_CLIP (1 << 2)
1170 #define D3DVOP_EXTENTS (1 << 3)
1172 #define D3DMAXNUMVERTICES ((1<<16) - 1)
1174 #define D3DMAXNUMPRIMITIVES ((1<<16) - 1)
1176 #define D3DPV_DONOTCOPYDATA (1 << 0)
1178 #define D3DFVF_RESERVED0 0x001
1179 #define D3DFVF_POSITION_MASK 0x00E
1180 #define D3DFVF_XYZ 0x002
1181 #define D3DFVF_XYZRHW 0x004
1182 #define D3DFVF_XYZB1 0x006
1183 #define D3DFVF_XYZB2 0x008
1184 #define D3DFVF_XYZB3 0x00a
1185 #define D3DFVF_XYZB4 0x00c
1186 #define D3DFVF_XYZB5 0x00e
1188 #define D3DFVF_NORMAL 0x010
1189 #define D3DFVF_RESERVED1 0x020
1190 #define D3DFVF_DIFFUSE 0x040
1191 #define D3DFVF_SPECULAR 0x080
1192 #define D3DFVF_TEXCOUNT_MASK 0xf00
1193 #define D3DFVF_TEXCOUNT_SHIFT 8
1194 #define D3DFVF_TEX0 0x000
1195 #define D3DFVF_TEX1 0x100
1196 #define D3DFVF_TEX2 0x200
1197 #define D3DFVF_TEX3 0x300
1198 #define D3DFVF_TEX4 0x400
1199 #define D3DFVF_TEX5 0x500
1200 #define D3DFVF_TEX6 0x600
1201 #define D3DFVF_TEX7 0x700
1202 #define D3DFVF_TEX8 0x800
1204 #define D3DFVF_RESERVED2 0xf000
1206 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
1207 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
1208 D3DFVF_SPECULAR | D3DFVF_TEX1 )
1209 #define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
1210 D3DFVF_TEX1 )
1212 typedef struct _D3DDP_PTRSTRIDE {
1213 LPVOID lpvData;
1214 DWORD dwStride;
1215 } D3DDP_PTRSTRIDE;
1217 #define D3DDP_MAXTEXCOORD 8
1219 typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA {
1220 D3DDP_PTRSTRIDE position;
1221 D3DDP_PTRSTRIDE normal;
1222 D3DDP_PTRSTRIDE diffuse;
1223 D3DDP_PTRSTRIDE specular;
1224 D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
1225 } D3DDRAWPRIMITIVESTRIDEDDATA ,*LPD3DDRAWPRIMITIVESTRIDEDDATA;
1227 #define D3DVIS_INSIDE_FRUSTUM 0
1228 #define D3DVIS_INTERSECT_FRUSTUM 1
1229 #define D3DVIS_OUTSIDE_FRUSTUM 2
1230 #define D3DVIS_INSIDE_LEFT 0
1231 #define D3DVIS_INTERSECT_LEFT (1 << 2)
1232 #define D3DVIS_OUTSIDE_LEFT (2 << 2)
1233 #define D3DVIS_INSIDE_RIGHT 0
1234 #define D3DVIS_INTERSECT_RIGHT (1 << 4)
1235 #define D3DVIS_OUTSIDE_RIGHT (2 << 4)
1236 #define D3DVIS_INSIDE_TOP 0
1237 #define D3DVIS_INTERSECT_TOP (1 << 6)
1238 #define D3DVIS_OUTSIDE_TOP (2 << 6)
1239 #define D3DVIS_INSIDE_BOTTOM 0
1240 #define D3DVIS_INTERSECT_BOTTOM (1 << 8)
1241 #define D3DVIS_OUTSIDE_BOTTOM (2 << 8)
1242 #define D3DVIS_INSIDE_NEAR 0
1243 #define D3DVIS_INTERSECT_NEAR (1 << 10)
1244 #define D3DVIS_OUTSIDE_NEAR (2 << 10)
1245 #define D3DVIS_INSIDE_FAR 0
1246 #define D3DVIS_INTERSECT_FAR (1 << 12)
1247 #define D3DVIS_OUTSIDE_FAR (2 << 12)
1249 #define D3DVIS_MASK_FRUSTUM (3 << 0)
1250 #define D3DVIS_MASK_LEFT (3 << 2)
1251 #define D3DVIS_MASK_RIGHT (3 << 4)
1252 #define D3DVIS_MASK_TOP (3 << 6)
1253 #define D3DVIS_MASK_BOTTOM (3 << 8)
1254 #define D3DVIS_MASK_NEAR (3 << 10)
1255 #define D3DVIS_MASK_FAR (3 << 12)
1257 #define D3DDEVINFOID_TEXTUREMANAGER 1
1258 #define D3DDEVINFOID_D3DTEXTUREMANAGER 2
1259 #define D3DDEVINFOID_TEXTURING 3
1261 typedef enum _D3DSTATEBLOCKTYPE
1263 D3DSBT_ALL = 1,
1264 D3DSBT_PIXELSTATE = 2,
1265 D3DSBT_VERTEXSTATE = 3,
1266 D3DSBT_FORCE_DWORD = 0xffffffff
1267 } D3DSTATEBLOCKTYPE;
1269 typedef enum _D3DVERTEXBLENDFLAGS
1271 D3DVBLEND_DISABLE = 0,
1272 D3DVBLEND_1WEIGHT = 1,
1273 D3DVBLEND_2WEIGHTS = 2,
1274 D3DVBLEND_3WEIGHTS = 3,
1275 } D3DVERTEXBLENDFLAGS;
1277 typedef enum _D3DTEXTURETRANSFORMFLAGS {
1278 D3DTTFF_DISABLE = 0,
1279 D3DTTFF_COUNT1 = 1,
1280 D3DTTFF_COUNT2 = 2,
1281 D3DTTFF_COUNT3 = 3,
1282 D3DTTFF_COUNT4 = 4,
1283 D3DTTFF_PROJECTED = 256,
1284 D3DTTFF_FORCE_DWORD = 0x7fffffff
1285 } D3DTEXTURETRANSFORMFLAGS;
1287 #define D3DFVF_TEXTUREFORMAT2 0
1288 #define D3DFVF_TEXTUREFORMAT1 3
1289 #define D3DFVF_TEXTUREFORMAT3 1
1290 #define D3DFVF_TEXTUREFORMAT4 2
1292 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
1293 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
1294 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
1295 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
1297 #endif