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