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