annotate lib/legacy_dx/d3dtypes.h @ 357:b07cf89108d5

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