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