DXGL r65 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r64‎ | r65 | r66 >
Date:02:14, 1 January 2012
Author:admin
Status:new
Tags:
Comment:
Set default D3D render state on device creation
Modified paths:
  • /ddraw/glDirect3DDevice.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.h (modified) (history)
  • /ddraw/glDirectDrawSurface.h (modified) (history)
  • /ddraw/include/d3dtypes.h (modified) (history)

Diff [purge]

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