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