0
|
1 /*==========================================================================;
|
|
2 *
|
|
3 * Copyright (C) Microsoft Corporation. All Rights Reserved.
|
|
4 *
|
|
5 * File: d3dtypes.h
|
|
6 * Content: Direct3D types include file
|
|
7 *
|
|
8 ***************************************************************************/
|
|
9
|
|
10 #ifndef _D3DTYPES_H_
|
|
11 #define _D3DTYPES_H_
|
|
12
|
|
13 #ifndef DIRECT3D_VERSION
|
|
14 #define DIRECT3D_VERSION 0x0700
|
|
15 #endif
|
|
16
|
|
17 #if (DIRECT3D_VERSION >= 0x0800)
|
|
18 #pragma message("should not include d3dtypes.h when compiling for DX8 or newer interfaces")
|
|
19 #endif
|
|
20
|
|
21 #include <windows.h>
|
|
22
|
|
23 #include <float.h>
|
|
24 #include "ddraw.h"
|
|
25
|
|
26 #pragma warning(disable:4201) // anonymous unions warning
|
|
27 #if defined(_X86_) || defined(_IA64_)
|
|
28 #pragma pack(4)
|
|
29 #endif
|
|
30
|
|
31
|
|
32 /* D3DVALUE is the fundamental Direct3D fractional data type */
|
|
33
|
|
34 #define D3DVALP(val, prec) ((float)(val))
|
|
35 #define D3DVAL(val) ((float)(val))
|
|
36
|
|
37 #ifndef DX_SHARED_DEFINES
|
|
38
|
|
39 /*
|
|
40 * This definition is shared with other DirectX components whose header files
|
|
41 * might already have defined it. Therefore, we don't define this type if
|
|
42 * someone else already has (as indicated by the definition of
|
|
43 * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are
|
|
44 * other types in this header that are also shared. The last of these
|
|
45 * shared defines in this file will set DX_SHARED_DEFINES.
|
|
46 */
|
|
47 typedef float D3DVALUE, *LPD3DVALUE;
|
|
48
|
|
49 #endif /* DX_SHARED_DEFINES */
|
|
50
|
|
51 #define D3DDivide(a, b) (float)((double) (a) / (double) (b))
|
|
52 #define D3DMultiply(a, b) ((a) * (b))
|
|
53
|
|
54 typedef LONG D3DFIXED;
|
|
55
|
|
56 #ifndef RGB_MAKE
|
|
57 /*
|
|
58 * Format of CI colors is
|
|
59 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
60 * | alpha | color index | fraction |
|
|
61 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
62 */
|
|
63 #define CI_GETALPHA(ci) ((ci) >> 24)
|
|
64 #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
|
|
65 #define CI_GETFRACTION(ci) ((ci) & 0xff)
|
|
66 #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
|
|
67 #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
|
|
68 #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
|
|
69
|
|
70 /*
|
|
71 * Format of RGBA colors is
|
|
72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
73 * | alpha | red | green | blue |
|
|
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
75 */
|
|
76 #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
|
|
77 #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
|
|
78 #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
|
|
79 #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
|
|
80 #define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
|
|
81
|
|
82 /* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
|
|
83 * The float values must be in the range 0..1
|
|
84 */
|
|
85 #define D3DRGB(r, g, b) \
|
|
86 (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
|
|
87 #define D3DRGBA(r, g, b, a) \
|
|
88 ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
|
|
89 | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
|
|
90 )
|
|
91
|
|
92 /*
|
|
93 * Format of RGB colors is
|
|
94 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
95 * | ignored | red | green | blue |
|
|
96 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
97 */
|
|
98 #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
|
|
99 #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
|
|
100 #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
|
|
101 #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
|
|
102 #define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b)))
|
|
103 #define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff))
|
|
104 #define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000))
|
|
105
|
|
106 #endif
|
|
107
|
|
108 /*
|
|
109 * Flags for Enumerate functions
|
|
110 */
|
|
111
|
|
112 /*
|
|
113 * Stop the enumeration
|
|
114 */
|
|
115 #define D3DENUMRET_CANCEL DDENUMRET_CANCEL
|
|
116
|
|
117 /*
|
|
118 * Continue the enumeration
|
|
119 */
|
|
120 #define D3DENUMRET_OK DDENUMRET_OK
|
|
121
|
|
122 typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
|
|
123 typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
|
|
124 typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
|
|
125
|
|
126 #ifndef DX_SHARED_DEFINES
|
|
127
|
|
128 /*
|
|
129 * This definition is shared with other DirectX components whose header files
|
|
130 * might already have defined it. Therefore, we don't define this type if
|
|
131 * someone else already has (as indicated by the definition of
|
|
132 * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are
|
|
133 * other types in this header that are also shared. The last of these
|
|
134 * shared defines in this file will set DX_SHARED_DEFINES.
|
|
135 */
|
|
136 #ifndef D3DCOLOR_DEFINED
|
|
137 typedef DWORD D3DCOLOR;
|
|
138 #define D3DCOLOR_DEFINED
|
|
139 #endif
|
|
140 typedef DWORD *LPD3DCOLOR;
|
|
141
|
|
142 #endif /* DX_SHARED_DEFINES */
|
|
143
|
|
144 typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
|
|
145 typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
|
|
146 typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
|
|
147
|
|
148 #ifndef D3DCOLORVALUE_DEFINED
|
|
149 typedef struct _D3DCOLORVALUE {
|
|
150 union {
|
|
151 D3DVALUE r;
|
|
152 D3DVALUE dvR;
|
|
153 };
|
|
154 union {
|
|
155 D3DVALUE g;
|
|
156 D3DVALUE dvG;
|
|
157 };
|
|
158 union {
|
|
159 D3DVALUE b;
|
|
160 D3DVALUE dvB;
|
|
161 };
|
|
162 union {
|
|
163 D3DVALUE a;
|
|
164 D3DVALUE dvA;
|
|
165 };
|
|
166 } D3DCOLORVALUE;
|
|
167 #define D3DCOLORVALUE_DEFINED
|
|
168 #endif
|
|
169 typedef struct _D3DCOLORVALUE *LPD3DCOLORVALUE;
|
|
170
|
|
171 #ifndef D3DRECT_DEFINED
|
|
172 typedef struct _D3DRECT {
|
|
173 union {
|
|
174 LONG x1;
|
|
175 LONG lX1;
|
|
176 };
|
|
177 union {
|
|
178 LONG y1;
|
|
179 LONG lY1;
|
|
180 };
|
|
181 union {
|
|
182 LONG x2;
|
|
183 LONG lX2;
|
|
184 };
|
|
185 union {
|
|
186 LONG y2;
|
|
187 LONG lY2;
|
|
188 };
|
|
189 } D3DRECT;
|
|
190 #define D3DRECT_DEFINED
|
|
191 #endif
|
|
192 typedef struct _D3DRECT *LPD3DRECT;
|
|
193
|
|
194 #ifndef DX_SHARED_DEFINES
|
|
195
|
|
196 /*
|
|
197 * This definition is shared with other DirectX components whose header files
|
|
198 * might already have defined it. Therefore, we don't define this type if
|
|
199 * someone else already has (as indicated by the definition of
|
|
200 * DX_SHARED_DEFINES).
|
|
201 */
|
|
202
|
|
203 #ifndef D3DVECTOR_DEFINED
|
|
204 typedef struct _D3DVECTOR {
|
|
205 union {
|
|
206 D3DVALUE x;
|
|
207 D3DVALUE dvX;
|
|
208 };
|
|
209 union {
|
|
210 D3DVALUE y;
|
|
211 D3DVALUE dvY;
|
|
212 };
|
|
213 union {
|
|
214 D3DVALUE z;
|
|
215 D3DVALUE dvZ;
|
|
216 };
|
|
217 #if(DIRECT3D_VERSION >= 0x0500)
|
|
218 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
219
|
|
220 public:
|
|
221
|
|
222 // =====================================
|
|
223 // Constructors
|
|
224 // =====================================
|
|
225
|
|
226 _D3DVECTOR() { }
|
|
227 _D3DVECTOR(D3DVALUE f);
|
|
228 _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
|
|
229 _D3DVECTOR(const D3DVALUE f[3]);
|
|
230
|
|
231 // =====================================
|
|
232 // Access grants
|
|
233 // =====================================
|
|
234
|
|
235 const D3DVALUE&operator[](int i) const;
|
|
236 D3DVALUE&operator[](int i);
|
|
237
|
|
238 // =====================================
|
|
239 // Assignment operators
|
|
240 // =====================================
|
|
241
|
|
242 _D3DVECTOR& operator += (const _D3DVECTOR& v);
|
|
243 _D3DVECTOR& operator -= (const _D3DVECTOR& v);
|
|
244 _D3DVECTOR& operator *= (const _D3DVECTOR& v);
|
|
245 _D3DVECTOR& operator /= (const _D3DVECTOR& v);
|
|
246 _D3DVECTOR& operator *= (D3DVALUE s);
|
|
247 _D3DVECTOR& operator /= (D3DVALUE s);
|
|
248
|
|
249 // =====================================
|
|
250 // Unary operators
|
|
251 // =====================================
|
|
252
|
|
253 friend _D3DVECTOR operator + (const _D3DVECTOR& v);
|
|
254 friend _D3DVECTOR operator - (const _D3DVECTOR& v);
|
|
255
|
|
256
|
|
257 // =====================================
|
|
258 // Binary operators
|
|
259 // =====================================
|
|
260
|
|
261 // Addition and subtraction
|
|
262 friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
263 friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
264 // Scalar multiplication and division
|
|
265 friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
|
|
266 friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
|
|
267 friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
|
|
268 // Memberwise multiplication and division
|
|
269 friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
270 friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
271
|
|
272 // Vector dominance
|
|
273 friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
274 friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
275
|
|
276 // Bitwise equality
|
|
277 friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
278
|
|
279 // Length-related functions
|
|
280 friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v);
|
|
281 friend D3DVALUE Magnitude (const _D3DVECTOR& v);
|
|
282
|
|
283 // Returns vector with same direction and unit length
|
|
284 friend _D3DVECTOR Normalize (const _D3DVECTOR& v);
|
|
285
|
|
286 // Return min/max component of the input vector
|
|
287 friend D3DVALUE Min (const _D3DVECTOR& v);
|
|
288 friend D3DVALUE Max (const _D3DVECTOR& v);
|
|
289
|
|
290 // Return memberwise min/max of input vectors
|
|
291 friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
292 friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
293
|
|
294 // Dot and cross product
|
|
295 friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
296 friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
|
|
297
|
|
298 #endif
|
|
299 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
300 } D3DVECTOR;
|
|
301 #define D3DVECTOR_DEFINED
|
|
302 #endif
|
|
303 typedef struct _D3DVECTOR *LPD3DVECTOR;
|
|
304
|
|
305 /*
|
|
306 * As this is the last of the shared defines to be defined we now set
|
|
307 * D3D_SHARED_DEFINES to flag that fact that this header has defined these
|
|
308 * types.
|
|
309 */
|
|
310 #define DX_SHARED_DEFINES
|
|
311
|
|
312 #endif /* DX_SHARED_DEFINES */
|
|
313
|
|
314 /*
|
|
315 * Vertex data types supported in an ExecuteBuffer.
|
|
316 */
|
|
317
|
|
318 /*
|
|
319 * Homogeneous vertices
|
|
320 */
|
|
321
|
|
322 typedef struct _D3DHVERTEX {
|
|
323 DWORD dwFlags; /* Homogeneous clipping flags */
|
|
324 union {
|
|
325 D3DVALUE hx;
|
|
326 D3DVALUE dvHX;
|
|
327 };
|
|
328 union {
|
|
329 D3DVALUE hy;
|
|
330 D3DVALUE dvHY;
|
|
331 };
|
|
332 union {
|
|
333 D3DVALUE hz;
|
|
334 D3DVALUE dvHZ;
|
|
335 };
|
|
336 } D3DHVERTEX, *LPD3DHVERTEX;
|
|
337
|
|
338 /*
|
|
339 * Transformed/lit vertices
|
|
340 */
|
|
341 typedef struct _D3DTLVERTEX {
|
|
342 union {
|
|
343 D3DVALUE sx; /* Screen coordinates */
|
|
344 D3DVALUE dvSX;
|
|
345 };
|
|
346 union {
|
|
347 D3DVALUE sy;
|
|
348 D3DVALUE dvSY;
|
|
349 };
|
|
350 union {
|
|
351 D3DVALUE sz;
|
|
352 D3DVALUE dvSZ;
|
|
353 };
|
|
354 union {
|
|
355 D3DVALUE rhw; /* Reciprocal of homogeneous w */
|
|
356 D3DVALUE dvRHW;
|
|
357 };
|
|
358 union {
|
|
359 D3DCOLOR color; /* Vertex color */
|
|
360 D3DCOLOR dcColor;
|
|
361 };
|
|
362 union {
|
|
363 D3DCOLOR specular; /* Specular component of vertex */
|
|
364 D3DCOLOR dcSpecular;
|
|
365 };
|
|
366 union {
|
|
367 D3DVALUE tu; /* Texture coordinates */
|
|
368 D3DVALUE dvTU;
|
|
369 };
|
|
370 union {
|
|
371 D3DVALUE tv;
|
|
372 D3DVALUE dvTV;
|
|
373 };
|
|
374 #if(DIRECT3D_VERSION >= 0x0500)
|
|
375 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
376 _D3DTLVERTEX() { }
|
|
377 _D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
|
|
378 D3DCOLOR _color, D3DCOLOR _specular,
|
|
379 float _tu, float _tv)
|
|
380 { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw;
|
|
381 color = _color; specular = _specular;
|
|
382 tu = _tu; tv = _tv;
|
|
383 }
|
|
384 #endif
|
|
385 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
386 } D3DTLVERTEX, *LPD3DTLVERTEX;
|
|
387
|
|
388 /*
|
|
389 * Untransformed/lit vertices
|
|
390 */
|
|
391 typedef struct _D3DLVERTEX {
|
|
392 union {
|
|
393 D3DVALUE x; /* Homogeneous coordinates */
|
|
394 D3DVALUE dvX;
|
|
395 };
|
|
396 union {
|
|
397 D3DVALUE y;
|
|
398 D3DVALUE dvY;
|
|
399 };
|
|
400 union {
|
|
401 D3DVALUE z;
|
|
402 D3DVALUE dvZ;
|
|
403 };
|
|
404 DWORD dwReserved;
|
|
405 union {
|
|
406 D3DCOLOR color; /* Vertex color */
|
|
407 D3DCOLOR dcColor;
|
|
408 };
|
|
409 union {
|
|
410 D3DCOLOR specular; /* Specular component of vertex */
|
|
411 D3DCOLOR dcSpecular;
|
|
412 };
|
|
413 union {
|
|
414 D3DVALUE tu; /* Texture coordinates */
|
|
415 D3DVALUE dvTU;
|
|
416 };
|
|
417 union {
|
|
418 D3DVALUE tv;
|
|
419 D3DVALUE dvTV;
|
|
420 };
|
|
421 #if(DIRECT3D_VERSION >= 0x0500)
|
|
422 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
423 _D3DLVERTEX() { }
|
|
424 _D3DLVERTEX(const D3DVECTOR& v,
|
|
425 D3DCOLOR _color, D3DCOLOR _specular,
|
|
426 float _tu, float _tv)
|
|
427 { x = v.x; y = v.y; z = v.z; dwReserved = 0;
|
|
428 color = _color; specular = _specular;
|
|
429 tu = _tu; tv = _tv;
|
|
430 }
|
|
431 #endif
|
|
432 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
433 } D3DLVERTEX, *LPD3DLVERTEX;
|
|
434
|
|
435 /*
|
|
436 * Untransformed/unlit vertices
|
|
437 */
|
|
438
|
|
439 typedef struct _D3DVERTEX {
|
|
440 union {
|
|
441 D3DVALUE x; /* Homogeneous coordinates */
|
|
442 D3DVALUE dvX;
|
|
443 };
|
|
444 union {
|
|
445 D3DVALUE y;
|
|
446 D3DVALUE dvY;
|
|
447 };
|
|
448 union {
|
|
449 D3DVALUE z;
|
|
450 D3DVALUE dvZ;
|
|
451 };
|
|
452 union {
|
|
453 D3DVALUE nx; /* Normal */
|
|
454 D3DVALUE dvNX;
|
|
455 };
|
|
456 union {
|
|
457 D3DVALUE ny;
|
|
458 D3DVALUE dvNY;
|
|
459 };
|
|
460 union {
|
|
461 D3DVALUE nz;
|
|
462 D3DVALUE dvNZ;
|
|
463 };
|
|
464 union {
|
|
465 D3DVALUE tu; /* Texture coordinates */
|
|
466 D3DVALUE dvTU;
|
|
467 };
|
|
468 union {
|
|
469 D3DVALUE tv;
|
|
470 D3DVALUE dvTV;
|
|
471 };
|
|
472 #if(DIRECT3D_VERSION >= 0x0500)
|
|
473 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
474 _D3DVERTEX() { }
|
|
475 _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
|
|
476 { x = v.x; y = v.y; z = v.z;
|
|
477 nx = n.x; ny = n.y; nz = n.z;
|
|
478 tu = _tu; tv = _tv;
|
|
479 }
|
|
480 #endif
|
|
481 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
482 } D3DVERTEX, *LPD3DVERTEX;
|
|
483
|
|
484
|
|
485 /*
|
|
486 * Matrix, OldViewport, and tranformation structures and definitions.
|
|
487 */
|
|
488
|
|
489 #ifndef D3DMATRIX_DEFINED
|
|
490 typedef struct _D3DMATRIX {
|
|
491 #if(DIRECT3D_VERSION >= 0x0500)
|
|
492 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
493 union {
|
|
494 struct {
|
|
495 #endif
|
|
496
|
|
497 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
498 D3DVALUE _11, _12, _13, _14;
|
|
499 D3DVALUE _21, _22, _23, _24;
|
|
500 D3DVALUE _31, _32, _33, _34;
|
|
501 D3DVALUE _41, _42, _43, _44;
|
|
502
|
|
503 #if(DIRECT3D_VERSION >= 0x0500)
|
|
504 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
505 };
|
|
506 D3DVALUE m[4][4];
|
|
507 };
|
|
508 _D3DMATRIX() { }
|
|
509 _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03,
|
|
510 D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13,
|
|
511 D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23,
|
|
512 D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33
|
|
513 )
|
|
514 {
|
|
515 m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03;
|
|
516 m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13;
|
|
517 m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23;
|
|
518 m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33;
|
|
519 }
|
|
520
|
|
521 D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; }
|
|
522 const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; }
|
|
523 #if(DIRECT3D_VERSION >= 0x0600)
|
|
524 friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&);
|
|
525 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
526 #endif
|
|
527 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
528 } D3DMATRIX;
|
|
529 #define D3DMATRIX_DEFINED
|
|
530 #endif
|
|
531 typedef struct _D3DMATRIX *LPD3DMATRIX;
|
|
532
|
|
533 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
|
534 #include "d3dvec.inl"
|
|
535 #endif
|
|
536
|
|
537 typedef struct _D3DVIEWPORT {
|
|
538 DWORD dwSize;
|
|
539 DWORD dwX;
|
|
540 DWORD dwY; /* Top left */
|
|
541 DWORD dwWidth;
|
|
542 DWORD dwHeight; /* Dimensions */
|
|
543 D3DVALUE dvScaleX; /* Scale homogeneous to screen */
|
|
544 D3DVALUE dvScaleY; /* Scale homogeneous to screen */
|
|
545 D3DVALUE dvMaxX; /* Min/max homogeneous x coord */
|
|
546 D3DVALUE dvMaxY; /* Min/max homogeneous y coord */
|
|
547 D3DVALUE dvMinZ;
|
|
548 D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */
|
|
549 } D3DVIEWPORT, *LPD3DVIEWPORT;
|
|
550
|
|
551 #if(DIRECT3D_VERSION >= 0x0500)
|
|
552 typedef struct _D3DVIEWPORT2 {
|
|
553 DWORD dwSize;
|
|
554 DWORD dwX;
|
|
555 DWORD dwY; /* OldViewport Top left */
|
|
556 DWORD dwWidth;
|
|
557 DWORD dwHeight; /* OldViewport Dimensions */
|
|
558 D3DVALUE dvClipX; /* Top left of clip volume */
|
|
559 D3DVALUE dvClipY;
|
|
560 D3DVALUE dvClipWidth; /* Clip Volume Dimensions */
|
|
561 D3DVALUE dvClipHeight;
|
|
562 D3DVALUE dvMinZ; /* Min/max of clip Volume */
|
|
563 D3DVALUE dvMaxZ;
|
|
564 } D3DVIEWPORT2, *LPD3DVIEWPORT2;
|
|
565 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
566
|
|
567 #if(DIRECT3D_VERSION >= 0x0700)
|
|
568 typedef struct _D3DVIEWPORT7 {
|
|
569 DWORD dwX;
|
|
570 DWORD dwY; /* OldViewport Top left */
|
|
571 DWORD dwWidth;
|
|
572 DWORD dwHeight; /* OldViewport Dimensions */
|
|
573 D3DVALUE dvMinZ; /* Min/max of clip Volume */
|
|
574 D3DVALUE dvMaxZ;
|
|
575 } D3DVIEWPORT7, *LPD3DVIEWPORT7;
|
|
576 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
577
|
|
578 /*
|
|
579 * Values for clip fields.
|
|
580 */
|
|
581
|
|
582 #if(DIRECT3D_VERSION >= 0x0700)
|
|
583
|
|
584 // Max number of user clipping planes, supported in D3D.
|
|
585 #define D3DMAXUSERCLIPPLANES 32
|
|
586
|
|
587 // These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
|
|
588 //
|
|
589 #define D3DCLIPPLANE0 (1 << 0)
|
|
590 #define D3DCLIPPLANE1 (1 << 1)
|
|
591 #define D3DCLIPPLANE2 (1 << 2)
|
|
592 #define D3DCLIPPLANE3 (1 << 3)
|
|
593 #define D3DCLIPPLANE4 (1 << 4)
|
|
594 #define D3DCLIPPLANE5 (1 << 5)
|
|
595
|
|
596 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
597
|
|
598 #define D3DCLIP_LEFT 0x00000001L
|
|
599 #define D3DCLIP_RIGHT 0x00000002L
|
|
600 #define D3DCLIP_TOP 0x00000004L
|
|
601 #define D3DCLIP_BOTTOM 0x00000008L
|
|
602 #define D3DCLIP_FRONT 0x00000010L
|
|
603 #define D3DCLIP_BACK 0x00000020L
|
|
604 #define D3DCLIP_GEN0 0x00000040L
|
|
605 #define D3DCLIP_GEN1 0x00000080L
|
|
606 #define D3DCLIP_GEN2 0x00000100L
|
|
607 #define D3DCLIP_GEN3 0x00000200L
|
|
608 #define D3DCLIP_GEN4 0x00000400L
|
|
609 #define D3DCLIP_GEN5 0x00000800L
|
|
610
|
|
611 /*
|
|
612 * Values for d3d status.
|
|
613 */
|
|
614 #define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT
|
|
615 #define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT
|
|
616 #define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP
|
|
617 #define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM
|
|
618 #define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT
|
|
619 #define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK
|
|
620 #define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0
|
|
621 #define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1
|
|
622 #define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2
|
|
623 #define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3
|
|
624 #define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4
|
|
625 #define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5
|
|
626
|
|
627 #define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L
|
|
628 #define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L
|
|
629 #define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L
|
|
630 #define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L
|
|
631 #define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L
|
|
632 #define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L
|
|
633 #define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L
|
|
634 #define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L
|
|
635 #define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L
|
|
636 #define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L
|
|
637 #define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L
|
|
638 #define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L
|
|
639 #define D3DSTATUS_ZNOTVISIBLE 0x01000000L
|
|
640 /* Do not use 0x80000000 for any status flags in future as it is reserved */
|
|
641
|
|
642 #define D3DSTATUS_CLIPUNIONALL ( \
|
|
643 D3DSTATUS_CLIPUNIONLEFT | \
|
|
644 D3DSTATUS_CLIPUNIONRIGHT | \
|
|
645 D3DSTATUS_CLIPUNIONTOP | \
|
|
646 D3DSTATUS_CLIPUNIONBOTTOM | \
|
|
647 D3DSTATUS_CLIPUNIONFRONT | \
|
|
648 D3DSTATUS_CLIPUNIONBACK | \
|
|
649 D3DSTATUS_CLIPUNIONGEN0 | \
|
|
650 D3DSTATUS_CLIPUNIONGEN1 | \
|
|
651 D3DSTATUS_CLIPUNIONGEN2 | \
|
|
652 D3DSTATUS_CLIPUNIONGEN3 | \
|
|
653 D3DSTATUS_CLIPUNIONGEN4 | \
|
|
654 D3DSTATUS_CLIPUNIONGEN5 \
|
|
655 )
|
|
656
|
|
657 #define D3DSTATUS_CLIPINTERSECTIONALL ( \
|
|
658 D3DSTATUS_CLIPINTERSECTIONLEFT | \
|
|
659 D3DSTATUS_CLIPINTERSECTIONRIGHT | \
|
|
660 D3DSTATUS_CLIPINTERSECTIONTOP | \
|
|
661 D3DSTATUS_CLIPINTERSECTIONBOTTOM | \
|
|
662 D3DSTATUS_CLIPINTERSECTIONFRONT | \
|
|
663 D3DSTATUS_CLIPINTERSECTIONBACK | \
|
|
664 D3DSTATUS_CLIPINTERSECTIONGEN0 | \
|
|
665 D3DSTATUS_CLIPINTERSECTIONGEN1 | \
|
|
666 D3DSTATUS_CLIPINTERSECTIONGEN2 | \
|
|
667 D3DSTATUS_CLIPINTERSECTIONGEN3 | \
|
|
668 D3DSTATUS_CLIPINTERSECTIONGEN4 | \
|
|
669 D3DSTATUS_CLIPINTERSECTIONGEN5 \
|
|
670 )
|
|
671
|
|
672 #define D3DSTATUS_DEFAULT ( \
|
|
673 D3DSTATUS_CLIPINTERSECTIONALL | \
|
|
674 D3DSTATUS_ZNOTVISIBLE)
|
|
675
|
|
676
|
|
677 /*
|
|
678 * Options for direct transform calls
|
|
679 */
|
|
680 #define D3DTRANSFORM_CLIPPED 0x00000001l
|
|
681 #define D3DTRANSFORM_UNCLIPPED 0x00000002l
|
|
682
|
|
683 typedef struct _D3DTRANSFORMDATA {
|
|
684 DWORD dwSize;
|
|
685 LPVOID lpIn; /* Input vertices */
|
|
686 DWORD dwInSize; /* Stride of input vertices */
|
|
687 LPVOID lpOut; /* Output vertices */
|
|
688 DWORD dwOutSize; /* Stride of output vertices */
|
|
689 LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */
|
|
690 DWORD dwClip; /* Clipping hint */
|
|
691 DWORD dwClipIntersection;
|
|
692 DWORD dwClipUnion; /* Union of all clip flags */
|
|
693 D3DRECT drExtent; /* Extent of transformed vertices */
|
|
694 } D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
|
|
695
|
|
696 /*
|
|
697 * Structure defining position and direction properties for lighting.
|
|
698 */
|
|
699 typedef struct _D3DLIGHTINGELEMENT {
|
|
700 D3DVECTOR dvPosition; /* Lightable point in model space */
|
|
701 D3DVECTOR dvNormal; /* Normalised unit vector */
|
|
702 } D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
|
|
703
|
|
704 /*
|
|
705 * Structure defining material properties for lighting.
|
|
706 */
|
|
707 typedef struct _D3DMATERIAL {
|
|
708 DWORD dwSize;
|
|
709 union {
|
|
710 D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
|
|
711 D3DCOLORVALUE dcvDiffuse;
|
|
712 };
|
|
713 union {
|
|
714 D3DCOLORVALUE ambient; /* Ambient color RGB */
|
|
715 D3DCOLORVALUE dcvAmbient;
|
|
716 };
|
|
717 union {
|
|
718 D3DCOLORVALUE specular; /* Specular 'shininess' */
|
|
719 D3DCOLORVALUE dcvSpecular;
|
|
720 };
|
|
721 union {
|
|
722 D3DCOLORVALUE emissive; /* Emissive color RGB */
|
|
723 D3DCOLORVALUE dcvEmissive;
|
|
724 };
|
|
725 union {
|
|
726 D3DVALUE power; /* Sharpness if specular highlight */
|
|
727 D3DVALUE dvPower;
|
|
728 };
|
|
729 D3DTEXTUREHANDLE hTexture; /* Handle to texture map */
|
|
730 DWORD dwRampSize;
|
|
731 } D3DMATERIAL, *LPD3DMATERIAL;
|
|
732
|
|
733 #if(DIRECT3D_VERSION >= 0x0700)
|
|
734
|
|
735 typedef struct _D3DMATERIAL7 {
|
|
736 union {
|
|
737 D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
|
|
738 D3DCOLORVALUE dcvDiffuse;
|
|
739 };
|
|
740 union {
|
|
741 D3DCOLORVALUE ambient; /* Ambient color RGB */
|
|
742 D3DCOLORVALUE dcvAmbient;
|
|
743 };
|
|
744 union {
|
|
745 D3DCOLORVALUE specular; /* Specular 'shininess' */
|
|
746 D3DCOLORVALUE dcvSpecular;
|
|
747 };
|
|
748 union {
|
|
749 D3DCOLORVALUE emissive; /* Emissive color RGB */
|
|
750 D3DCOLORVALUE dcvEmissive;
|
|
751 };
|
|
752 union {
|
|
753 D3DVALUE power; /* Sharpness if specular highlight */
|
|
754 D3DVALUE dvPower;
|
|
755 };
|
|
756 } D3DMATERIAL7, *LPD3DMATERIAL7;
|
|
757
|
|
758 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
759
|
|
760 #if(DIRECT3D_VERSION < 0x0800)
|
|
761
|
|
762 typedef enum _D3DLIGHTTYPE {
|
|
763 D3DLIGHT_POINT = 1,
|
|
764 D3DLIGHT_SPOT = 2,
|
|
765 D3DLIGHT_DIRECTIONAL = 3,
|
|
766 // Note: The following light type (D3DLIGHT_PARALLELPOINT)
|
|
767 // is no longer supported from D3D for DX7 onwards.
|
|
768 D3DLIGHT_PARALLELPOINT = 4,
|
|
769 #if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers
|
|
770 D3DLIGHT_GLSPOT = 5,
|
|
771 #endif
|
|
772 D3DLIGHT_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
773 } D3DLIGHTTYPE;
|
|
774
|
|
775 #else
|
|
776 typedef enum _D3DLIGHTTYPE D3DLIGHTTYPE;
|
|
777 #define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
|
|
778 #define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
|
|
779
|
|
780 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
781
|
|
782 /*
|
|
783 * Structure defining a light source and its properties.
|
|
784 */
|
|
785 typedef struct _D3DLIGHT {
|
|
786 DWORD dwSize;
|
|
787 D3DLIGHTTYPE dltType; /* Type of light source */
|
|
788 D3DCOLORVALUE dcvColor; /* Color of light */
|
|
789 D3DVECTOR dvPosition; /* Position in world space */
|
|
790 D3DVECTOR dvDirection; /* Direction in world space */
|
|
791 D3DVALUE dvRange; /* Cutoff range */
|
|
792 D3DVALUE dvFalloff; /* Falloff */
|
|
793 D3DVALUE dvAttenuation0; /* Constant attenuation */
|
|
794 D3DVALUE dvAttenuation1; /* Linear attenuation */
|
|
795 D3DVALUE dvAttenuation2; /* Quadratic attenuation */
|
|
796 D3DVALUE dvTheta; /* Inner angle of spotlight cone */
|
|
797 D3DVALUE dvPhi; /* Outer angle of spotlight cone */
|
|
798 } D3DLIGHT, *LPD3DLIGHT;
|
|
799
|
|
800 #if(DIRECT3D_VERSION >= 0x0700)
|
|
801
|
|
802 typedef struct _D3DLIGHT7 {
|
|
803 D3DLIGHTTYPE dltType; /* Type of light source */
|
|
804 D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */
|
|
805 D3DCOLORVALUE dcvSpecular; /* Specular color of light */
|
|
806 D3DCOLORVALUE dcvAmbient; /* Ambient color of light */
|
|
807 D3DVECTOR dvPosition; /* Position in world space */
|
|
808 D3DVECTOR dvDirection; /* Direction in world space */
|
|
809 D3DVALUE dvRange; /* Cutoff range */
|
|
810 D3DVALUE dvFalloff; /* Falloff */
|
|
811 D3DVALUE dvAttenuation0; /* Constant attenuation */
|
|
812 D3DVALUE dvAttenuation1; /* Linear attenuation */
|
|
813 D3DVALUE dvAttenuation2; /* Quadratic attenuation */
|
|
814 D3DVALUE dvTheta; /* Inner angle of spotlight cone */
|
|
815 D3DVALUE dvPhi; /* Outer angle of spotlight cone */
|
|
816 } D3DLIGHT7, *LPD3DLIGHT7;
|
|
817
|
|
818 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
819
|
|
820 #if(DIRECT3D_VERSION >= 0x0500)
|
|
821 /*
|
|
822 * Structure defining a light source and its properties.
|
|
823 */
|
|
824
|
|
825 /* flags bits */
|
|
826 #define D3DLIGHT_ACTIVE 0x00000001
|
|
827 #define D3DLIGHT_NO_SPECULAR 0x00000002
|
|
828 #define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR)
|
|
829
|
|
830 /* maximum valid light range */
|
|
831 #define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
|
|
832
|
|
833 typedef struct _D3DLIGHT2 {
|
|
834 DWORD dwSize;
|
|
835 D3DLIGHTTYPE dltType; /* Type of light source */
|
|
836 D3DCOLORVALUE dcvColor; /* Color of light */
|
|
837 D3DVECTOR dvPosition; /* Position in world space */
|
|
838 D3DVECTOR dvDirection; /* Direction in world space */
|
|
839 D3DVALUE dvRange; /* Cutoff range */
|
|
840 D3DVALUE dvFalloff; /* Falloff */
|
|
841 D3DVALUE dvAttenuation0; /* Constant attenuation */
|
|
842 D3DVALUE dvAttenuation1; /* Linear attenuation */
|
|
843 D3DVALUE dvAttenuation2; /* Quadratic attenuation */
|
|
844 D3DVALUE dvTheta; /* Inner angle of spotlight cone */
|
|
845 D3DVALUE dvPhi; /* Outer angle of spotlight cone */
|
|
846 DWORD dwFlags;
|
|
847 } D3DLIGHT2, *LPD3DLIGHT2;
|
|
848
|
|
849 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
850 typedef struct _D3DLIGHTDATA {
|
|
851 DWORD dwSize;
|
|
852 LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */
|
|
853 DWORD dwInSize; /* Stride of input elements */
|
|
854 LPD3DTLVERTEX lpOut; /* Output colors */
|
|
855 DWORD dwOutSize; /* Stride of output colors */
|
|
856 } D3DLIGHTDATA, *LPD3DLIGHTDATA;
|
|
857
|
|
858 #if(DIRECT3D_VERSION >= 0x0500)
|
|
859 /*
|
|
860 * Before DX5, these values were in an enum called
|
|
861 * D3DCOLORMODEL. This was not correct, since they are
|
|
862 * bit flags. A driver can surface either or both flags
|
|
863 * in the dcmColorModel member of D3DDEVICEDESC.
|
|
864 */
|
|
865 #define D3DCOLOR_MONO 1
|
|
866 #define D3DCOLOR_RGB 2
|
|
867
|
|
868 typedef DWORD D3DCOLORMODEL;
|
|
869 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
870
|
|
871 /*
|
|
872 * Options for clearing
|
|
873 */
|
|
874 #define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */
|
|
875 #define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */
|
|
876 #if(DIRECT3D_VERSION >= 0x0600)
|
|
877 #define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */
|
|
878 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
879
|
|
880 /*
|
|
881 * Execute buffers are allocated via Direct3D. These buffers may then
|
|
882 * be filled by the application with instructions to execute along with
|
|
883 * vertex data.
|
|
884 */
|
|
885
|
|
886 /*
|
|
887 * Supported op codes for execute instructions.
|
|
888 */
|
|
889 typedef enum _D3DOPCODE {
|
|
890 D3DOP_POINT = 1,
|
|
891 D3DOP_LINE = 2,
|
|
892 D3DOP_TRIANGLE = 3,
|
|
893 D3DOP_MATRIXLOAD = 4,
|
|
894 D3DOP_MATRIXMULTIPLY = 5,
|
|
895 D3DOP_STATETRANSFORM = 6,
|
|
896 D3DOP_STATELIGHT = 7,
|
|
897 D3DOP_STATERENDER = 8,
|
|
898 D3DOP_PROCESSVERTICES = 9,
|
|
899 D3DOP_TEXTURELOAD = 10,
|
|
900 D3DOP_EXIT = 11,
|
|
901 D3DOP_BRANCHFORWARD = 12,
|
|
902 D3DOP_SPAN = 13,
|
|
903 D3DOP_SETSTATUS = 14,
|
|
904 #if(DIRECT3D_VERSION >= 0x0500)
|
|
905 D3DOP_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
906 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
907 } D3DOPCODE;
|
|
908
|
|
909 typedef struct _D3DINSTRUCTION {
|
|
910 BYTE bOpcode; /* Instruction opcode */
|
|
911 BYTE bSize; /* Size of each instruction data unit */
|
|
912 WORD wCount; /* Count of instruction data units to follow */
|
|
913 } D3DINSTRUCTION, *LPD3DINSTRUCTION;
|
|
914
|
|
915 /*
|
|
916 * Structure for texture loads
|
|
917 */
|
|
918 typedef struct _D3DTEXTURELOAD {
|
|
919 D3DTEXTUREHANDLE hDestTexture;
|
|
920 D3DTEXTUREHANDLE hSrcTexture;
|
|
921 } D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
|
|
922
|
|
923 /*
|
|
924 * Structure for picking
|
|
925 */
|
|
926 typedef struct _D3DPICKRECORD {
|
|
927 BYTE bOpcode;
|
|
928 BYTE bPad;
|
|
929 DWORD dwOffset;
|
|
930 D3DVALUE dvZ;
|
|
931 } D3DPICKRECORD, *LPD3DPICKRECORD;
|
|
932
|
|
933 /*
|
|
934 * The following defines the rendering states which can be set in the
|
|
935 * execute buffer.
|
|
936 */
|
|
937
|
|
938 #if(DIRECT3D_VERSION < 0x0800)
|
|
939
|
|
940 typedef enum _D3DSHADEMODE {
|
|
941 D3DSHADE_FLAT = 1,
|
|
942 D3DSHADE_GOURAUD = 2,
|
|
943 D3DSHADE_PHONG = 3,
|
|
944 #if(DIRECT3D_VERSION >= 0x0500)
|
|
945 D3DSHADE_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
946 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
947 } D3DSHADEMODE;
|
|
948
|
|
949 typedef enum _D3DFILLMODE {
|
|
950 D3DFILL_POINT = 1,
|
|
951 D3DFILL_WIREFRAME = 2,
|
|
952 D3DFILL_SOLID = 3,
|
|
953 #if(DIRECT3D_VERSION >= 0x0500)
|
|
954 D3DFILL_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
955 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
956 } D3DFILLMODE;
|
|
957
|
|
958 typedef struct _D3DLINEPATTERN {
|
|
959 WORD wRepeatFactor;
|
|
960 WORD wLinePattern;
|
|
961 } D3DLINEPATTERN;
|
|
962
|
|
963 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
964
|
|
965 typedef enum _D3DTEXTUREFILTER {
|
|
966 D3DFILTER_NEAREST = 1,
|
|
967 D3DFILTER_LINEAR = 2,
|
|
968 D3DFILTER_MIPNEAREST = 3,
|
|
969 D3DFILTER_MIPLINEAR = 4,
|
|
970 D3DFILTER_LINEARMIPNEAREST = 5,
|
|
971 D3DFILTER_LINEARMIPLINEAR = 6,
|
|
972 #if(DIRECT3D_VERSION >= 0x0500)
|
|
973 D3DFILTER_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
974 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
975 } D3DTEXTUREFILTER;
|
|
976
|
|
977 #if(DIRECT3D_VERSION < 0x0800)
|
|
978
|
|
979 typedef enum _D3DBLEND {
|
|
980 D3DBLEND_ZERO = 1,
|
|
981 D3DBLEND_ONE = 2,
|
|
982 D3DBLEND_SRCCOLOR = 3,
|
|
983 D3DBLEND_INVSRCCOLOR = 4,
|
|
984 D3DBLEND_SRCALPHA = 5,
|
|
985 D3DBLEND_INVSRCALPHA = 6,
|
|
986 D3DBLEND_DESTALPHA = 7,
|
|
987 D3DBLEND_INVDESTALPHA = 8,
|
|
988 D3DBLEND_DESTCOLOR = 9,
|
|
989 D3DBLEND_INVDESTCOLOR = 10,
|
|
990 D3DBLEND_SRCALPHASAT = 11,
|
|
991 D3DBLEND_BOTHSRCALPHA = 12,
|
|
992 D3DBLEND_BOTHINVSRCALPHA = 13,
|
|
993 #if(DIRECT3D_VERSION >= 0x0500)
|
|
994 D3DBLEND_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
995 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
996 } D3DBLEND;
|
|
997
|
|
998 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
999
|
|
1000 typedef enum _D3DTEXTUREBLEND {
|
|
1001 D3DTBLEND_DECAL = 1,
|
|
1002 D3DTBLEND_MODULATE = 2,
|
|
1003 D3DTBLEND_DECALALPHA = 3,
|
|
1004 D3DTBLEND_MODULATEALPHA = 4,
|
|
1005 D3DTBLEND_DECALMASK = 5,
|
|
1006 D3DTBLEND_MODULATEMASK = 6,
|
|
1007 D3DTBLEND_COPY = 7,
|
|
1008 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1009 D3DTBLEND_ADD = 8,
|
|
1010 D3DTBLEND_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1011 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1012 } D3DTEXTUREBLEND;
|
|
1013
|
|
1014 #if(DIRECT3D_VERSION < 0x0800)
|
|
1015
|
|
1016 typedef enum _D3DTEXTUREADDRESS {
|
|
1017 D3DTADDRESS_WRAP = 1,
|
|
1018 D3DTADDRESS_MIRROR = 2,
|
|
1019 D3DTADDRESS_CLAMP = 3,
|
|
1020 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1021 D3DTADDRESS_BORDER = 4,
|
|
1022 D3DTADDRESS_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1023 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1024 } D3DTEXTUREADDRESS;
|
|
1025
|
|
1026 typedef enum _D3DCULL {
|
|
1027 D3DCULL_NONE = 1,
|
|
1028 D3DCULL_CW = 2,
|
|
1029 D3DCULL_CCW = 3,
|
|
1030 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1031 D3DCULL_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1032 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1033 } D3DCULL;
|
|
1034
|
|
1035 typedef enum _D3DCMPFUNC {
|
|
1036 D3DCMP_NEVER = 1,
|
|
1037 D3DCMP_LESS = 2,
|
|
1038 D3DCMP_EQUAL = 3,
|
|
1039 D3DCMP_LESSEQUAL = 4,
|
|
1040 D3DCMP_GREATER = 5,
|
|
1041 D3DCMP_NOTEQUAL = 6,
|
|
1042 D3DCMP_GREATEREQUAL = 7,
|
|
1043 D3DCMP_ALWAYS = 8,
|
|
1044 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1045 D3DCMP_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1046 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1047 } D3DCMPFUNC;
|
|
1048
|
|
1049 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1050 typedef enum _D3DSTENCILOP {
|
|
1051 D3DSTENCILOP_KEEP = 1,
|
|
1052 D3DSTENCILOP_ZERO = 2,
|
|
1053 D3DSTENCILOP_REPLACE = 3,
|
|
1054 D3DSTENCILOP_INCRSAT = 4,
|
|
1055 D3DSTENCILOP_DECRSAT = 5,
|
|
1056 D3DSTENCILOP_INVERT = 6,
|
|
1057 D3DSTENCILOP_INCR = 7,
|
|
1058 D3DSTENCILOP_DECR = 8,
|
|
1059 D3DSTENCILOP_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1060 } D3DSTENCILOP;
|
|
1061 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1062
|
|
1063 typedef enum _D3DFOGMODE {
|
|
1064 D3DFOG_NONE = 0,
|
|
1065 D3DFOG_EXP = 1,
|
|
1066 D3DFOG_EXP2 = 2,
|
|
1067 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1068 D3DFOG_LINEAR = 3,
|
|
1069 D3DFOG_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1070 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1071 } D3DFOGMODE;
|
|
1072
|
|
1073 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1074 typedef enum _D3DZBUFFERTYPE {
|
|
1075 D3DZB_FALSE = 0,
|
|
1076 D3DZB_TRUE = 1, // Z buffering
|
|
1077 D3DZB_USEW = 2, // W buffering
|
|
1078 D3DZB_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1079 } D3DZBUFFERTYPE;
|
|
1080 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1081
|
|
1082 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1083
|
|
1084 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1085 typedef enum _D3DANTIALIASMODE {
|
|
1086 D3DANTIALIAS_NONE = 0,
|
|
1087 D3DANTIALIAS_SORTDEPENDENT = 1,
|
|
1088 D3DANTIALIAS_SORTINDEPENDENT = 2,
|
|
1089 D3DANTIALIAS_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1090 } D3DANTIALIASMODE;
|
|
1091
|
|
1092 // Vertex types supported by Direct3D
|
|
1093 typedef enum _D3DVERTEXTYPE {
|
|
1094 D3DVT_VERTEX = 1,
|
|
1095 D3DVT_LVERTEX = 2,
|
|
1096 D3DVT_TLVERTEX = 3,
|
|
1097 D3DVT_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1098 } D3DVERTEXTYPE;
|
|
1099
|
|
1100 #if(DIRECT3D_VERSION < 0x0800)
|
|
1101
|
|
1102 // Primitives supported by draw-primitive API
|
|
1103 typedef enum _D3DPRIMITIVETYPE {
|
|
1104 D3DPT_POINTLIST = 1,
|
|
1105 D3DPT_LINELIST = 2,
|
|
1106 D3DPT_LINESTRIP = 3,
|
|
1107 D3DPT_TRIANGLELIST = 4,
|
|
1108 D3DPT_TRIANGLESTRIP = 5,
|
|
1109 D3DPT_TRIANGLEFAN = 6,
|
|
1110 D3DPT_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1111 } D3DPRIMITIVETYPE;
|
|
1112
|
|
1113 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1114
|
|
1115 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1116 /*
|
|
1117 * Amount to add to a state to generate the override for that state.
|
|
1118 */
|
|
1119 #define D3DSTATE_OVERRIDE_BIAS 256
|
|
1120
|
|
1121 /*
|
|
1122 * A state which sets the override flag for the specified state type.
|
|
1123 */
|
|
1124 #define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
|
|
1125
|
|
1126 #if(DIRECT3D_VERSION < 0x0800)
|
|
1127
|
|
1128 typedef enum _D3DTRANSFORMSTATETYPE {
|
|
1129 D3DTRANSFORMSTATE_WORLD = 1,
|
|
1130 D3DTRANSFORMSTATE_VIEW = 2,
|
|
1131 D3DTRANSFORMSTATE_PROJECTION = 3,
|
|
1132 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1133 D3DTRANSFORMSTATE_WORLD1 = 4, // 2nd matrix to blend
|
|
1134 D3DTRANSFORMSTATE_WORLD2 = 5, // 3rd matrix to blend
|
|
1135 D3DTRANSFORMSTATE_WORLD3 = 6, // 4th matrix to blend
|
|
1136 D3DTRANSFORMSTATE_TEXTURE0 = 16,
|
|
1137 D3DTRANSFORMSTATE_TEXTURE1 = 17,
|
|
1138 D3DTRANSFORMSTATE_TEXTURE2 = 18,
|
|
1139 D3DTRANSFORMSTATE_TEXTURE3 = 19,
|
|
1140 D3DTRANSFORMSTATE_TEXTURE4 = 20,
|
|
1141 D3DTRANSFORMSTATE_TEXTURE5 = 21,
|
|
1142 D3DTRANSFORMSTATE_TEXTURE6 = 22,
|
|
1143 D3DTRANSFORMSTATE_TEXTURE7 = 23,
|
|
1144 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1145 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1146 D3DTRANSFORMSTATE_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1147 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1148 } D3DTRANSFORMSTATETYPE;
|
|
1149
|
|
1150 #else
|
|
1151
|
|
1152 //
|
|
1153 // legacy transform state names
|
|
1154 //
|
|
1155 typedef enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE;
|
|
1156 #define D3DTRANSFORMSTATE_WORLD (D3DTRANSFORMSTATETYPE)1
|
|
1157 #define D3DTRANSFORMSTATE_VIEW (D3DTRANSFORMSTATETYPE)2
|
|
1158 #define D3DTRANSFORMSTATE_PROJECTION (D3DTRANSFORMSTATETYPE)3
|
|
1159 #define D3DTRANSFORMSTATE_WORLD1 (D3DTRANSFORMSTATETYPE)4
|
|
1160 #define D3DTRANSFORMSTATE_WORLD2 (D3DTRANSFORMSTATETYPE)5
|
|
1161 #define D3DTRANSFORMSTATE_WORLD3 (D3DTRANSFORMSTATETYPE)6
|
|
1162 #define D3DTRANSFORMSTATE_TEXTURE0 (D3DTRANSFORMSTATETYPE)16
|
|
1163 #define D3DTRANSFORMSTATE_TEXTURE1 (D3DTRANSFORMSTATETYPE)17
|
|
1164 #define D3DTRANSFORMSTATE_TEXTURE2 (D3DTRANSFORMSTATETYPE)18
|
|
1165 #define D3DTRANSFORMSTATE_TEXTURE3 (D3DTRANSFORMSTATETYPE)19
|
|
1166 #define D3DTRANSFORMSTATE_TEXTURE4 (D3DTRANSFORMSTATETYPE)20
|
|
1167 #define D3DTRANSFORMSTATE_TEXTURE5 (D3DTRANSFORMSTATETYPE)21
|
|
1168 #define D3DTRANSFORMSTATE_TEXTURE6 (D3DTRANSFORMSTATETYPE)22
|
|
1169 #define D3DTRANSFORMSTATE_TEXTURE7 (D3DTRANSFORMSTATETYPE)23
|
|
1170
|
|
1171 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1172
|
|
1173 typedef enum _D3DLIGHTSTATETYPE {
|
|
1174 D3DLIGHTSTATE_MATERIAL = 1,
|
|
1175 D3DLIGHTSTATE_AMBIENT = 2,
|
|
1176 D3DLIGHTSTATE_COLORMODEL = 3,
|
|
1177 D3DLIGHTSTATE_FOGMODE = 4,
|
|
1178 D3DLIGHTSTATE_FOGSTART = 5,
|
|
1179 D3DLIGHTSTATE_FOGEND = 6,
|
|
1180 D3DLIGHTSTATE_FOGDENSITY = 7,
|
|
1181 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1182 D3DLIGHTSTATE_COLORVERTEX = 8,
|
|
1183 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1184 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1185 D3DLIGHTSTATE_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1186 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1187 } D3DLIGHTSTATETYPE;
|
|
1188
|
|
1189 #if(DIRECT3D_VERSION < 0x0800)
|
|
1190
|
|
1191 typedef enum _D3DRENDERSTATETYPE {
|
|
1192 D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */
|
|
1193 D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */
|
|
1194 D3DRENDERSTATE_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
|
|
1195 D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */
|
|
1196 D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */
|
|
1197 D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */
|
|
1198 D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */
|
|
1199 D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
|
|
1200 D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
|
|
1201 D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */
|
|
1202 D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */
|
|
1203 D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */
|
|
1204 D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */
|
|
1205 D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */
|
|
1206 D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */
|
|
1207 D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */
|
|
1208 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1209 D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */
|
|
1210 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1211 D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */
|
|
1212 D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */
|
|
1213 D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */
|
|
1214 D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */
|
|
1215 D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */
|
|
1216 D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */
|
|
1217 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1218 D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */
|
|
1219 D3DRENDERSTATE_FOGEND = 37, /* Fog end */
|
|
1220 D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */
|
|
1221 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1222 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1223 D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */
|
|
1224 D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */
|
|
1225 D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */
|
|
1226 D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */
|
|
1227 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1228
|
|
1229 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1230 D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */
|
|
1231 D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */
|
|
1232 D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */
|
|
1233 D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */
|
|
1234 D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
|
|
1235 D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */
|
|
1236 D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */
|
|
1237 D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */
|
|
1238 D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */
|
|
1239 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1240
|
|
1241 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1242
|
|
1243 /*
|
|
1244 * 128 values [128, 255] are reserved for texture coordinate wrap flags.
|
|
1245 * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
|
|
1246 * a flags word preserves forward compatibility with texture coordinates
|
|
1247 * that are >2D.
|
|
1248 */
|
|
1249 D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */
|
|
1250 D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */
|
|
1251 D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */
|
|
1252 D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */
|
|
1253 D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */
|
|
1254 D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */
|
|
1255 D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */
|
|
1256 D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */
|
|
1257 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1258 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1259 D3DRENDERSTATE_CLIPPING = 136,
|
|
1260 D3DRENDERSTATE_LIGHTING = 137,
|
|
1261 D3DRENDERSTATE_EXTENTS = 138,
|
|
1262 D3DRENDERSTATE_AMBIENT = 139,
|
|
1263 D3DRENDERSTATE_FOGVERTEXMODE = 140,
|
|
1264 D3DRENDERSTATE_COLORVERTEX = 141,
|
|
1265 D3DRENDERSTATE_LOCALVIEWER = 142,
|
|
1266 D3DRENDERSTATE_NORMALIZENORMALS = 143,
|
|
1267 D3DRENDERSTATE_COLORKEYBLENDENABLE = 144,
|
|
1268 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145,
|
|
1269 D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146,
|
|
1270 D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147,
|
|
1271 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148,
|
|
1272 D3DRENDERSTATE_VERTEXBLEND = 151,
|
|
1273 D3DRENDERSTATE_CLIPPLANEENABLE = 152,
|
|
1274
|
|
1275 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1276
|
|
1277 //
|
|
1278 // retired renderstates - not supported for DX7 interfaces
|
|
1279 //
|
|
1280 D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */
|
|
1281 D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */
|
|
1282 D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */
|
|
1283 D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */
|
|
1284 D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */
|
|
1285 D3DRENDERSTATE_ROP2 = 12, /* ROP2 */
|
|
1286 D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */
|
|
1287 D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */
|
|
1288 D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */
|
|
1289 D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */
|
|
1290 D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */
|
|
1291 D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */
|
|
1292 D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */
|
|
1293 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1294 D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */
|
|
1295 D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */
|
|
1296 D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */
|
|
1297 D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */
|
|
1298 D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */
|
|
1299 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1300 D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */
|
|
1301 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1302 D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */
|
|
1303 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1304 D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */
|
|
1305 D3DRENDERSTATE_STIPPLEPATTERN01 = 65,
|
|
1306 D3DRENDERSTATE_STIPPLEPATTERN02 = 66,
|
|
1307 D3DRENDERSTATE_STIPPLEPATTERN03 = 67,
|
|
1308 D3DRENDERSTATE_STIPPLEPATTERN04 = 68,
|
|
1309 D3DRENDERSTATE_STIPPLEPATTERN05 = 69,
|
|
1310 D3DRENDERSTATE_STIPPLEPATTERN06 = 70,
|
|
1311 D3DRENDERSTATE_STIPPLEPATTERN07 = 71,
|
|
1312 D3DRENDERSTATE_STIPPLEPATTERN08 = 72,
|
|
1313 D3DRENDERSTATE_STIPPLEPATTERN09 = 73,
|
|
1314 D3DRENDERSTATE_STIPPLEPATTERN10 = 74,
|
|
1315 D3DRENDERSTATE_STIPPLEPATTERN11 = 75,
|
|
1316 D3DRENDERSTATE_STIPPLEPATTERN12 = 76,
|
|
1317 D3DRENDERSTATE_STIPPLEPATTERN13 = 77,
|
|
1318 D3DRENDERSTATE_STIPPLEPATTERN14 = 78,
|
|
1319 D3DRENDERSTATE_STIPPLEPATTERN15 = 79,
|
|
1320 D3DRENDERSTATE_STIPPLEPATTERN16 = 80,
|
|
1321 D3DRENDERSTATE_STIPPLEPATTERN17 = 81,
|
|
1322 D3DRENDERSTATE_STIPPLEPATTERN18 = 82,
|
|
1323 D3DRENDERSTATE_STIPPLEPATTERN19 = 83,
|
|
1324 D3DRENDERSTATE_STIPPLEPATTERN20 = 84,
|
|
1325 D3DRENDERSTATE_STIPPLEPATTERN21 = 85,
|
|
1326 D3DRENDERSTATE_STIPPLEPATTERN22 = 86,
|
|
1327 D3DRENDERSTATE_STIPPLEPATTERN23 = 87,
|
|
1328 D3DRENDERSTATE_STIPPLEPATTERN24 = 88,
|
|
1329 D3DRENDERSTATE_STIPPLEPATTERN25 = 89,
|
|
1330 D3DRENDERSTATE_STIPPLEPATTERN26 = 90,
|
|
1331 D3DRENDERSTATE_STIPPLEPATTERN27 = 91,
|
|
1332 D3DRENDERSTATE_STIPPLEPATTERN28 = 92,
|
|
1333 D3DRENDERSTATE_STIPPLEPATTERN29 = 93,
|
|
1334 D3DRENDERSTATE_STIPPLEPATTERN30 = 94,
|
|
1335 D3DRENDERSTATE_STIPPLEPATTERN31 = 95,
|
|
1336
|
|
1337 //
|
|
1338 // retired renderstate names - the values are still used under new naming conventions
|
|
1339 //
|
|
1340 D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */
|
|
1341 D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */
|
|
1342 D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */
|
|
1343
|
|
1344 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1345 D3DRENDERSTATE_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1346 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1347 } D3DRENDERSTATETYPE;
|
|
1348
|
|
1349 #else
|
|
1350
|
|
1351 typedef enum _D3DRENDERSTATETYPE D3DRENDERSTATETYPE;
|
|
1352
|
|
1353 //
|
|
1354 // legacy renderstate names
|
|
1355 //
|
|
1356 #define D3DRENDERSTATE_TEXTUREPERSPECTIVE (D3DRENDERSTATETYPE)4
|
|
1357 #define D3DRENDERSTATE_ZENABLE (D3DRENDERSTATETYPE)7
|
|
1358 #define D3DRENDERSTATE_FILLMODE (D3DRENDERSTATETYPE)8
|
|
1359 #define D3DRENDERSTATE_SHADEMODE (D3DRENDERSTATETYPE)9
|
|
1360 #define D3DRENDERSTATE_LINEPATTERN (D3DRENDERSTATETYPE)10
|
|
1361 #define D3DRENDERSTATE_ZWRITEENABLE (D3DRENDERSTATETYPE)14
|
|
1362 #define D3DRENDERSTATE_ALPHATESTENABLE (D3DRENDERSTATETYPE)15
|
|
1363 #define D3DRENDERSTATE_LASTPIXEL (D3DRENDERSTATETYPE)16
|
|
1364 #define D3DRENDERSTATE_SRCBLEND (D3DRENDERSTATETYPE)19
|
|
1365 #define D3DRENDERSTATE_DESTBLEND (D3DRENDERSTATETYPE)20
|
|
1366 #define D3DRENDERSTATE_CULLMODE (D3DRENDERSTATETYPE)22
|
|
1367 #define D3DRENDERSTATE_ZFUNC (D3DRENDERSTATETYPE)23
|
|
1368 #define D3DRENDERSTATE_ALPHAREF (D3DRENDERSTATETYPE)24
|
|
1369 #define D3DRENDERSTATE_ALPHAFUNC (D3DRENDERSTATETYPE)25
|
|
1370 #define D3DRENDERSTATE_DITHERENABLE (D3DRENDERSTATETYPE)26
|
|
1371 #define D3DRENDERSTATE_ALPHABLENDENABLE (D3DRENDERSTATETYPE)27
|
|
1372 #define D3DRENDERSTATE_FOGENABLE (D3DRENDERSTATETYPE)28
|
|
1373 #define D3DRENDERSTATE_SPECULARENABLE (D3DRENDERSTATETYPE)29
|
|
1374 #define D3DRENDERSTATE_ZVISIBLE (D3DRENDERSTATETYPE)30
|
|
1375 #define D3DRENDERSTATE_STIPPLEDALPHA (D3DRENDERSTATETYPE)33
|
|
1376 #define D3DRENDERSTATE_FOGCOLOR (D3DRENDERSTATETYPE)34
|
|
1377 #define D3DRENDERSTATE_FOGTABLEMODE (D3DRENDERSTATETYPE)35
|
|
1378 #define D3DRENDERSTATE_FOGSTART (D3DRENDERSTATETYPE)36
|
|
1379 #define D3DRENDERSTATE_FOGEND (D3DRENDERSTATETYPE)37
|
|
1380 #define D3DRENDERSTATE_FOGDENSITY (D3DRENDERSTATETYPE)38
|
|
1381 #define D3DRENDERSTATE_EDGEANTIALIAS (D3DRENDERSTATETYPE)40
|
|
1382 #define D3DRENDERSTATE_ZBIAS (D3DRENDERSTATETYPE)47
|
|
1383 #define D3DRENDERSTATE_RANGEFOGENABLE (D3DRENDERSTATETYPE)48
|
|
1384 #define D3DRENDERSTATE_STENCILENABLE (D3DRENDERSTATETYPE)52
|
|
1385 #define D3DRENDERSTATE_STENCILFAIL (D3DRENDERSTATETYPE)53
|
|
1386 #define D3DRENDERSTATE_STENCILZFAIL (D3DRENDERSTATETYPE)54
|
|
1387 #define D3DRENDERSTATE_STENCILPASS (D3DRENDERSTATETYPE)55
|
|
1388 #define D3DRENDERSTATE_STENCILFUNC (D3DRENDERSTATETYPE)56
|
|
1389 #define D3DRENDERSTATE_STENCILREF (D3DRENDERSTATETYPE)57
|
|
1390 #define D3DRENDERSTATE_STENCILMASK (D3DRENDERSTATETYPE)58
|
|
1391 #define D3DRENDERSTATE_STENCILWRITEMASK (D3DRENDERSTATETYPE)59
|
|
1392 #define D3DRENDERSTATE_TEXTUREFACTOR (D3DRENDERSTATETYPE)60
|
|
1393 #define D3DRENDERSTATE_WRAP0 (D3DRENDERSTATETYPE)128
|
|
1394 #define D3DRENDERSTATE_WRAP1 (D3DRENDERSTATETYPE)129
|
|
1395 #define D3DRENDERSTATE_WRAP2 (D3DRENDERSTATETYPE)130
|
|
1396 #define D3DRENDERSTATE_WRAP3 (D3DRENDERSTATETYPE)131
|
|
1397 #define D3DRENDERSTATE_WRAP4 (D3DRENDERSTATETYPE)132
|
|
1398 #define D3DRENDERSTATE_WRAP5 (D3DRENDERSTATETYPE)133
|
|
1399 #define D3DRENDERSTATE_WRAP6 (D3DRENDERSTATETYPE)134
|
|
1400 #define D3DRENDERSTATE_WRAP7 (D3DRENDERSTATETYPE)135
|
|
1401
|
|
1402 #define D3DRENDERSTATE_CLIPPING (D3DRENDERSTATETYPE)136
|
|
1403 #define D3DRENDERSTATE_LIGHTING (D3DRENDERSTATETYPE)137
|
|
1404 #define D3DRENDERSTATE_EXTENTS (D3DRENDERSTATETYPE)138
|
|
1405 #define D3DRENDERSTATE_AMBIENT (D3DRENDERSTATETYPE)139
|
|
1406 #define D3DRENDERSTATE_FOGVERTEXMODE (D3DRENDERSTATETYPE)140
|
|
1407 #define D3DRENDERSTATE_COLORVERTEX (D3DRENDERSTATETYPE)141
|
|
1408 #define D3DRENDERSTATE_LOCALVIEWER (D3DRENDERSTATETYPE)142
|
|
1409 #define D3DRENDERSTATE_NORMALIZENORMALS (D3DRENDERSTATETYPE)143
|
|
1410 #define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144
|
|
1411 #define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE (D3DRENDERSTATETYPE)145
|
|
1412 #define D3DRENDERSTATE_SPECULARMATERIALSOURCE (D3DRENDERSTATETYPE)146
|
|
1413 #define D3DRENDERSTATE_AMBIENTMATERIALSOURCE (D3DRENDERSTATETYPE)147
|
|
1414 #define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE (D3DRENDERSTATETYPE)148
|
|
1415 #define D3DRENDERSTATE_VERTEXBLEND (D3DRENDERSTATETYPE)151
|
|
1416 #define D3DRENDERSTATE_CLIPPLANEENABLE (D3DRENDERSTATETYPE)152
|
|
1417
|
|
1418 //
|
|
1419 // retired renderstates - not supported for DX7 interfaces
|
|
1420 //
|
|
1421 #define D3DRENDERSTATE_TEXTUREHANDLE (D3DRENDERSTATETYPE)1
|
|
1422 #define D3DRENDERSTATE_ANTIALIAS (D3DRENDERSTATETYPE)2
|
|
1423 #define D3DRENDERSTATE_TEXTUREADDRESS (D3DRENDERSTATETYPE)3
|
|
1424 #define D3DRENDERSTATE_WRAPU (D3DRENDERSTATETYPE)5
|
|
1425 #define D3DRENDERSTATE_WRAPV (D3DRENDERSTATETYPE)6
|
|
1426 #define D3DRENDERSTATE_MONOENABLE (D3DRENDERSTATETYPE)11
|
|
1427 #define D3DRENDERSTATE_ROP2 (D3DRENDERSTATETYPE)12
|
|
1428 #define D3DRENDERSTATE_PLANEMASK (D3DRENDERSTATETYPE)13
|
|
1429 #define D3DRENDERSTATE_TEXTUREMAG (D3DRENDERSTATETYPE)17
|
|
1430 #define D3DRENDERSTATE_TEXTUREMIN (D3DRENDERSTATETYPE)18
|
|
1431 #define D3DRENDERSTATE_TEXTUREMAPBLEND (D3DRENDERSTATETYPE)21
|
|
1432 #define D3DRENDERSTATE_SUBPIXEL (D3DRENDERSTATETYPE)31
|
|
1433 #define D3DRENDERSTATE_SUBPIXELX (D3DRENDERSTATETYPE)32
|
|
1434 #define D3DRENDERSTATE_STIPPLEENABLE (D3DRENDERSTATETYPE)39
|
|
1435 #define D3DRENDERSTATE_OLDALPHABLENDENABLE (D3DRENDERSTATETYPE)42
|
|
1436 #define D3DRENDERSTATE_BORDERCOLOR (D3DRENDERSTATETYPE)43
|
|
1437 #define D3DRENDERSTATE_TEXTUREADDRESSU (D3DRENDERSTATETYPE)44
|
|
1438 #define D3DRENDERSTATE_TEXTUREADDRESSV (D3DRENDERSTATETYPE)45
|
|
1439 #define D3DRENDERSTATE_MIPMAPLODBIAS (D3DRENDERSTATETYPE)46
|
|
1440 #define D3DRENDERSTATE_ANISOTROPY (D3DRENDERSTATETYPE)49
|
|
1441 #define D3DRENDERSTATE_FLUSHBATCH (D3DRENDERSTATETYPE)50
|
|
1442 #define D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT (D3DRENDERSTATETYPE)51
|
|
1443 #define D3DRENDERSTATE_STIPPLEPATTERN00 (D3DRENDERSTATETYPE)64
|
|
1444 #define D3DRENDERSTATE_STIPPLEPATTERN01 (D3DRENDERSTATETYPE)65
|
|
1445 #define D3DRENDERSTATE_STIPPLEPATTERN02 (D3DRENDERSTATETYPE)66
|
|
1446 #define D3DRENDERSTATE_STIPPLEPATTERN03 (D3DRENDERSTATETYPE)67
|
|
1447 #define D3DRENDERSTATE_STIPPLEPATTERN04 (D3DRENDERSTATETYPE)68
|
|
1448 #define D3DRENDERSTATE_STIPPLEPATTERN05 (D3DRENDERSTATETYPE)69
|
|
1449 #define D3DRENDERSTATE_STIPPLEPATTERN06 (D3DRENDERSTATETYPE)70
|
|
1450 #define D3DRENDERSTATE_STIPPLEPATTERN07 (D3DRENDERSTATETYPE)71
|
|
1451 #define D3DRENDERSTATE_STIPPLEPATTERN08 (D3DRENDERSTATETYPE)72
|
|
1452 #define D3DRENDERSTATE_STIPPLEPATTERN09 (D3DRENDERSTATETYPE)73
|
|
1453 #define D3DRENDERSTATE_STIPPLEPATTERN10 (D3DRENDERSTATETYPE)74
|
|
1454 #define D3DRENDERSTATE_STIPPLEPATTERN11 (D3DRENDERSTATETYPE)75
|
|
1455 #define D3DRENDERSTATE_STIPPLEPATTERN12 (D3DRENDERSTATETYPE)76
|
|
1456 #define D3DRENDERSTATE_STIPPLEPATTERN13 (D3DRENDERSTATETYPE)77
|
|
1457 #define D3DRENDERSTATE_STIPPLEPATTERN14 (D3DRENDERSTATETYPE)78
|
|
1458 #define D3DRENDERSTATE_STIPPLEPATTERN15 (D3DRENDERSTATETYPE)79
|
|
1459 #define D3DRENDERSTATE_STIPPLEPATTERN16 (D3DRENDERSTATETYPE)80
|
|
1460 #define D3DRENDERSTATE_STIPPLEPATTERN17 (D3DRENDERSTATETYPE)81
|
|
1461 #define D3DRENDERSTATE_STIPPLEPATTERN18 (D3DRENDERSTATETYPE)82
|
|
1462 #define D3DRENDERSTATE_STIPPLEPATTERN19 (D3DRENDERSTATETYPE)83
|
|
1463 #define D3DRENDERSTATE_STIPPLEPATTERN20 (D3DRENDERSTATETYPE)84
|
|
1464 #define D3DRENDERSTATE_STIPPLEPATTERN21 (D3DRENDERSTATETYPE)85
|
|
1465 #define D3DRENDERSTATE_STIPPLEPATTERN22 (D3DRENDERSTATETYPE)86
|
|
1466 #define D3DRENDERSTATE_STIPPLEPATTERN23 (D3DRENDERSTATETYPE)87
|
|
1467 #define D3DRENDERSTATE_STIPPLEPATTERN24 (D3DRENDERSTATETYPE)88
|
|
1468 #define D3DRENDERSTATE_STIPPLEPATTERN25 (D3DRENDERSTATETYPE)89
|
|
1469 #define D3DRENDERSTATE_STIPPLEPATTERN26 (D3DRENDERSTATETYPE)90
|
|
1470 #define D3DRENDERSTATE_STIPPLEPATTERN27 (D3DRENDERSTATETYPE)91
|
|
1471 #define D3DRENDERSTATE_STIPPLEPATTERN28 (D3DRENDERSTATETYPE)92
|
|
1472 #define D3DRENDERSTATE_STIPPLEPATTERN29 (D3DRENDERSTATETYPE)93
|
|
1473 #define D3DRENDERSTATE_STIPPLEPATTERN30 (D3DRENDERSTATETYPE)94
|
|
1474 #define D3DRENDERSTATE_STIPPLEPATTERN31 (D3DRENDERSTATETYPE)95
|
|
1475
|
|
1476 //
|
|
1477 // retired renderstates - not supported for DX8 interfaces
|
|
1478 //
|
|
1479 #define D3DRENDERSTATE_COLORKEYENABLE (D3DRENDERSTATETYPE)41
|
|
1480 #define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144
|
|
1481
|
|
1482 //
|
|
1483 // retired renderstate names - the values are still used under new naming conventions
|
|
1484 //
|
|
1485 #define D3DRENDERSTATE_BLENDENABLE (D3DRENDERSTATETYPE)27
|
|
1486 #define D3DRENDERSTATE_FOGTABLESTART (D3DRENDERSTATETYPE)36
|
|
1487 #define D3DRENDERSTATE_FOGTABLEEND (D3DRENDERSTATETYPE)37
|
|
1488 #define D3DRENDERSTATE_FOGTABLEDENSITY (D3DRENDERSTATETYPE)38
|
|
1489
|
|
1490 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1491
|
|
1492
|
|
1493 #if(DIRECT3D_VERSION < 0x0800)
|
|
1494
|
|
1495 // Values for material source
|
|
1496 typedef enum _D3DMATERIALCOLORSOURCE
|
|
1497 {
|
|
1498 D3DMCS_MATERIAL = 0, // Color from material is used
|
|
1499 D3DMCS_COLOR1 = 1, // Diffuse vertex color is used
|
|
1500 D3DMCS_COLOR2 = 2, // Specular vertex color is used
|
|
1501 D3DMCS_FORCEuint = 0x7fffffff, // force 32-bit size enum
|
|
1502 } D3DMATERIALCOLORSOURCE;
|
|
1503
|
|
1504
|
|
1505 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1506 // For back-compatibility with legacy compilations
|
|
1507 #define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE
|
|
1508 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1509
|
|
1510 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1511
|
|
1512 // Bias to apply to the texture coordinate set to apply a wrap to.
|
|
1513 #define D3DRENDERSTATE_WRAPBIAS 128UL
|
|
1514
|
|
1515 /* Flags to construct the WRAP render states */
|
|
1516 #define D3DWRAP_U 0x00000001L
|
|
1517 #define D3DWRAP_V 0x00000002L
|
|
1518
|
|
1519 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1520
|
|
1521 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1522
|
|
1523 /* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */
|
|
1524 #define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U
|
|
1525 #define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V
|
|
1526 #define D3DWRAPCOORD_2 0x00000004L
|
|
1527 #define D3DWRAPCOORD_3 0x00000008L
|
|
1528
|
|
1529 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1530
|
|
1531 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1532
|
|
1533 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
|
|
1534
|
|
1535 typedef struct _D3DSTATE {
|
|
1536 union {
|
|
1537 #if(DIRECT3D_VERSION < 0x0800)
|
|
1538 D3DTRANSFORMSTATETYPE dtstTransformStateType;
|
|
1539 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1540 D3DLIGHTSTATETYPE dlstLightStateType;
|
|
1541 D3DRENDERSTATETYPE drstRenderStateType;
|
|
1542 };
|
|
1543 union {
|
|
1544 DWORD dwArg[1];
|
|
1545 D3DVALUE dvArg[1];
|
|
1546 };
|
|
1547 } D3DSTATE, *LPD3DSTATE;
|
|
1548
|
|
1549
|
|
1550 /*
|
|
1551 * Operation used to load matrices
|
|
1552 * hDstMat = hSrcMat
|
|
1553 */
|
|
1554 typedef struct _D3DMATRIXLOAD {
|
|
1555 D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
|
|
1556 D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */
|
|
1557 } D3DMATRIXLOAD, *LPD3DMATRIXLOAD;
|
|
1558
|
|
1559 /*
|
|
1560 * Operation used to multiply matrices
|
|
1561 * hDstMat = hSrcMat1 * hSrcMat2
|
|
1562 */
|
|
1563 typedef struct _D3DMATRIXMULTIPLY {
|
|
1564 D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
|
|
1565 D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */
|
|
1566 D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */
|
|
1567 } D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY;
|
|
1568
|
|
1569 /*
|
|
1570 * Operation used to transform and light vertices.
|
|
1571 */
|
|
1572 typedef struct _D3DPROCESSVERTICES {
|
|
1573 DWORD dwFlags; /* Do we transform or light or just copy? */
|
|
1574 WORD wStart; /* Index to first vertex in source */
|
|
1575 WORD wDest; /* Index to first vertex in local buffer */
|
|
1576 DWORD dwCount; /* Number of vertices to be processed */
|
|
1577 DWORD dwReserved; /* Must be zero */
|
|
1578 } D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES;
|
|
1579
|
|
1580 #define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
|
|
1581 #define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
|
|
1582 #define D3DPROCESSVERTICES_COPY 0x00000002L
|
|
1583 #define D3DPROCESSVERTICES_OPMASK 0x00000007L
|
|
1584
|
|
1585 #define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
|
|
1586 #define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
|
|
1587
|
|
1588
|
|
1589 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1590
|
|
1591
|
|
1592 #if(DIRECT3D_VERSION < 0x0800)
|
|
1593
|
|
1594 /*
|
|
1595 * State enumerants for per-stage texture processing.
|
|
1596 */
|
|
1597 typedef enum _D3DTEXTURESTAGESTATETYPE
|
|
1598 {
|
|
1599 D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
|
|
1600 D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */
|
|
1601 D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */
|
|
1602 D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
|
|
1603 D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */
|
|
1604 D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */
|
|
1605 D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */
|
|
1606 D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */
|
|
1607 D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */
|
|
1608 D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */
|
|
1609 D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */
|
|
1610 D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */
|
|
1611 D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */
|
|
1612 D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */
|
|
1613 D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */
|
|
1614 D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */
|
|
1615 D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */
|
|
1616 D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */
|
|
1617 D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */
|
|
1618 D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
|
|
1619 D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */
|
|
1620 D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */
|
|
1621 D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */
|
|
1622 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1623 D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */
|
|
1624 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1625 D3DTSS_FORCEuint = 0x7fffffff, /* force 32-bit size enum */
|
|
1626 } D3DTEXTURESTAGESTATETYPE;
|
|
1627
|
|
1628 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1629 // Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
|
|
1630 // and normal in the camera space) should be taken as texture coordinates
|
|
1631 // Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
|
|
1632 //
|
|
1633 #define D3DTSS_TCI_PASSTHRU 0x00000000
|
|
1634 #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
|
|
1635 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
|
|
1636 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
|
|
1637 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1638
|
|
1639 /*
|
|
1640 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
|
|
1641 * texture processing stage controls in D3DRENDERSTATE.
|
|
1642 */
|
|
1643 typedef enum _D3DTEXTUREOP
|
|
1644 {
|
|
1645 // Control
|
|
1646 D3DTOP_DISABLE = 1, // disables stage
|
|
1647 D3DTOP_SELECTARG1 = 2, // the default
|
|
1648 D3DTOP_SELECTARG2 = 3,
|
|
1649
|
|
1650 // Modulate
|
|
1651 D3DTOP_MODULATE = 4, // multiply args together
|
|
1652 D3DTOP_MODULATE2X = 5, // multiply and 1 bit
|
|
1653 D3DTOP_MODULATE4X = 6, // multiply and 2 bits
|
|
1654
|
|
1655 // Add
|
|
1656 D3DTOP_ADD = 7, // add arguments together
|
|
1657 D3DTOP_ADDSIGNED = 8, // add with -0.5 bias
|
|
1658 D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit
|
|
1659 D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation
|
|
1660 D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product
|
|
1661 // Arg1 + Arg2 - Arg1*Arg2
|
|
1662 // = Arg1 + (1-Arg1)*Arg2
|
|
1663
|
|
1664 // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
|
|
1665 D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha
|
|
1666 D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha
|
|
1667 D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR
|
|
1668 // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
|
|
1669 D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha
|
|
1670 D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color
|
|
1671
|
|
1672 // Specular mapping
|
|
1673 D3DTOP_PREMODULATE = 17, // modulate with next texture before use
|
|
1674 D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
|
|
1675 // COLOROP only
|
|
1676 D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
|
|
1677 // COLOROP only
|
|
1678 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
|
|
1679 // COLOROP only
|
|
1680 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
|
|
1681 // COLOROP only
|
|
1682
|
|
1683 // Bump mapping
|
|
1684 D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
|
|
1685 D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
|
|
1686 // This can do either diffuse or specular bump mapping with correct input.
|
|
1687 // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
|
|
1688 // where each component has been scaled and offset to make it signed.
|
|
1689 // The result is replicated into all four (including alpha) channels.
|
|
1690 // This is a valid COLOROP only.
|
|
1691 D3DTOP_DOTPRODUCT3 = 24,
|
|
1692
|
|
1693 D3DTOP_FORCEuint = 0x7fffffff,
|
|
1694 } D3DTEXTUREOP;
|
|
1695
|
|
1696 /*
|
|
1697 * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
|
|
1698 * set in texture processing stage controls in D3DRENDERSTATE.
|
|
1699 */
|
|
1700 #define D3DTA_SELECTMASK 0x0000000f // mask for arg selector
|
|
1701 #define D3DTA_DIFFUSE 0x00000000 // select diffuse color
|
|
1702 #define D3DTA_CURRENT 0x00000001 // select result of previous stage
|
|
1703 #define D3DTA_TEXTURE 0x00000002 // select texture color
|
|
1704 #define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR
|
|
1705 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1706 #define D3DTA_SPECULAR 0x00000004 // select specular color
|
|
1707 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1708 #define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x
|
|
1709 #define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components
|
|
1710
|
|
1711 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1712
|
|
1713 /*
|
|
1714 * IDirect3DTexture2 State Filter Types
|
|
1715 */
|
|
1716 typedef enum _D3DTEXTUREMAGFILTER
|
|
1717 {
|
|
1718 D3DTFG_POINT = 1, // nearest
|
|
1719 D3DTFG_LINEAR = 2, // linear interpolation
|
|
1720 D3DTFG_FLATCUBIC = 3, // cubic
|
|
1721 D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel
|
|
1722 D3DTFG_ANISOTROPIC = 5, //
|
|
1723 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1724 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1725 D3DTFG_FORCEuint = 0x7fffffff, // force 32-bit size enum
|
|
1726 } D3DTEXTUREMAGFILTER;
|
|
1727
|
|
1728 typedef enum _D3DTEXTUREMINFILTER
|
|
1729 {
|
|
1730 D3DTFN_POINT = 1, // nearest
|
|
1731 D3DTFN_LINEAR = 2, // linear interpolation
|
|
1732 D3DTFN_ANISOTROPIC = 3, //
|
|
1733 D3DTFN_FORCEuint = 0x7fffffff, // force 32-bit size enum
|
|
1734 } D3DTEXTUREMINFILTER;
|
|
1735
|
|
1736 typedef enum _D3DTEXTUREMIPFILTER
|
|
1737 {
|
|
1738 D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter)
|
|
1739 D3DTFP_POINT = 2, // nearest
|
|
1740 D3DTFP_LINEAR = 3, // linear interpolation
|
|
1741 D3DTFP_FORCEuint = 0x7fffffff, // force 32-bit size enum
|
|
1742 } D3DTEXTUREMIPFILTER;
|
|
1743
|
|
1744 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
1745
|
|
1746 /*
|
|
1747 * Triangle flags
|
|
1748 */
|
|
1749
|
|
1750 /*
|
|
1751 * Tri strip and fan flags.
|
|
1752 * START loads all three vertices
|
|
1753 * EVEN and ODD load just v3 with even or odd culling
|
|
1754 * START_FLAT contains a count from 0 to 29 that allows the
|
|
1755 * whole strip or fan to be culled in one hit.
|
|
1756 * e.g. for a quad len = 1
|
|
1757 */
|
|
1758 #define D3DTRIFLAG_START 0x00000000L
|
|
1759 #define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */
|
|
1760 #define D3DTRIFLAG_ODD 0x0000001eL
|
|
1761 #define D3DTRIFLAG_EVEN 0x0000001fL
|
|
1762
|
|
1763 /*
|
|
1764 * Triangle edge flags
|
|
1765 * enable edges for wireframe or antialiasing
|
|
1766 */
|
|
1767 #define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */
|
|
1768 #define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */
|
|
1769 #define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */
|
|
1770 #define D3DTRIFLAG_EDGEENABLETRIANGLE \
|
|
1771 (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
|
|
1772
|
|
1773 /*
|
|
1774 * Primitive structures and related defines. Vertex offsets are to types
|
|
1775 * RenderVertexD3D3, D3DLVERTEX, or D3DTLVERTEX.
|
|
1776 */
|
|
1777
|
|
1778 /*
|
|
1779 * Triangle list primitive structure
|
|
1780 */
|
|
1781 typedef struct _D3DTRIANGLE {
|
|
1782 union {
|
|
1783 WORD v1; /* Vertex indices */
|
|
1784 WORD wV1;
|
|
1785 };
|
|
1786 union {
|
|
1787 WORD v2;
|
|
1788 WORD wV2;
|
|
1789 };
|
|
1790 union {
|
|
1791 WORD v3;
|
|
1792 WORD wV3;
|
|
1793 };
|
|
1794 WORD wFlags; /* Edge (and other) flags */
|
|
1795 } D3DTRIANGLE, *LPD3DTRIANGLE;
|
|
1796
|
|
1797 /*
|
|
1798 * Line list structure.
|
|
1799 * The instruction count defines the number of line segments.
|
|
1800 */
|
|
1801 typedef struct _D3DLINE {
|
|
1802 union {
|
|
1803 WORD v1; /* Vertex indices */
|
|
1804 WORD wV1;
|
|
1805 };
|
|
1806 union {
|
|
1807 WORD v2;
|
|
1808 WORD wV2;
|
|
1809 };
|
|
1810 } D3DLINE, *LPD3DLINE;
|
|
1811
|
|
1812 /*
|
|
1813 * Span structure
|
|
1814 * Spans join a list of points with the same y value.
|
|
1815 * If the y value changes, a new span is started.
|
|
1816 */
|
|
1817 typedef struct _D3DSPAN {
|
|
1818 WORD wCount; /* Number of spans */
|
|
1819 WORD wFirst; /* Index to first vertex */
|
|
1820 } D3DSPAN, *LPD3DSPAN;
|
|
1821
|
|
1822 /*
|
|
1823 * Point structure
|
|
1824 */
|
|
1825 typedef struct _D3DPOINT {
|
|
1826 WORD wCount; /* number of points */
|
|
1827 WORD wFirst; /* index to first vertex */
|
|
1828 } D3DPOINT, *LPD3DPOINT;
|
|
1829
|
|
1830
|
|
1831 /*
|
|
1832 * Forward branch structure.
|
|
1833 * Mask is logically anded with the driver status mask
|
|
1834 * if the result equals 'value', the branch is taken.
|
|
1835 */
|
|
1836 typedef struct _D3DBRANCH {
|
|
1837 DWORD dwMask; /* Bitmask against D3D status */
|
|
1838 DWORD dwValue;
|
|
1839 BOOL bNegate; /* TRUE to negate comparison */
|
|
1840 DWORD dwOffset; /* How far to branch forward (0 for exit)*/
|
|
1841 } D3DBRANCH, *LPD3DBRANCH;
|
|
1842
|
|
1843 /*
|
|
1844 * Status used for set status instruction.
|
|
1845 * The D3D status is initialised on device creation
|
|
1846 * and is modified by all execute calls.
|
|
1847 */
|
|
1848 typedef struct _D3DSTATUS {
|
|
1849 DWORD dwFlags; /* Do we set extents or status */
|
|
1850 DWORD dwStatus; /* D3D status */
|
|
1851 D3DRECT drExtent;
|
|
1852 } D3DSTATUS, *LPD3DSTATUS;
|
|
1853
|
|
1854 #define D3DSETSTATUS_STATUS 0x00000001L
|
|
1855 #define D3DSETSTATUS_EXTENTS 0x00000002L
|
|
1856 #define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
|
|
1857
|
|
1858 #if(DIRECT3D_VERSION >= 0x0500)
|
|
1859 typedef struct _D3DCLIPSTATUS {
|
|
1860 DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */
|
|
1861 DWORD dwStatus; /* Clip status */
|
|
1862 float minx, maxx; /* X extents */
|
|
1863 float miny, maxy; /* Y extents */
|
|
1864 float minz, maxz; /* Z extents */
|
|
1865 } D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
|
|
1866
|
|
1867 #define D3DCLIPSTATUS_STATUS 0x00000001L
|
|
1868 #define D3DCLIPSTATUS_EXTENTS2 0x00000002L
|
|
1869 #define D3DCLIPSTATUS_EXTENTS3 0x00000004L
|
|
1870
|
|
1871 #endif /* DIRECT3D_VERSION >= 0x0500 */
|
|
1872 /*
|
|
1873 * Statistics structure
|
|
1874 */
|
|
1875 typedef struct _D3DSTATS {
|
|
1876 DWORD dwSize;
|
|
1877 DWORD dwTrianglesDrawn;
|
|
1878 DWORD dwLinesDrawn;
|
|
1879 DWORD dwPointsDrawn;
|
|
1880 DWORD dwSpansDrawn;
|
|
1881 DWORD dwVerticesProcessed;
|
|
1882 } D3DSTATS, *LPD3DSTATS;
|
|
1883
|
|
1884 /*
|
|
1885 * Execute options.
|
|
1886 * When calling using D3DEXECUTE_UNCLIPPED all the primitives
|
|
1887 * inside the buffer must be contained within the OldViewport.
|
|
1888 */
|
|
1889 #define D3DEXECUTE_CLIPPED 0x00000001l
|
|
1890 #define D3DEXECUTE_UNCLIPPED 0x00000002l
|
|
1891
|
|
1892 typedef struct _D3DEXECUTEDATA {
|
|
1893 DWORD dwSize;
|
|
1894 DWORD dwVertexOffset;
|
|
1895 DWORD dwVertexCount;
|
|
1896 DWORD dwInstructionOffset;
|
|
1897 DWORD dwInstructionLength;
|
|
1898 DWORD dwHVertexOffset;
|
|
1899 D3DSTATUS dsStatus; /* Status after execute */
|
|
1900 } D3DEXECUTEDATA, *LPD3DEXECUTEDATA;
|
|
1901
|
|
1902 /*
|
|
1903 * Palette flags.
|
|
1904 * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
|
|
1905 */
|
|
1906 #define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */
|
|
1907 #define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */
|
|
1908 #define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */
|
|
1909
|
|
1910
|
|
1911 #if(DIRECT3D_VERSION >= 0x0600)
|
|
1912
|
|
1913 typedef struct _D3DVERTEXBUFFERDESC {
|
|
1914 DWORD dwSize;
|
|
1915 DWORD dwCaps;
|
|
1916 DWORD dwFVF;
|
|
1917 DWORD dwNumVertices;
|
|
1918 } D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
|
|
1919
|
|
1920 #define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
|
|
1921 #define D3DVBCAPS_WRITEONLY 0x00010000l
|
|
1922 #define D3DVBCAPS_OPTIMIZED 0x80000000l
|
|
1923 #define D3DVBCAPS_DONOTCLIP 0x00000001l
|
|
1924
|
|
1925 /* Vertex Operations for ProcessVertices */
|
|
1926 #define D3DVOP_LIGHT (1 << 10)
|
|
1927 #define D3DVOP_TRANSFORM (1 << 0)
|
|
1928 #define D3DVOP_CLIP (1 << 2)
|
|
1929 #define D3DVOP_EXTENTS (1 << 3)
|
|
1930
|
|
1931
|
|
1932 #if(DIRECT3D_VERSION < 0x0800)
|
|
1933
|
|
1934 /* The maximum number of vertices user can pass to any d3d
|
|
1935 drawing function or to create vertex buffer with
|
|
1936 */
|
|
1937 #define D3DMAXNUMVERTICES ((1<<16) - 1)
|
|
1938 /* The maximum number of primitives user can pass to any d3d
|
|
1939 drawing function.
|
|
1940 */
|
|
1941 #define D3DMAXNUMPRIMITIVES ((1<<16) - 1)
|
|
1942
|
|
1943 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1944
|
|
1945 /* Bits for dwFlags in ProcessVertices call */
|
|
1946 #define D3DPV_DONOTCOPYDATA (1 << 0)
|
|
1947
|
|
1948 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1949
|
|
1950 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1951
|
|
1952 //-------------------------------------------------------------------
|
|
1953
|
|
1954 #if(DIRECT3D_VERSION < 0x0800)
|
|
1955
|
|
1956 // Flexible vertex format bits
|
|
1957 //
|
|
1958 #define D3DFVF_RESERVED0 0x001
|
|
1959 #define D3DFVF_POSITION_MASK 0x00E
|
|
1960 #define D3DFVF_XYZ 0x002
|
|
1961 #define D3DFVF_XYZRHW 0x004
|
|
1962 #if(DIRECT3D_VERSION >= 0x0700)
|
|
1963 #define D3DFVF_XYZB1 0x006
|
|
1964 #define D3DFVF_XYZB2 0x008
|
|
1965 #define D3DFVF_XYZB3 0x00a
|
|
1966 #define D3DFVF_XYZB4 0x00c
|
|
1967 #define D3DFVF_XYZB5 0x00e
|
|
1968
|
|
1969 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
1970 #define D3DFVF_NORMAL 0x010
|
|
1971 #define D3DFVF_RESERVED1 0x020
|
|
1972 #define D3DFVF_DIFFUSE 0x040
|
|
1973 #define D3DFVF_SPECULAR 0x080
|
|
1974
|
|
1975 #define D3DFVF_TEXCOUNT_MASK 0xf00
|
|
1976 #define D3DFVF_TEXCOUNT_SHIFT 8
|
|
1977 #define D3DFVF_TEX0 0x000
|
|
1978 #define D3DFVF_TEX1 0x100
|
|
1979 #define D3DFVF_TEX2 0x200
|
|
1980 #define D3DFVF_TEX3 0x300
|
|
1981 #define D3DFVF_TEX4 0x400
|
|
1982 #define D3DFVF_TEX5 0x500
|
|
1983 #define D3DFVF_TEX6 0x600
|
|
1984 #define D3DFVF_TEX7 0x700
|
|
1985 #define D3DFVF_TEX8 0x800
|
|
1986
|
|
1987 #define D3DFVF_RESERVED2 0xf000 // 4 reserved bits
|
|
1988
|
|
1989 #else
|
|
1990 #define D3DFVF_RESERVED1 0x020
|
|
1991 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
1992
|
|
1993 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
|
|
1994 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
|
|
1995 D3DFVF_SPECULAR | D3DFVF_TEX1 )
|
|
1996 #define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
|
|
1997 D3DFVF_TEX1 )
|
|
1998
|
|
1999
|
|
2000 typedef struct _D3DDP_PTRSTRIDE
|
|
2001 {
|
|
2002 LPVOID lpvData;
|
|
2003 DWORD dwStride;
|
|
2004 } D3DDP_PTRSTRIDE;
|
|
2005
|
|
2006 #define D3DDP_MAXTEXCOORD 8
|
|
2007
|
|
2008 typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
|
|
2009 {
|
|
2010 D3DDP_PTRSTRIDE position;
|
|
2011 D3DDP_PTRSTRIDE normal;
|
|
2012 D3DDP_PTRSTRIDE diffuse;
|
|
2013 D3DDP_PTRSTRIDE specular;
|
|
2014 D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
|
|
2015 } D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA;
|
|
2016 //---------------------------------------------------------------------
|
|
2017 // ComputeSphereVisibility return values
|
|
2018 //
|
|
2019 #define D3DVIS_INSIDE_FRUSTUM 0
|
|
2020 #define D3DVIS_INTERSECT_FRUSTUM 1
|
|
2021 #define D3DVIS_OUTSIDE_FRUSTUM 2
|
|
2022 #define D3DVIS_INSIDE_LEFT 0
|
|
2023 #define D3DVIS_INTERSECT_LEFT (1 << 2)
|
|
2024 #define D3DVIS_OUTSIDE_LEFT (2 << 2)
|
|
2025 #define D3DVIS_INSIDE_RIGHT 0
|
|
2026 #define D3DVIS_INTERSECT_RIGHT (1 << 4)
|
|
2027 #define D3DVIS_OUTSIDE_RIGHT (2 << 4)
|
|
2028 #define D3DVIS_INSIDE_TOP 0
|
|
2029 #define D3DVIS_INTERSECT_TOP (1 << 6)
|
|
2030 #define D3DVIS_OUTSIDE_TOP (2 << 6)
|
|
2031 #define D3DVIS_INSIDE_BOTTOM 0
|
|
2032 #define D3DVIS_INTERSECT_BOTTOM (1 << 8)
|
|
2033 #define D3DVIS_OUTSIDE_BOTTOM (2 << 8)
|
|
2034 #define D3DVIS_INSIDE_NEAR 0
|
|
2035 #define D3DVIS_INTERSECT_NEAR (1 << 10)
|
|
2036 #define D3DVIS_OUTSIDE_NEAR (2 << 10)
|
|
2037 #define D3DVIS_INSIDE_FAR 0
|
|
2038 #define D3DVIS_INTERSECT_FAR (1 << 12)
|
|
2039 #define D3DVIS_OUTSIDE_FAR (2 << 12)
|
|
2040
|
|
2041 #define D3DVIS_MASK_FRUSTUM (3 << 0)
|
|
2042 #define D3DVIS_MASK_LEFT (3 << 2)
|
|
2043 #define D3DVIS_MASK_RIGHT (3 << 4)
|
|
2044 #define D3DVIS_MASK_TOP (3 << 6)
|
|
2045 #define D3DVIS_MASK_BOTTOM (3 << 8)
|
|
2046 #define D3DVIS_MASK_NEAR (3 << 10)
|
|
2047 #define D3DVIS_MASK_FAR (3 << 12)
|
|
2048
|
|
2049 #endif /* DIRECT3D_VERSION >= 0x0600 */
|
|
2050
|
|
2051 #if(DIRECT3D_VERSION < 0x0800)
|
|
2052
|
|
2053 #if(DIRECT3D_VERSION >= 0x0700)
|
|
2054
|
|
2055 // To be used with GetInfo()
|
|
2056 #define D3DDEVINFOID_TEXTUREMANAGER 1
|
|
2057 #define D3DDEVINFOID_D3DTEXTUREMANAGER 2
|
|
2058 #define D3DDEVINFOID_TEXTURING 3
|
|
2059
|
|
2060 typedef enum _D3DSTATEBLOCKTYPE
|
|
2061 {
|
|
2062 D3DSBT_ALL = 1, // capture all state
|
|
2063 D3DSBT_PIXELSTATE = 2, // capture pixel state
|
|
2064 D3DSBT_VERTEXSTATE = 3, // capture vertex state
|
|
2065 D3DSBT_FORCEuint = 0xffffffff
|
|
2066 } D3DSTATEBLOCKTYPE;
|
|
2067
|
|
2068 // The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
|
|
2069 //
|
|
2070 typedef enum _D3DVERTEXBLENDFLAGS
|
|
2071 {
|
|
2072 D3DVBLEND_DISABLE = 0, // Disable vertex blending
|
|
2073 D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices
|
|
2074 D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices
|
|
2075 D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices
|
|
2076 } D3DVERTEXBLENDFLAGS;
|
|
2077
|
|
2078 typedef enum _D3DTEXTURETRANSFORMFLAGS {
|
|
2079 D3DTTFF_DISABLE = 0, // texture coordinates are passed directly
|
|
2080 D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords
|
|
2081 D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords
|
|
2082 D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords
|
|
2083 D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords
|
|
2084 D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element
|
|
2085 D3DTTFF_FORCEuint = 0x7fffffff,
|
|
2086 } D3DTEXTURETRANSFORMFLAGS;
|
|
2087
|
|
2088 // Macros to set texture coordinate format bits in the FVF id
|
|
2089
|
|
2090 #define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values
|
|
2091 #define D3DFVF_TEXTUREFORMAT1 3 // One floating point value
|
|
2092 #define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values
|
|
2093 #define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values
|
|
2094
|
|
2095 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
|
|
2096 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
|
|
2097 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
|
|
2098 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
|
|
2099
|
|
2100
|
|
2101 #endif /* DIRECT3D_VERSION >= 0x0700 */
|
|
2102
|
|
2103 #else
|
|
2104 //
|
|
2105 // legacy vertex blend names
|
|
2106 //
|
|
2107 typedef enum _D3DVERTEXBLENDFLAGS D3DVERTEXBLENDFLAGS;
|
|
2108 #define D3DVBLEND_DISABLE (D3DVERTEXBLENDFLAGS)0
|
|
2109 #define D3DVBLEND_1WEIGHT (D3DVERTEXBLENDFLAGS)1
|
|
2110 #define D3DVBLEND_2WEIGHTS (D3DVERTEXBLENDFLAGS)2
|
|
2111 #define D3DVBLEND_3WEIGHTS (D3DVERTEXBLENDFLAGS)3
|
|
2112
|
|
2113 #endif //(DIRECT3D_VERSION < 0x0800)
|
|
2114
|
|
2115 #pragma pack()
|
|
2116 #pragma warning(default:4201)
|
|
2117
|
|
2118 #endif /* _D3DTYPES_H_ */
|
|
2119
|