dsound: Implement QueryInterface for KsPropertySet objects.
[wine] / include / wine / wined3d_types.h
1 /*
2  * Direct3D wine types include file
3  *
4  * Copyright 2002-2003 The wine-d3d team
5  * Copyright 2002-2003 Jason Edmeades
6  *                     Raphael Junqueira
7  * Copyright 2005 Oliver Stieber
8  * Copyright 2006 Stefan Dösinger
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24
25 #ifndef __WINE_WINED3D_TYPES_H
26 #define __WINE_WINED3D_TYPES_H
27
28 typedef DWORD WINED3DCOLOR;
29
30 typedef enum _WINED3DLIGHTTYPE {
31   WINED3DLIGHT_POINT          = 1,
32   WINED3DLIGHT_SPOT           = 2,
33   WINED3DLIGHT_DIRECTIONAL    = 3,
34   WINED3DLIGHT_PARALLELPOINT  = 4, /* D3D7 */
35   WINED3DLIGHT_GLSPOT         = 5, /* D3D7 */
36   WINED3DLIGHT_FORCE_DWORD    = 0x7fffffff
37 } WINED3DLIGHTTYPE;
38
39 typedef enum _WINED3DPRIMITIVETYPE {
40     WINED3DPT_POINTLIST       = 1,
41     WINED3DPT_LINELIST        = 2,
42     WINED3DPT_LINESTRIP       = 3,
43     WINED3DPT_TRIANGLELIST    = 4,
44     WINED3DPT_TRIANGLESTRIP   = 5,
45     WINED3DPT_TRIANGLEFAN     = 6,
46
47     WINED3DPT_FORCE_DWORD     = 0x7fffffff
48 } WINED3DPRIMITIVETYPE;
49
50 typedef struct _WINED3DCOLORVALUE {
51     float r;
52     float g;
53     float b;
54     float a;
55 } WINED3DCOLORVALUE;
56
57 typedef struct _WINED3DVECTOR {
58     float x;
59     float y;
60     float z;
61 } WINED3DVECTOR;
62
63 typedef struct _WINED3DMATRIX {
64     union {
65         struct {
66             float        _11, _12, _13, _14;
67             float        _21, _22, _23, _24;
68             float        _31, _32, _33, _34;
69             float        _41, _42, _43, _44;
70         } DUMMYSTRUCTNAME;
71         float m[4][4];
72     } DUMMYUNIONNAME;
73 } WINED3DMATRIX;
74
75 typedef struct _WINED3DRECT {
76     LONG x1;
77     LONG y1;
78     LONG x2;
79     LONG y2;
80 } WINED3DRECT;
81
82 typedef struct _WINED3DLIGHT {
83     WINED3DLIGHTTYPE    Type;
84     WINED3DCOLORVALUE   Diffuse;
85     WINED3DCOLORVALUE   Specular;
86     WINED3DCOLORVALUE   Ambient;
87     WINED3DVECTOR       Position;
88     WINED3DVECTOR       Direction;
89     float               Range;
90     float               Falloff;
91     float               Attenuation0;
92     float               Attenuation1;
93     float               Attenuation2;
94     float               Theta;
95     float               Phi;
96 } WINED3DLIGHT;
97
98 typedef struct _WINED3DMATERIAL {
99     WINED3DCOLORVALUE   Diffuse;
100     WINED3DCOLORVALUE   Ambient;
101     WINED3DCOLORVALUE   Specular;
102     WINED3DCOLORVALUE   Emissive;
103     float           Power;
104 } WINED3DMATERIAL;
105
106 typedef struct _WINED3DVIEWPORT {
107     DWORD       X;
108     DWORD       Y;
109     DWORD       Width;
110     DWORD       Height;
111     float       MinZ;
112     float       MaxZ;
113 } WINED3DVIEWPORT;
114
115 typedef struct _WINED3DGAMMARAMP {
116     WORD                red  [256];
117     WORD                green[256];
118     WORD                blue [256];
119 } WINED3DGAMMARAMP;
120
121 typedef struct _WINED3DLINEPATTERN {
122     WORD    wRepeatFactor;
123     WORD    wLinePattern;
124 } WINED3DLINEPATTERN;
125
126 #define WINED3D_VSHADER_MAX_CONSTANTS 96
127 #define WINED3D_PSHADER_MAX_CONSTANTS 32
128
129 typedef struct _WINED3DVECTOR_3 {
130     float x;
131     float y;
132     float z;
133 } WINED3DVECTOR_3;
134
135 typedef struct _WINED3DVECTOR_4 {
136     float x;
137     float y;
138     float z;
139     float w;
140 } WINED3DVECTOR_4;
141
142 typedef struct WINED3DSHADERVECTOR {
143   float x;
144   float y;
145   float z;
146   float w;
147 } WINED3DSHADERVECTOR;
148
149 typedef struct WINED3DSHADERSCALAR {
150   float x;
151 } WINED3DSHADERSCALAR;
152
153 typedef WINED3DSHADERVECTOR WINEVSHADERCONSTANTS8[WINED3D_VSHADER_MAX_CONSTANTS];
154
155 typedef struct VSHADERDATA {
156   /** Run Time Shader Function Constants */
157   /*D3DXBUFFER* constants;*/
158   WINEVSHADERCONSTANTS8 C;
159   /** Shader Code as char ... */
160   CONST DWORD* code;
161   UINT codeLength;
162 } VSHADERDATA;
163
164 /** temporary here waiting for buffer code */
165 typedef struct VSHADERINPUTDATA {
166   WINED3DSHADERVECTOR V[17];
167 } WINEVSHADERINPUTDATA;
168
169 /** temporary here waiting for buffer code */
170 typedef struct VSHADEROUTPUTDATA {
171   WINED3DSHADERVECTOR oPos;
172   WINED3DSHADERVECTOR oD[2];
173   WINED3DSHADERVECTOR oT[8];
174   WINED3DSHADERVECTOR oFog;
175   WINED3DSHADERVECTOR oPts;
176 } WINEVSHADEROUTPUTDATA;
177
178 typedef WINED3DSHADERVECTOR WINEPSHADERCONSTANTS8[WINED3D_PSHADER_MAX_CONSTANTS];
179
180 typedef struct PSHADERDATA {
181   /** Run Time Shader Function Constants */
182   /*D3DXBUFFER* constants;*/
183   WINEPSHADERCONSTANTS8 C;
184   /** Shader Code as char ... */
185   CONST DWORD* code;
186   UINT codeLength;
187 } PSHADERDATA;
188
189 /** temporary here waiting for buffer code */
190 typedef struct PSHADERINPUTDATA {
191   WINED3DSHADERVECTOR V[2];
192   WINED3DSHADERVECTOR T[8];
193   WINED3DSHADERVECTOR S[16];
194   /*D3DSHADERVECTOR R[12];*/
195 } WINEPSHADERINPUTDATA;
196
197 /** temporary here waiting for buffer code */
198 typedef struct PSHADEROUTPUTDATA {
199   WINED3DSHADERVECTOR oC[4];
200   WINED3DSHADERVECTOR oDepth;
201 } WINEPSHADEROUTPUTDATA;
202
203 /*****************************************************************************
204  * WineD3D Structures to be used when d3d8 and d3d9 are incompatible
205  */
206
207
208 typedef enum _WINED3DDEVTYPE {
209     WINED3DDEVTYPE_HAL         = 1,
210     WINED3DDEVTYPE_REF         = 2,
211     WINED3DDEVTYPE_SW          = 3,
212     WINED3DDEVTYPE_NULLREF     = 4,
213
214     WINED3DDEVTYPE_FORCE_DWORD = 0xffffffff
215 } WINED3DDEVTYPE;
216
217 typedef enum _WINED3DDEGREETYPE {
218     WINED3DDEGREE_LINEAR      = 1,
219     WINED3DDEGREE_QUADRATIC   = 2,
220     WINED3DDEGREE_CUBIC       = 3,
221     WINED3DDEGREE_QUINTIC     = 5,
222     
223     WINED3DDEGREE_FORCE_DWORD   = 0x7fffffff
224 } WINED3DDEGREETYPE;
225
226 #define WINEMAKEFOURCC(ch0, ch1, ch2, ch3)  \
227     ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |  \
228     ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
229
230 typedef enum _WINED3DFORMAT {
231     WINED3DFMT_UNKNOWN              =   0,
232
233     WINED3DFMT_R8G8B8               =  20,
234     WINED3DFMT_A8R8G8B8             =  21,
235     WINED3DFMT_X8R8G8B8             =  22,
236     WINED3DFMT_R5G6B5               =  23,
237     WINED3DFMT_X1R5G5B5             =  24,
238     WINED3DFMT_A1R5G5B5             =  25,
239     WINED3DFMT_A4R4G4B4             =  26,
240     WINED3DFMT_R3G3B2               =  27,
241     WINED3DFMT_A8                   =  28,
242     WINED3DFMT_A8R3G3B2             =  29,
243     WINED3DFMT_X4R4G4B4             =  30,
244     WINED3DFMT_A2B10G10R10          =  31,
245     WINED3DFMT_A8B8G8R8             =  32,
246     WINED3DFMT_X8B8G8R8             =  33,
247     WINED3DFMT_G16R16               =  34,
248     WINED3DFMT_A2R10G10B10          =  35,
249     WINED3DFMT_A16B16G16R16         =  36,
250   
251
252     WINED3DFMT_A8P8                 =  40,
253     WINED3DFMT_P8                   =  41,
254
255     WINED3DFMT_L8                   =  50,
256     WINED3DFMT_A8L8                 =  51,
257     WINED3DFMT_A4L4                 =  52,
258
259     WINED3DFMT_V8U8                 =  60,
260     WINED3DFMT_L6V5U5               =  61,
261     WINED3DFMT_X8L8V8U8             =  62,
262     WINED3DFMT_Q8W8V8U8             =  63,
263     WINED3DFMT_V16U16               =  64,
264     WINED3DFMT_W11V11U10            =  65,
265     WINED3DFMT_A2W10V10U10          =  67,
266
267     WINED3DFMT_UYVY                 =  WINEMAKEFOURCC('U', 'Y', 'V', 'Y'),
268     WINED3DFMT_YUY2                 =  WINEMAKEFOURCC('Y', 'U', 'Y', '2'),
269     WINED3DFMT_DXT1                 =  WINEMAKEFOURCC('D', 'X', 'T', '1'),
270     WINED3DFMT_DXT2                 =  WINEMAKEFOURCC('D', 'X', 'T', '2'),
271     WINED3DFMT_DXT3                 =  WINEMAKEFOURCC('D', 'X', 'T', '3'),
272     WINED3DFMT_DXT4                 =  WINEMAKEFOURCC('D', 'X', 'T', '4'),
273     WINED3DFMT_DXT5                 =  WINEMAKEFOURCC('D', 'X', 'T', '5'),
274     WINED3DFMT_MULTI2_ARGB8         =  WINEMAKEFOURCC('M', 'E', 'T', '1'),
275     WINED3DFMT_G8R8_G8B8            =  WINEMAKEFOURCC('G', 'R', 'G', 'B'),
276     WINED3DFMT_R8G8_B8G8            =  WINEMAKEFOURCC('R', 'G', 'B', 'G'),
277
278     WINED3DFMT_D16_LOCKABLE         =  70,
279     WINED3DFMT_D32                  =  71,
280     WINED3DFMT_D15S1                =  73,
281     WINED3DFMT_D24S8                =  75,
282     WINED3DFMT_D24X8                =  77,
283     WINED3DFMT_D24X4S4              =  79,
284     WINED3DFMT_D16                  =  80,
285     WINED3DFMT_L16                  =  81,
286     WINED3DFMT_D32F_LOCKABLE        =  82,
287     WINED3DFMT_D24FS8               =  83,
288
289     WINED3DFMT_VERTEXDATA           = 100,
290     WINED3DFMT_INDEX16              = 101,
291     WINED3DFMT_INDEX32              = 102,
292     WINED3DFMT_Q16W16V16U16         = 110,
293     /* Floating point formats */
294     WINED3DFMT_R16F                 = 111,
295     WINED3DFMT_G16R16F              = 112,
296     WINED3DFMT_A16B16G16R16F        = 113,
297     
298     /* IEEE formats */
299     WINED3DFMT_R32F                 = 114,
300     WINED3DFMT_G32R32F              = 115,
301     WINED3DFMT_A32B32G32R32F        = 116,
302     
303     WINED3DFMT_CxV8U8               = 117,
304
305
306     WINED3DFMT_FORCE_DWORD          = 0xFFFFFFFF
307 } WINED3DFORMAT;
308
309 typedef enum _WINED3DRENDERSTATETYPE {
310     WINED3DRS_TEXTUREHANDLE             =   1, /* d3d7 */
311     WINED3DRS_ANTIALIAS                 =   2, /* d3d7 */
312     WINED3DRS_TEXTUREADDRESS            =   3, /* d3d7 */
313     WINED3DRS_TEXTUREPERSPECTIVE        =   4, /* d3d7 */
314     WINED3DRS_WRAPU                     =   5, /* d3d7 */
315     WINED3DRS_WRAPV                     =   6, /* d3d7 */
316     WINED3DRS_ZENABLE                   =   7,
317     WINED3DRS_FILLMODE                  =   8,
318     WINED3DRS_SHADEMODE                 =   9,
319     WINED3DRS_LINEPATTERN               =  10, /* d3d7, d3d8 */
320     WINED3DRS_MONOENABLE                =  11, /* d3d7 */
321     WINED3DRS_ROP2                      =  12, /* d3d7 */
322     WINED3DRS_PLANEMASK                 =  13, /* d3d7 */
323     WINED3DRS_ZWRITEENABLE              =  14,
324     WINED3DRS_ALPHATESTENABLE           =  15,
325     WINED3DRS_LASTPIXEL                 =  16,
326     WINED3DRS_TEXTUREMAG                =  17, /* d3d7 */
327     WINED3DRS_TEXTUREMIN                =  18, /* d3d7 */
328     WINED3DRS_SRCBLEND                  =  19,
329     WINED3DRS_DESTBLEND                 =  20,
330     WINED3DRS_TEXTUREMAPBLEND           =  21, /* d3d7 */
331     WINED3DRS_CULLMODE                  =  22,
332     WINED3DRS_ZFUNC                     =  23,
333     WINED3DRS_ALPHAREF                  =  24,
334     WINED3DRS_ALPHAFUNC                 =  25,
335     WINED3DRS_DITHERENABLE              =  26,
336     WINED3DRS_ALPHABLENDENABLE          =  27,
337     WINED3DRS_FOGENABLE                 =  28,
338     WINED3DRS_SPECULARENABLE            =  29,
339     WINED3DRS_ZVISIBLE                  =  30, /* d3d7, d3d8 */
340     WINED3DRS_SUBPIXEL                  =  31, /* d3d7 */
341     WINED3DRS_SUBPIXELX                 =  32, /* d3d7 */
342     WINED3DRS_STIPPLEDALPHA             =  33, /* d3d7 */
343     WINED3DRS_FOGCOLOR                  =  34,
344     WINED3DRS_FOGTABLEMODE              =  35,
345     WINED3DRS_FOGSTART                  =  36,
346     WINED3DRS_FOGEND                    =  37,
347     WINED3DRS_FOGDENSITY                =  38,
348     WINED3DRS_STIPPLEENABLE             =  39, /* d3d7 */
349     WINED3DRS_EDGEANTIALIAS             =  40, /* d3d7, d3d8 */
350     WINED3DRS_COLORKEYENABLE            =  41, /* d3d7 */
351     WINED3DRS_BORDERCOLOR               =  43, /* d3d7 */
352     WINED3DRS_TEXTUREADDRESSU           =  44, /* d3d7 */
353     WINED3DRS_TEXTUREADDRESSV           =  45, /* d3d7 */
354     WINED3DRS_MIPMAPLODBIAS             =  46, /* d3d7 */
355     WINED3DRS_ZBIAS                     =  47, /* d3d7, d3d8 */
356     WINED3DRS_RANGEFOGENABLE            =  48,
357     WINED3DRS_ANISOTROPY                =  49, /* d3d7 */
358     WINED3DRS_FLUSHBATCH                =  50, /* d3d7 */
359     WINED3DRS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */
360     WINED3DRS_STENCILENABLE             =  52,
361     WINED3DRS_STENCILFAIL               =  53,
362     WINED3DRS_STENCILZFAIL              =  54,
363     WINED3DRS_STENCILPASS               =  55,
364     WINED3DRS_STENCILFUNC               =  56,
365     WINED3DRS_STENCILREF                =  57,
366     WINED3DRS_STENCILMASK               =  58,
367     WINED3DRS_STENCILWRITEMASK          =  59,
368     WINED3DRS_TEXTUREFACTOR             =  60,
369
370     WINED3DRS_STIPPLEPATTERN00          = 64,
371     WINED3DRS_STIPPLEPATTERN01          = 65,
372     WINED3DRS_STIPPLEPATTERN02          = 66,
373     WINED3DRS_STIPPLEPATTERN03          = 67,
374     WINED3DRS_STIPPLEPATTERN04          = 68,
375     WINED3DRS_STIPPLEPATTERN05          = 69,
376     WINED3DRS_STIPPLEPATTERN06          = 70,
377     WINED3DRS_STIPPLEPATTERN07          = 71,
378     WINED3DRS_STIPPLEPATTERN08          = 72,
379     WINED3DRS_STIPPLEPATTERN09          = 73,
380     WINED3DRS_STIPPLEPATTERN10          = 74,
381     WINED3DRS_STIPPLEPATTERN11          = 75,
382     WINED3DRS_STIPPLEPATTERN12          = 76,
383     WINED3DRS_STIPPLEPATTERN13          = 77,
384     WINED3DRS_STIPPLEPATTERN14          = 78,
385     WINED3DRS_STIPPLEPATTERN15          = 79,
386     WINED3DRS_STIPPLEPATTERN16          = 80,
387     WINED3DRS_STIPPLEPATTERN17          = 81,
388     WINED3DRS_STIPPLEPATTERN18          = 82,
389     WINED3DRS_STIPPLEPATTERN19          = 83,
390     WINED3DRS_STIPPLEPATTERN20          = 84,
391     WINED3DRS_STIPPLEPATTERN21          = 85,
392     WINED3DRS_STIPPLEPATTERN22          = 86,
393     WINED3DRS_STIPPLEPATTERN23          = 87,
394     WINED3DRS_STIPPLEPATTERN24          = 88,
395     WINED3DRS_STIPPLEPATTERN25          = 89,
396     WINED3DRS_STIPPLEPATTERN26          = 90,
397     WINED3DRS_STIPPLEPATTERN27          = 91,
398     WINED3DRS_STIPPLEPATTERN28          = 92,
399     WINED3DRS_STIPPLEPATTERN29          = 93,
400     WINED3DRS_STIPPLEPATTERN30          = 94,
401     WINED3DRS_STIPPLEPATTERN31          = 95,
402
403     WINED3DRS_WRAP0                     = 128,
404     WINED3DRS_WRAP1                     = 129,
405     WINED3DRS_WRAP2                     = 130,
406     WINED3DRS_WRAP3                     = 131,
407     WINED3DRS_WRAP4                     = 132,
408     WINED3DRS_WRAP5                     = 133,
409     WINED3DRS_WRAP6                     = 134,
410     WINED3DRS_WRAP7                     = 135,
411     WINED3DRS_CLIPPING                  = 136,
412     WINED3DRS_LIGHTING                  = 137,
413     WINED3DRS_EXTENTS                   = 138, /* d3d7 */
414     WINED3DRS_AMBIENT                   = 139,
415     WINED3DRS_FOGVERTEXMODE             = 140,
416     WINED3DRS_COLORVERTEX               = 141,
417     WINED3DRS_LOCALVIEWER               = 142,
418     WINED3DRS_NORMALIZENORMALS          = 143,
419     WINED3DRS_COLORKEYBLENDENABLE       = 144, /* d3d7 */
420     WINED3DRS_DIFFUSEMATERIALSOURCE     = 145,
421     WINED3DRS_SPECULARMATERIALSOURCE    = 146,
422     WINED3DRS_AMBIENTMATERIALSOURCE     = 147,
423     WINED3DRS_EMISSIVEMATERIALSOURCE    = 148,
424     WINED3DRS_VERTEXBLEND               = 151,
425     WINED3DRS_CLIPPLANEENABLE           = 152,  
426     WINED3DRS_SOFTWAREVERTEXPROCESSING  = 153, /* d3d8 */
427     WINED3DRS_POINTSIZE                 = 154,
428     WINED3DRS_POINTSIZE_MIN             = 155,
429     WINED3DRS_POINTSPRITEENABLE         = 156,
430     WINED3DRS_POINTSCALEENABLE          = 157,
431     WINED3DRS_POINTSCALE_A              = 158,
432     WINED3DRS_POINTSCALE_B              = 159,
433     WINED3DRS_POINTSCALE_C              = 160,
434     WINED3DRS_MULTISAMPLEANTIALIAS      = 161,
435     WINED3DRS_MULTISAMPLEMASK           = 162,
436     WINED3DRS_PATCHEDGESTYLE            = 163,
437     WINED3DRS_PATCHSEGMENTS             = 164, /* d3d8 */
438     WINED3DRS_DEBUGMONITORTOKEN         = 165,
439     WINED3DRS_POINTSIZE_MAX             = 166,
440     WINED3DRS_INDEXEDVERTEXBLENDENABLE  = 167,
441     WINED3DRS_COLORWRITEENABLE          = 168,
442     WINED3DRS_TWEENFACTOR               = 170,
443     WINED3DRS_BLENDOP                   = 171,
444     WINED3DRS_POSITIONORDER             = 172,
445     WINED3DRS_NORMALORDER               = 173,
446     WINED3DRS_POSITIONDEGREE            = 172,
447     WINED3DRS_NORMALDEGREE              = 173,
448     WINED3DRS_SCISSORTESTENABLE         = 174,
449     WINED3DRS_SLOPESCALEDEPTHBIAS       = 175,
450     WINED3DRS_ANTIALIASEDLINEENABLE     = 176,
451     WINED3DRS_MINTESSELLATIONLEVEL      = 178,
452     WINED3DRS_MAXTESSELLATIONLEVEL      = 179,
453     WINED3DRS_ADAPTIVETESS_X            = 180,
454     WINED3DRS_ADAPTIVETESS_Y            = 181,
455     WINED3DRS_ADAPTIVETESS_Z            = 182,
456     WINED3DRS_ADAPTIVETESS_W            = 183,
457     WINED3DRS_ENABLEADAPTIVETESSELLATION= 184,
458     WINED3DRS_TWOSIDEDSTENCILMODE       = 185,
459     WINED3DRS_CCW_STENCILFAIL           = 186,
460     WINED3DRS_CCW_STENCILZFAIL          = 187,
461     WINED3DRS_CCW_STENCILPASS           = 188,
462     WINED3DRS_CCW_STENCILFUNC           = 189,
463     WINED3DRS_COLORWRITEENABLE1         = 190,
464     WINED3DRS_COLORWRITEENABLE2         = 191,
465     WINED3DRS_COLORWRITEENABLE3         = 192,
466     WINED3DRS_BLENDFACTOR               = 193,
467     WINED3DRS_SRGBWRITEENABLE           = 194,
468     WINED3DRS_DEPTHBIAS                 = 195,
469     WINED3DRS_WRAP8                     = 198,
470     WINED3DRS_WRAP9                     = 199,
471     WINED3DRS_WRAP10                    = 200,
472     WINED3DRS_WRAP11                    = 201,
473     WINED3DRS_WRAP12                    = 202,
474     WINED3DRS_WRAP13                    = 203,
475     WINED3DRS_WRAP14                    = 204,
476     WINED3DRS_WRAP15                    = 205,
477     WINED3DRS_SEPARATEALPHABLENDENABLE  = 206,
478     WINED3DRS_SRCBLENDALPHA             = 207,
479     WINED3DRS_DESTBLENDALPHA            = 208,
480     WINED3DRS_BLENDOPALPHA              = 209,
481
482     WINED3DRS_FORCE_DWORD               = 0x7fffffff
483 } WINED3DRENDERSTATETYPE;
484
485 #define WINEHIGHEST_RENDER_STATE   WINED3DRS_BLENDOPALPHA
486         /* Highest WINED3DRS_ value   */
487
488 #define WINED3DCOLORWRITEENABLE_RED   (1<<0)
489 #define WINED3DCOLORWRITEENABLE_GREEN (1<<1)
490 #define WINED3DCOLORWRITEENABLE_BLUE  (1<<2)
491 #define WINED3DCOLORWRITEENABLE_ALPHA (1<<3)
492
493 typedef enum _WINED3DBLEND {
494     WINED3DBLEND_ZERO               =  1,
495     WINED3DBLEND_ONE                =  2,
496     WINED3DBLEND_SRCCOLOR           =  3,
497     WINED3DBLEND_INVSRCCOLOR        =  4,
498     WINED3DBLEND_SRCALPHA           =  5,
499     WINED3DBLEND_INVSRCALPHA        =  6,
500     WINED3DBLEND_DESTALPHA          =  7,
501     WINED3DBLEND_INVDESTALPHA       =  8,
502     WINED3DBLEND_DESTCOLOR          =  9,
503     WINED3DBLEND_INVDESTCOLOR       = 10,
504     WINED3DBLEND_SRCALPHASAT        = 11,
505     WINED3DBLEND_BOTHSRCALPHA       = 12,
506     WINED3DBLEND_BOTHINVSRCALPHA    = 13,
507     WINED3DBLEND_BLENDFACTOR        = 14,
508     WINED3DBLEND_INVBLENDFACTOR     = 15,
509     WINED3DBLEND_FORCE_DWORD        = 0x7fffffff
510 } WINED3DBLEND;
511
512 typedef enum _WINED3DBLENDOP {
513     WINED3DBLENDOP_ADD              = 1,
514     WINED3DBLENDOP_SUBTRACT         = 2,
515     WINED3DBLENDOP_REVSUBTRACT      = 3,
516     WINED3DBLENDOP_MIN              = 4,
517     WINED3DBLENDOP_MAX              = 5,
518
519     WINED3DBLENDOP_FORCE_DWORD      = 0x7fffffff
520 } WINED3DBLENDOP;
521
522 typedef enum _WINED3DVERTEXBLENDFLAGS {
523     WINED3DVBF_DISABLE  =   0,
524     WINED3DVBF_1WEIGHTS =   1,
525     WINED3DVBF_2WEIGHTS =   2,
526     WINED3DVBF_3WEIGHTS =   3,
527     WINED3DVBF_TWEENING = 255,
528     WINED3DVBF_0WEIGHTS = 256
529 } WINED3DVERTEXBLENDFLAGS;
530
531 typedef enum _WINED3DCMPFUNC {
532     WINED3DCMP_NEVER                = 1,
533     WINED3DCMP_LESS                 = 2,
534     WINED3DCMP_EQUAL                = 3,
535     WINED3DCMP_LESSEQUAL            = 4,
536     WINED3DCMP_GREATER              = 5,
537     WINED3DCMP_NOTEQUAL             = 6,
538     WINED3DCMP_GREATEREQUAL         = 7,
539     WINED3DCMP_ALWAYS               = 8,
540
541     WINED3DCMP_FORCE_DWORD          = 0x7fffffff
542 } WINED3DCMPFUNC;
543
544 typedef enum _WINED3DZBUFFERTYPE {
545     WINED3DZB_FALSE                 = 0,
546     WINED3DZB_TRUE                  = 1,
547     WINED3DZB_USEW                  = 2,
548
549     WINED3DZB_FORCE_DWORD           = 0x7fffffff
550 } WINED3DZBUFFERTYPE;
551
552 typedef enum _WINED3DFOGMODE {
553     WINED3DFOG_NONE                 = 0,
554     WINED3DFOG_EXP                  = 1,
555     WINED3DFOG_EXP2                 = 2,
556     WINED3DFOG_LINEAR               = 3,
557
558     WINED3DFOG_FORCE_DWORD          = 0x7fffffff
559 } WINED3DFOGMODE;
560
561 typedef enum _WINED3DSHADEMODE {
562     WINED3DSHADE_FLAT               = 1,
563     WINED3DSHADE_GOURAUD            = 2,
564     WINED3DSHADE_PHONG              = 3,
565
566     WINED3DSHADE_FORCE_DWORD        = 0x7fffffff
567 } WINED3DSHADEMODE;
568
569 typedef enum _WINED3DFILLMODE {
570     WINED3DFILL_POINT               = 1,
571     WINED3DFILL_WIREFRAME           = 2,
572     WINED3DFILL_SOLID               = 3,
573
574     WINED3DFILL_FORCE_DWORD         = 0x7fffffff
575 } WINED3DFILLMODE;
576
577 typedef enum _WINED3DCULL {
578     WINED3DCULL_NONE                = 1,
579     WINED3DCULL_CW                  = 2,
580     WINED3DCULL_CCW                 = 3,
581
582     WINED3DCULL_FORCE_DWORD         = 0x7fffffff
583 } WINED3DCULL;
584
585 typedef enum _WINED3DSTENCILOP {
586     WINED3DSTENCILOP_KEEP           = 1,
587     WINED3DSTENCILOP_ZERO           = 2,
588     WINED3DSTENCILOP_REPLACE        = 3,
589     WINED3DSTENCILOP_INCRSAT        = 4,
590     WINED3DSTENCILOP_DECRSAT        = 5,
591     WINED3DSTENCILOP_INVERT         = 6,
592     WINED3DSTENCILOP_INCR           = 7,
593     WINED3DSTENCILOP_DECR           = 8,
594
595     WINED3DSTENCILOP_FORCE_DWORD    = 0x7fffffff
596 } WINED3DSTENCILOP;
597
598 typedef enum _WINED3DMATERIALCOLORSOURCE {
599     WINED3DMCS_MATERIAL         = 0,
600     WINED3DMCS_COLOR1           = 1,
601     WINED3DMCS_COLOR2           = 2,
602
603     WINED3DMCS_FORCE_DWORD      = 0x7fffffff
604 } WINED3DMATERIALCOLORSOURCE;
605
606 typedef enum _WINED3DPATCHEDGESTYLE {
607    WINED3DPATCHEDGE_DISCRETE    = 0,
608    WINED3DPATCHEDGE_CONTINUOUS  = 1,
609
610    WINED3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
611 } WINED3DPATCHEDGESTYLE;
612
613 typedef struct _WINED3DDISPLAYMODE {
614     UINT            Width;
615     UINT            Height;
616     UINT            RefreshRate;
617     WINED3DFORMAT   Format;
618 } WINED3DDISPLAYMODE;
619
620 typedef enum _WINED3DBACKBUFFER_TYPE {
621     WINED3DBACKBUFFER_TYPE_MONO         = 0,
622     WINED3DBACKBUFFER_TYPE_LEFT         = 1,
623     WINED3DBACKBUFFER_TYPE_RIGHT        = 2,
624
625     WINED3DBACKBUFFER_TYPE_FORCE_DWORD  = 0x7fffffff
626 } WINED3DBACKBUFFER_TYPE;
627
628 #define WINED3DADAPTER_DEFAULT          0
629 #define WINED3DENUM_NO_WHQL_LEVEL       2
630 #define WINED3DPRESENT_BACK_BUFFER_MAX  3
631
632 typedef enum _WINED3DSWAPEFFECT {
633     WINED3DSWAPEFFECT_DISCARD         = 1,
634     WINED3DSWAPEFFECT_FLIP            = 2,
635     WINED3DSWAPEFFECT_COPY            = 3,
636     WINED3DSWAPEFFECT_COPY_VSYNC      = 4,
637     WINED3DSWAPEFFECT_FORCE_DWORD     = 0xFFFFFFFF
638 } WINED3DSWAPEFFECT;
639
640 typedef enum _WINED3DSAMPLERSTATETYPE {
641     WINED3DSAMP_ADDRESSU       = 1,
642     WINED3DSAMP_ADDRESSV       = 2,
643     WINED3DSAMP_ADDRESSW       = 3,
644     WINED3DSAMP_BORDERCOLOR    = 4,
645     WINED3DSAMP_MAGFILTER      = 5,
646     WINED3DSAMP_MINFILTER      = 6,
647     WINED3DSAMP_MIPFILTER      = 7,
648     WINED3DSAMP_MIPMAPLODBIAS  = 8,
649     WINED3DSAMP_MAXMIPLEVEL    = 9,
650     WINED3DSAMP_MAXANISOTROPY  = 10,
651     WINED3DSAMP_SRGBTEXTURE    = 11,
652     WINED3DSAMP_ELEMENTINDEX   = 12,
653     WINED3DSAMP_DMAPOFFSET     = 13,
654
655     WINED3DSAMP_FORCE_DWORD   = 0x7fffffff,
656 } WINED3DSAMPLERSTATETYPE;
657 #define WINED3D_HIGHEST_SAMPLER_STATE WINED3DSAMP_DMAPOFFSET
658
659 typedef enum _WINED3DMULTISAMPLE_TYPE {
660     WINED3DMULTISAMPLE_NONE          =  0,
661     WINED3DMULTISAMPLE_NONMASKABLE   =  1,
662     WINED3DMULTISAMPLE_2_SAMPLES     =  2,
663     WINED3DMULTISAMPLE_3_SAMPLES     =  3,
664     WINED3DMULTISAMPLE_4_SAMPLES     =  4,
665     WINED3DMULTISAMPLE_5_SAMPLES     =  5,
666     WINED3DMULTISAMPLE_6_SAMPLES     =  6,
667     WINED3DMULTISAMPLE_7_SAMPLES     =  7,
668     WINED3DMULTISAMPLE_8_SAMPLES     =  8,
669     WINED3DMULTISAMPLE_9_SAMPLES     =  9,
670     WINED3DMULTISAMPLE_10_SAMPLES    = 10,
671     WINED3DMULTISAMPLE_11_SAMPLES    = 11,
672     WINED3DMULTISAMPLE_12_SAMPLES    = 12,
673     WINED3DMULTISAMPLE_13_SAMPLES    = 13,
674     WINED3DMULTISAMPLE_14_SAMPLES    = 14,
675     WINED3DMULTISAMPLE_15_SAMPLES    = 15,
676     WINED3DMULTISAMPLE_16_SAMPLES    = 16,
677
678     WINED3DMULTISAMPLE_FORCE_DWORD   = 0xffffffff
679 } WINED3DMULTISAMPLE_TYPE;
680
681 typedef enum _WINED3DTEXTURESTAGESTATETYPE {
682     WINED3DTSS_COLOROP               =  1,
683     WINED3DTSS_COLORARG1             =  2,
684     WINED3DTSS_COLORARG2             =  3,
685     WINED3DTSS_ALPHAOP               =  4,
686     WINED3DTSS_ALPHAARG1             =  5,
687     WINED3DTSS_ALPHAARG2             =  6,
688     WINED3DTSS_BUMPENVMAT00          =  7,
689     WINED3DTSS_BUMPENVMAT01          =  8,
690     WINED3DTSS_BUMPENVMAT10          =  9,
691     WINED3DTSS_BUMPENVMAT11          = 10,
692     WINED3DTSS_TEXCOORDINDEX         = 11,
693     WINED3DTSS_ADDRESS               = 12,
694     WINED3DTSS_ADDRESSU              = 13,
695     WINED3DTSS_ADDRESSV              = 14,
696     WINED3DTSS_BORDERCOLOR           = 15,
697     WINED3DTSS_MAGFILTER             = 16,
698     WINED3DTSS_MINFILTER             = 17,
699     WINED3DTSS_MIPFILTER             = 18,
700     WINED3DTSS_MIPMAPLODBIAS         = 19,
701     WINED3DTSS_MAXMIPLEVEL           = 20,
702     WINED3DTSS_MAXANISOTROPY         = 21,
703     WINED3DTSS_BUMPENVLSCALE         = 22,
704     WINED3DTSS_BUMPENVLOFFSET        = 23,
705     WINED3DTSS_TEXTURETRANSFORMFLAGS = 24,
706     WINED3DTSS_ADDRESSW              = 25,
707     WINED3DTSS_COLORARG0             = 26,
708     WINED3DTSS_ALPHAARG0             = 27,
709     WINED3DTSS_RESULTARG             = 28,
710     WINED3DTSS_CONSTANT              = 32,
711
712     WINED3DTSS_FORCE_DWORD           = 0x7fffffff
713 } WINED3DTEXTURESTAGESTATETYPE;
714
715 #define WINED3DTSS_TCI_PASSTHRU                       0x00000
716 #define WINED3DTSS_TCI_CAMERASPACENORMAL              0x10000
717 #define WINED3DTSS_TCI_CAMERASPACEPOSITION            0x20000
718 #define WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR    0x30000
719 #define WINED3DTSS_TCI_SPHEREMAP                      0x40000
720
721 #define WINED3D_HIGHEST_TEXTURE_STATE WINED3DTSS_CONSTANT
722
723 typedef enum _WINED3DTEXTURETRANSFORMFLAGS {
724     WINED3DTTFF_DISABLE         =   0,
725     WINED3DTTFF_COUNT1          =   1,
726     WINED3DTTFF_COUNT2          =   2,
727     WINED3DTTFF_COUNT3          =   3,
728     WINED3DTTFF_COUNT4          =   4,
729     WINED3DTTFF_PROJECTED       = 256,
730
731     WINED3DTTFF_FORCE_DWORD     = 0x7fffffff
732 } WINED3DTEXTURETRANSFORMFLAGS;
733
734 typedef enum _WINED3DTEXTUREOP {
735     WINED3DTOP_DISABLE                   =  1,
736     WINED3DTOP_SELECTARG1                =  2,
737     WINED3DTOP_SELECTARG2                =  3,
738     WINED3DTOP_MODULATE                  =  4,
739     WINED3DTOP_MODULATE2X                =  5,
740     WINED3DTOP_MODULATE4X                =  6,
741     WINED3DTOP_ADD                       =  7,
742     WINED3DTOP_ADDSIGNED                 =  8,
743     WINED3DTOP_ADDSIGNED2X               =  9,
744     WINED3DTOP_SUBTRACT                  = 10,
745     WINED3DTOP_ADDSMOOTH                 = 11,
746     WINED3DTOP_BLENDDIFFUSEALPHA         = 12,
747     WINED3DTOP_BLENDTEXTUREALPHA         = 13,
748     WINED3DTOP_BLENDFACTORALPHA          = 14,
749     WINED3DTOP_BLENDTEXTUREALPHAPM       = 15,
750     WINED3DTOP_BLENDCURRENTALPHA         = 16,
751     WINED3DTOP_PREMODULATE               = 17,
752     WINED3DTOP_MODULATEALPHA_ADDCOLOR    = 18,
753     WINED3DTOP_MODULATECOLOR_ADDALPHA    = 19,
754     WINED3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
755     WINED3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
756     WINED3DTOP_BUMPENVMAP                = 22,
757     WINED3DTOP_BUMPENVMAPLUMINANCE       = 23,
758     WINED3DTOP_DOTPRODUCT3               = 24,
759     WINED3DTOP_MULTIPLYADD               = 25,
760     WINED3DTOP_LERP                      = 26,
761
762     WINED3DTOP_FORCE_DWORD               = 0x7fffffff,
763 } WINED3DTEXTUREOP;
764
765 #define WINED3DTA_SELECTMASK        0x0000000f
766 #define WINED3DTA_DIFFUSE           0x00000000
767 #define WINED3DTA_CURRENT           0x00000001
768 #define WINED3DTA_TEXTURE           0x00000002
769 #define WINED3DTA_TFACTOR           0x00000003
770 #define WINED3DTA_SPECULAR          0x00000004
771 #define WINED3DTA_TEMP              0x00000005
772 #define WINED3DTA_CONSTANT          0x00000006
773 #define WINED3DTA_COMPLEMENT        0x00000010
774 #define WINED3DTA_ALPHAREPLICATE    0x00000020
775
776 typedef enum _WINED3DTEXTUREADDRESS {
777     WINED3DTADDRESS_WRAP            = 1,
778     WINED3DTADDRESS_MIRROR          = 2,
779     WINED3DTADDRESS_CLAMP           = 3,
780     WINED3DTADDRESS_BORDER          = 4,
781     WINED3DTADDRESS_MIRRORONCE      = 5,
782
783     WINED3DTADDRESS_FORCE_DWORD     = 0x7fffffff
784 } WINED3DTEXTUREADDRESS;
785
786 typedef enum _WINED3DTRANSFORMSTATETYPE {
787     WINED3DTS_VIEW            =  2,
788     WINED3DTS_PROJECTION      =  3,
789     WINED3DTS_TEXTURE0        = 16,
790     WINED3DTS_TEXTURE1        = 17,
791     WINED3DTS_TEXTURE2        = 18,
792     WINED3DTS_TEXTURE3        = 19,
793     WINED3DTS_TEXTURE4        = 20,
794     WINED3DTS_TEXTURE5        = 21,
795     WINED3DTS_TEXTURE6        = 22,
796     WINED3DTS_TEXTURE7        = 23,
797
798     WINED3DTS_FORCE_DWORD     = 0x7fffffff
799 } WINED3DTRANSFORMSTATETYPE;
800
801 #define WINED3DTS_WORLD  WINED3DTS_WORLDMATRIX(0)
802 #define WINED3DTS_WORLD1 WINED3DTS_WORLDMATRIX(1)
803 #define WINED3DTS_WORLD2 WINED3DTS_WORLDMATRIX(2)
804 #define WINED3DTS_WORLD3 WINED3DTS_WORLDMATRIX(3)
805 #define WINED3DTS_WORLDMATRIX(index) (WINED3DTRANSFORMSTATETYPE)(index + 256)
806
807 typedef enum _WINED3DBASISTYPE {
808    WINED3DBASIS_BEZIER        = 0,
809    WINED3DBASIS_BSPLINE       = 1,
810    WINED3DBASIS_INTERPOLATE   = 2,
811
812    WINED3DBASIS_FORCE_DWORD   = 0x7fffffff
813 } WINED3DBASISTYPE;
814
815 typedef enum _WINED3DCUBEMAP_FACES {
816     WINED3DCUBEMAP_FACE_POSITIVE_X     = 0,
817     WINED3DCUBEMAP_FACE_NEGATIVE_X     = 1,
818     WINED3DCUBEMAP_FACE_POSITIVE_Y     = 2,
819     WINED3DCUBEMAP_FACE_NEGATIVE_Y     = 3,
820     WINED3DCUBEMAP_FACE_POSITIVE_Z     = 4,
821     WINED3DCUBEMAP_FACE_NEGATIVE_Z     = 5,
822
823     WINED3DCUBEMAP_FACE_FORCE_DWORD    = 0xffffffff
824 } WINED3DCUBEMAP_FACES;
825
826 typedef enum _WINED3DTEXTUREFILTERTYPE {
827     WINED3DTEXF_NONE            = 0,
828     WINED3DTEXF_POINT           = 1,
829     WINED3DTEXF_LINEAR          = 2,
830     WINED3DTEXF_ANISOTROPIC     = 3,
831     WINED3DTEXF_FLATCUBIC       = 4,
832     WINED3DTEXF_GAUSSIANCUBIC   = 5,
833     WINED3DTEXF_PYRAMIDALQUAD   = 6,
834     WINED3DTEXF_GAUSSIANQUAD    = 7,
835     WINED3DTEXF_FORCE_DWORD     = 0x7fffffff
836 } WINED3DTEXTUREFILTERTYPE;
837
838 typedef struct _WINEDD3DRECTPATCH_INFO {
839     UINT                StartVertexOffsetWidth;
840     UINT                StartVertexOffsetHeight;
841     UINT                Width;
842     UINT                Height;
843     UINT                Stride;
844     WINED3DBASISTYPE    Basis;
845     WINED3DDEGREETYPE   Degree;
846 } WINED3DRECTPATCH_INFO;
847
848 typedef struct _WINED3DTRIPATCH_INFO {
849     UINT                StartVertexOffset;
850     UINT                NumVertices;
851     WINED3DBASISTYPE    Basis;
852     WINED3DDEGREETYPE   Degree;
853 } WINED3DTRIPATCH_INFO;
854
855
856 typedef struct _WINED3DADAPTER_IDENTIFIER {
857     char           *Driver;
858     char           *Description;
859     char           *DeviceName;
860     LARGE_INTEGER  *DriverVersion; 
861     DWORD          *VendorId;
862     DWORD          *DeviceId;
863     DWORD          *SubSysId;
864     DWORD          *Revision;
865     GUID           *DeviceIdentifier;
866     DWORD          *WHQLLevel;
867 } WINED3DADAPTER_IDENTIFIER;
868
869 typedef struct _WINED3DPRESENT_PARAMETERS {
870     UINT                    BackBufferWidth;
871     UINT                    BackBufferHeight;
872     WINED3DFORMAT           BackBufferFormat;
873     UINT                    BackBufferCount;
874     WINED3DMULTISAMPLE_TYPE MultiSampleType;
875     DWORD                   MultiSampleQuality;
876     WINED3DSWAPEFFECT       SwapEffect;
877     HWND                    hDeviceWindow;
878     BOOL                    Windowed;
879     BOOL                    EnableAutoDepthStencil;
880     WINED3DFORMAT           AutoDepthStencilFormat;
881     DWORD                   Flags;
882     UINT                    FullScreen_RefreshRateInHz;
883     UINT                    PresentationInterval;
884 } WINED3DPRESENT_PARAMETERS;
885
886 typedef enum _WINED3DRESOURCETYPE {
887     WINED3DRTYPE_SURFACE                =  1,
888     WINED3DRTYPE_VOLUME                 =  2,
889     WINED3DRTYPE_TEXTURE                =  3,
890     WINED3DRTYPE_VOLUMETEXTURE          =  4,
891     WINED3DRTYPE_CUBETEXTURE            =  5,
892     WINED3DRTYPE_VERTEXBUFFER           =  6,
893     WINED3DRTYPE_INDEXBUFFER            =  7,
894
895     WINED3DRTYPE_FORCE_DWORD            = 0x7fffffff
896 } WINED3DRESOURCETYPE;
897
898 #define WINED3DRTYPECOUNT (WINED3DRTYPE_INDEXBUFFER+1)
899
900 typedef enum _WINED3DPOOL {
901     WINED3DPOOL_DEFAULT                 = 0,
902     WINED3DPOOL_MANAGED                 = 1,
903     WINED3DPOOL_SYSTEMMEM               = 2,
904     WINED3DPOOL_SCRATCH                 = 3,
905
906     WINED3DPOOL_FORCE_DWORD             = 0x7fffffff
907 } WINED3DPOOL;
908
909 typedef struct _WINED3DSURFACE_DESC
910 {
911     WINED3DFORMAT           *Format;
912     WINED3DRESOURCETYPE     *Type;
913     DWORD                   *Usage;
914     WINED3DPOOL             *Pool;
915     UINT                    *Size;
916
917     WINED3DMULTISAMPLE_TYPE *MultiSampleType;
918     DWORD                   *MultiSampleQuality;
919     UINT                    *Width;
920     UINT                    *Height;
921 } WINED3DSURFACE_DESC;
922
923 typedef struct _WINED3DVOLUME_DESC
924 {
925     WINED3DFORMAT       *Format;
926     WINED3DRESOURCETYPE *Type;
927     DWORD               *Usage;
928     WINED3DPOOL         *Pool;
929     UINT                *Size;
930
931     UINT                *Width;
932     UINT                *Height;
933     UINT                *Depth;
934 } WINED3DVOLUME_DESC;
935
936 typedef struct _WINED3DCLIPSTATUS {
937    DWORD ClipUnion;
938    DWORD ClipIntersection;
939 } WINED3DCLIPSTATUS;
940
941
942 typedef struct _WINED3DVERTEXELEMENT {
943   WORD    Stream;
944   WORD    Offset;
945   BYTE    Type;
946   BYTE    Method;
947   BYTE    Usage;
948   BYTE    UsageIndex;
949   int     Reg; /* DirectX 8 */
950 } WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
951
952
953 typedef enum _WINED3DQUERYTYPE {
954     WINED3DQUERYTYPE_VCACHE             = 4,
955     WINED3DQUERYTYPE_RESOURCEMANAGER    = 5,
956     WINED3DQUERYTYPE_VERTEXSTATS        = 6,
957     WINED3DQUERYTYPE_EVENT              = 8,
958     WINED3DQUERYTYPE_OCCLUSION          = 9,
959     WINED3DQUERYTYPE_TIMESTAMP          = 10,
960     WINED3DQUERYTYPE_TIMESTAMPDISJOINT  = 11,
961     WINED3DQUERYTYPE_TIMESTAMPFREQ      = 12,
962     WINED3DQUERYTYPE_PIPELINETIMINGS    = 13,
963     WINED3DQUERYTYPE_INTERFACETIMINGS   = 14,
964     WINED3DQUERYTYPE_VERTEXTIMINGS      = 15,
965     WINED3DQUERYTYPE_PIXELTIMINGS       = 16,
966     WINED3DQUERYTYPE_BANDWIDTHTIMINGS   = 17,
967     WINED3DQUERYTYPE_CACHEUTILIZATION   = 18
968 } WINED3DQUERYTYPE;
969
970 #define WINED3DISSUE_BEGIN   (1 << 1)
971 #define WINED3DISSUE_END     (1 << 0)
972 #define WINED3DGETDATA_FLUSH (1 << 0)
973
974 typedef struct _WINED3DDEVICE_CREATION_PARAMETERS {
975     UINT           AdapterOrdinal;
976     WINED3DDEVTYPE DeviceType;
977     HWND           hFocusWindow;
978     DWORD          BehaviorFlags;
979 } WINED3DDEVICE_CREATION_PARAMETERS;
980
981 typedef struct _WINED3DDEVINFO_BANDWIDTHTIMINGS {
982     float         MaxBandwidthUtilized;
983     float         FrontEndUploadMemoryUtilizedPercent;
984     float         VertexRateUtilizedPercent;
985     float         TriangleSetupRateUtilizedPercent;
986     float         FillRateUtilizedPercent;
987 } WINED3DDEVINFO_BANDWIDTHTIMINGS;
988
989 typedef struct _WINED3DDEVINFO_CACHEUTILIZATION {
990     float         TextureCacheHitRate;
991     float         PostTransformVertexCacheHitRate;
992 } WINED3DDEVINFO_CACHEUTILIZATION;
993
994 typedef struct _WINED3DDEVINFO_INTERFACETIMINGS {
995     float         WaitingForGPUToUseApplicationResourceTimePercent;
996     float         WaitingForGPUToAcceptMoreCommandsTimePercent;
997     float         WaitingForGPUToStayWithinLatencyTimePercent;
998     float         WaitingForGPUExclusiveResourceTimePercent;
999     float         WaitingForGPUOtherTimePercent;
1000 } WINED3DDEVINFO_INTERFACETIMINGS;
1001
1002 typedef struct _WINED3DDEVINFO_PIPELINETIMINGS {
1003     float         VertexProcessingTimePercent;
1004     float         PixelProcessingTimePercent;
1005     float         OtherGPUProcessingTimePercent;
1006     float         GPUIdleTimePercent;
1007 } WINED3DDEVINFO_PIPELINETIMINGS;
1008
1009 typedef struct _WINED3DDEVINFO_STAGETIMINGS {
1010     float         MemoryProcessingPercent;
1011     float         ComputationProcessingPercent;
1012 } WINED3DDEVINFO_STAGETIMINGS;
1013
1014 typedef struct _WINED3DRASTER_STATUS {
1015     BOOL            InVBlank;
1016     UINT            ScanLine;
1017 } WINED3DRASTER_STATUS;
1018
1019
1020 typedef struct WINED3DRESOURCESTATS {
1021     BOOL                bThrashing;
1022     DWORD               ApproxBytesDownloaded;
1023     DWORD               NumEvicts;
1024     DWORD               NumVidCreates;
1025     DWORD               LastPri;
1026     DWORD               NumUsed;
1027     DWORD               NumUsedInVidMem;
1028     DWORD               WorkingSet;
1029     DWORD               WorkingSetBytes;
1030     DWORD               TotalManaged;
1031     DWORD               TotalBytes;
1032 } WINED3DRESOURCESTATS;
1033
1034 typedef struct _WINED3DDEVINFO_RESOURCEMANAGER {
1035     WINED3DRESOURCESTATS stats[WINED3DRTYPECOUNT];
1036 } WINED3DDEVINFO_RESOURCEMANAGER;
1037
1038 typedef struct _WINED3DDEVINFO_VERTEXSTATS {
1039     DWORD NumRenderedTriangles;
1040     DWORD NumExtraClippingTriangles;
1041 } WINED3DDEVINFO_VERTEXSTATS;
1042
1043 typedef struct _WINED3DLOCKED_RECT {
1044     INT                 Pitch;
1045     void*               pBits;
1046 } WINED3DLOCKED_RECT;
1047
1048 typedef struct _WINED3DLOCKED_BOX {
1049     INT                 RowPitch;
1050     INT                 SlicePitch;
1051     void*               pBits;
1052 } WINED3DLOCKED_BOX;
1053
1054
1055 typedef struct _WINED3DBOX {
1056     UINT                Left;
1057     UINT                Top;
1058     UINT                Right;
1059     UINT                Bottom;
1060     UINT                Front;
1061     UINT                Back;
1062 } WINED3DBOX;
1063
1064 /*Vertex cache optimization hints.*/
1065 typedef struct WINED3DDEVINFO_VCACHE {
1066     /*Must be a 4 char code FOURCC (e.g. CACH)*/
1067     DWORD         Pattern; 
1068     /*0 to get the longest  strips, 1 vertex cache*/
1069     DWORD         OptMethod; 
1070      /*Cache size to use (only valid if OptMethod==1) */
1071     DWORD         CacheSize;
1072     /*internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1)*/
1073     DWORD         MagicNumber; 
1074 } WINED3DDEVINFO_VCACHE;
1075
1076 typedef struct _WINED3DVERTEXBUFFER_DESC {
1077     WINED3DFORMAT           Format;
1078     WINED3DRESOURCETYPE     Type;
1079     DWORD                   Usage;
1080     WINED3DPOOL             Pool;
1081     UINT                    Size;
1082     DWORD                   FVF;
1083 } WINED3DVERTEXBUFFER_DESC;
1084
1085 typedef struct _WINED3DINDEXBUFFER_DESC {
1086     WINED3DFORMAT           Format;
1087     WINED3DRESOURCETYPE     Type;
1088     DWORD                   Usage;
1089     WINED3DPOOL             Pool;
1090     UINT                    Size;
1091 } WINED3DINDEXBUFFER_DESC;
1092
1093 /*
1094  * The wined3dcaps structure
1095  */
1096
1097 typedef struct _WINED3DVSHADERCAPS2_0 {
1098   DWORD  *Caps;
1099   INT    *DynamicFlowControlDepth;
1100   INT    *NumTemps;
1101   INT    *StaticFlowControlDepth;
1102 } WINED3DVSHADERCAPS2_0;
1103
1104 typedef struct _WINED3DPSHADERCAPS2_0 {
1105   DWORD  *Caps;
1106   INT    *DynamicFlowControlDepth;
1107   INT    *NumTemps;
1108   INT    *StaticFlowControlDepth;
1109   INT    *NumInstructionSlots;
1110 } WINED3DPSHADERCAPS2_0;
1111
1112 typedef struct _WINED3DCAPS {
1113   WINED3DDEVTYPE      *DeviceType;
1114   UINT                *AdapterOrdinal;
1115
1116   DWORD               *Caps;
1117   DWORD               *Caps2;
1118   DWORD               *Caps3;
1119   DWORD               *PresentationIntervals;
1120
1121   DWORD               *CursorCaps;
1122
1123   DWORD               *DevCaps;
1124
1125   DWORD               *PrimitiveMiscCaps;
1126   DWORD               *RasterCaps;
1127   DWORD               *ZCmpCaps;
1128   DWORD               *SrcBlendCaps;
1129   DWORD               *DestBlendCaps;
1130   DWORD               *AlphaCmpCaps;
1131   DWORD               *ShadeCaps;
1132   DWORD               *TextureCaps;
1133   DWORD               *TextureFilterCaps;
1134   DWORD               *CubeTextureFilterCaps;
1135   DWORD               *VolumeTextureFilterCaps;
1136   DWORD               *TextureAddressCaps;
1137   DWORD               *VolumeTextureAddressCaps;
1138
1139   DWORD               *LineCaps;
1140
1141   DWORD               *MaxTextureWidth;
1142   DWORD               *MaxTextureHeight;
1143   DWORD               *MaxVolumeExtent;
1144
1145   DWORD               *MaxTextureRepeat;
1146   DWORD               *MaxTextureAspectRatio;
1147   DWORD               *MaxAnisotropy;
1148   float               *MaxVertexW;
1149
1150   float               *GuardBandLeft;
1151   float               *GuardBandTop;
1152   float               *GuardBandRight;
1153   float               *GuardBandBottom;
1154
1155   float               *ExtentsAdjust;
1156   DWORD               *StencilCaps;
1157
1158   DWORD               *FVFCaps;
1159   DWORD               *TextureOpCaps;
1160   DWORD               *MaxTextureBlendStages;
1161   DWORD               *MaxSimultaneousTextures;
1162
1163   DWORD               *VertexProcessingCaps;
1164   DWORD               *MaxActiveLights;
1165   DWORD               *MaxUserClipPlanes;
1166   DWORD               *MaxVertexBlendMatrices;
1167   DWORD               *MaxVertexBlendMatrixIndex;
1168
1169   float               *MaxPointSize;
1170
1171   DWORD               *MaxPrimitiveCount;
1172   DWORD               *MaxVertexIndex;
1173   DWORD               *MaxStreams;
1174   DWORD               *MaxStreamStride;
1175
1176   DWORD               *VertexShaderVersion;
1177   DWORD               *MaxVertexShaderConst;
1178
1179   DWORD               *PixelShaderVersion;
1180   float               *PixelShader1xMaxValue;
1181
1182   /* DX 9 */
1183   DWORD               *DevCaps2;
1184
1185   float               *MaxNpatchTessellationLevel;
1186   DWORD               *Reserved5; /*undocumented*/
1187
1188   UINT                *MasterAdapterOrdinal;
1189   UINT                *AdapterOrdinalInGroup;
1190   UINT                *NumberOfAdaptersInGroup;
1191   DWORD               *DeclTypes;
1192   DWORD               *NumSimultaneousRTs;
1193   DWORD               *StretchRectFilterCaps;
1194   WINED3DVSHADERCAPS2_0   VS20Caps;
1195   WINED3DPSHADERCAPS2_0   PS20Caps;
1196   DWORD               *VertexTextureFilterCaps;
1197   DWORD               *MaxVShaderInstructionsExecuted;
1198   DWORD               *MaxPShaderInstructionsExecuted;
1199   DWORD               *MaxVertexShader30InstructionSlots; 
1200   DWORD               *MaxPixelShader30InstructionSlots;
1201   DWORD               *Reserved2;/* Not in the microsoft headers but documented */
1202   DWORD               *Reserved3;
1203
1204 } WINED3DCAPS;
1205
1206 typedef enum _WINED3DSTATEBLOCKTYPE {
1207     WINED3DSBT_INIT          = 0,
1208     WINED3DSBT_ALL           = 1,
1209     WINED3DSBT_PIXELSTATE    = 2,
1210     WINED3DSBT_VERTEXSTATE   = 3,
1211
1212     WINED3DSBT_FORCE_DWORD   = 0xffffffff
1213 } WINED3DSTATEBLOCKTYPE;
1214
1215 typedef struct glDescriptor {
1216     UINT          textureName;
1217     int           level;
1218     int           target;
1219     int/*GLenum*/ glFormat;
1220     int/*GLenum*/ glFormatInternal;
1221     int/*GLenum*/ glType;
1222 } glDescriptor;
1223
1224 #define WINED3DDP_MAXTEXCOORD 8
1225
1226 typedef enum _WINED3DDECLMETHOD {
1227     WINED3DDECLMETHOD_DEFAULT          = 0,
1228     WINED3DDECLMETHOD_PARTIALU         = 1,
1229     WINED3DDECLMETHOD_PARTIALV         = 2,
1230     WINED3DDECLMETHOD_CROSSUV          = 3,
1231     WINED3DDECLMETHOD_UV               = 4,
1232     WINED3DDECLMETHOD_LOOKUP           = 5,
1233     WINED3DDECLMETHOD_LOOKUPPRESAMPLED = 6
1234 } WINED3DDECLMETHOD;
1235
1236 typedef enum _WINED3DDECLTYPE {
1237   WINED3DDECLTYPE_FLOAT1    =  0,
1238   WINED3DDECLTYPE_FLOAT2    =  1,
1239   WINED3DDECLTYPE_FLOAT3    =  2,
1240   WINED3DDECLTYPE_FLOAT4    =  3,
1241   WINED3DDECLTYPE_D3DCOLOR  =  4,
1242   WINED3DDECLTYPE_UBYTE4    =  5,
1243   WINED3DDECLTYPE_SHORT2    =  6,
1244   WINED3DDECLTYPE_SHORT4    =  7,
1245   /* VS 2.0 */
1246   WINED3DDECLTYPE_UBYTE4N   =  8,
1247   WINED3DDECLTYPE_SHORT2N   =  9,
1248   WINED3DDECLTYPE_SHORT4N   = 10,
1249   WINED3DDECLTYPE_USHORT2N  = 11,
1250   WINED3DDECLTYPE_USHORT4N  = 12,
1251   WINED3DDECLTYPE_UDEC3     = 13,
1252   WINED3DDECLTYPE_DEC3N     = 14,
1253   WINED3DDECLTYPE_FLOAT16_2 = 15,
1254   WINED3DDECLTYPE_FLOAT16_4 = 16,
1255   WINED3DDECLTYPE_UNUSED    = 17,
1256 } WINED3DDECLTYPE;
1257
1258 #define WINED3DDECL_END() {0xFF,0,WINED3DDECLTYPE_UNUSED,0,0,0,-1}
1259
1260 typedef struct WineDirect3DStridedData {
1261     BYTE     *lpData;        /* Pointer to start of data               */
1262     DWORD     dwStride;      /* Stride between occurances of this data */
1263     DWORD     dwType;        /* Type (as in D3DVSDT_TYPE)              */
1264     int       VBO;           /* Vertex buffer object this data is in   */
1265     UINT      streamNo;      /* D3D stream number                      */
1266 } WineDirect3DStridedData;
1267
1268 typedef struct WineDirect3DVertexStridedData {
1269     union {
1270         struct {
1271
1272              /* Do not add or reorder fields here,
1273               * so this can be indexed as an array */
1274              WineDirect3DStridedData  position;
1275              WineDirect3DStridedData  blendWeights;
1276              WineDirect3DStridedData  blendMatrixIndices;
1277              WineDirect3DStridedData  normal;
1278              WineDirect3DStridedData  pSize;
1279              WineDirect3DStridedData  diffuse;
1280              WineDirect3DStridedData  specular;
1281              WineDirect3DStridedData  texCoords[WINED3DDP_MAXTEXCOORD];
1282              WineDirect3DStridedData  position2; /* tween data */
1283              WineDirect3DStridedData  normal2;   /* tween data */
1284              WineDirect3DStridedData  tangent;
1285              WineDirect3DStridedData  binormal;
1286              WineDirect3DStridedData  tessFactor;
1287              WineDirect3DStridedData  fog;
1288              WineDirect3DStridedData  depth;
1289              WineDirect3DStridedData  sample;
1290
1291              /* Add fields here */
1292              BOOL position_transformed;
1293
1294         } s;
1295         WineDirect3DStridedData input[16];  /* Indexed by constants in D3DVSDE_REGISTER */
1296     } u;
1297 } WineDirect3DVertexStridedData;
1298
1299 typedef enum {
1300     WINED3DDECLUSAGE_POSITION     = 0,
1301     WINED3DDECLUSAGE_BLENDWEIGHT  = 1,
1302     WINED3DDECLUSAGE_BLENDINDICES = 2,
1303     WINED3DDECLUSAGE_NORMAL       = 3,
1304     WINED3DDECLUSAGE_PSIZE        = 4,
1305     WINED3DDECLUSAGE_TEXCOORD     = 5,
1306     WINED3DDECLUSAGE_TANGENT      = 6,
1307     WINED3DDECLUSAGE_BINORMAL     = 7,
1308     WINED3DDECLUSAGE_TESSFACTOR   = 8,
1309     WINED3DDECLUSAGE_POSITIONT    = 9,
1310     WINED3DDECLUSAGE_COLOR        = 10,
1311     WINED3DDECLUSAGE_FOG          = 11,
1312     WINED3DDECLUSAGE_DEPTH        = 12,
1313     WINED3DDECLUSAGE_SAMPLE       = 13
1314 } WINED3DDECLUSAGE;
1315
1316 #define WINED3DUSAGE_RENDERTARGET                     0x00000001L
1317 #define WINED3DUSAGE_DEPTHSTENCIL                     0x00000002L
1318 #define WINED3DUSAGE_WRITEONLY                        0x00000008L
1319 #define WINED3DUSAGE_SOFTWAREPROCESSING               0x00000010L
1320 #define WINED3DUSAGE_DONOTCLIP                        0x00000020L
1321 #define WINED3DUSAGE_POINTS                           0x00000040L
1322 #define WINED3DUSAGE_RTPATCHES                        0x00000080L
1323 #define WINED3DUSAGE_NPATCHES                         0x00000100L
1324 #define WINED3DUSAGE_DYNAMIC                          0x00000200L
1325 #define WINED3DUSAGE_AUTOGENMIPMAP                    0x00000400L 
1326 #define WINED3DUSAGE_DMAP                             0x00004000L
1327 #define WINED3DUSAGE_MASK                             0x00004FFFL
1328 #define WINED3DUSAGE_OVERLAY                          0x00010000L
1329
1330 #define WINED3DUSAGE_QUERY_LEGACYBUMPMAP            0x00008000L
1331 #define WINED3DUSAGE_QUERY_FILTER                   0x00020000L
1332 #define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000L
1333 #define WINED3DUSAGE_QUERY_SRGBREAD                 0x00010000L
1334 #define WINED3DUSAGE_QUERY_SRGBWRITE                0x00040000L
1335 #define WINED3DUSAGE_QUERY_VERTEXTEXTURE            0x00100000L
1336 #define WINED3DUSAGE_QUERY_WRAPANDMIP               0x00200000L
1337 #define WINED3DUSAGE_QUERY_MASK                     0x002F8000L
1338
1339 typedef enum _WINED3DSURFTYPE {
1340     SURFACE_UNKNOWN    = 0,   /* Default / Unknown surface type */
1341     SURFACE_OPENGL,           /* OpenGL surface: Renders using libGL, needed for 3D */
1342     SURFACE_GDI,              /* User surface. No 3D, DirectDraw rendering with GDI */
1343     SURFACE_XRENDER           /* Future dreams: Use XRENDER / EXA / whatever stuff */
1344 } WINED3DSURFTYPE;
1345
1346 #define WINED3DCAPS2_NO2DDURING3DSCENE                 0x00000002L
1347 #define WINED3DCAPS2_FULLSCREENGAMMA                   0x00020000L
1348 #define WINED3DCAPS2_CANRENDERWINDOWED                 0x00080000L
1349 #define WINED3DCAPS2_CANCALIBRATEGAMMA                 0x00100000L
1350 #define WINED3DCAPS2_RESERVED                          0x02000000L
1351 #define WINED3DCAPS2_CANMANAGERESOURCE                 0x10000000L
1352 #define WINED3DCAPS2_DYNAMICTEXTURES                   0x20000000L
1353 #define WINED3DCAPS2_CANAUTOGENMIPMAP                  0x40000000L
1354
1355 #define WINED3DPRASTERCAPS_DITHER                     0x00000001L
1356 #define WINED3DPRASTERCAPS_ROP2                       0x00000002L
1357 #define WINED3DPRASTERCAPS_XOR                        0x00000004L
1358 #define WINED3DPRASTERCAPS_PAT                        0x00000008L
1359 #define WINED3DPRASTERCAPS_ZTEST                      0x00000010L
1360 #define WINED3DPRASTERCAPS_SUBPIXEL                   0x00000020L
1361 #define WINED3DPRASTERCAPS_SUBPIXELX                  0x00000040L
1362 #define WINED3DPRASTERCAPS_FOGVERTEX                  0x00000080L
1363 #define WINED3DPRASTERCAPS_FOGTABLE                   0x00000100L
1364 #define WINED3DPRASTERCAPS_STIPPLE                    0x00000200L
1365 #define WINED3DPRASTERCAPS_ANTIALIASSORTDEPENDENT     0x00000400L
1366 #define WINED3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT   0x00000800L
1367 #define WINED3DPRASTERCAPS_ANTIALIASEDGES             0x00001000L
1368 #define WINED3DPRASTERCAPS_MIPMAPLODBIAS              0x00002000L
1369 #define WINED3DPRASTERCAPS_ZBIAS                      0x00004000L
1370 #define WINED3DPRASTERCAPS_ZBUFFERLESSHSR             0x00008000L
1371 #define WINED3DPRASTERCAPS_FOGRANGE                   0x00010000L
1372 #define WINED3DPRASTERCAPS_ANISOTROPY                 0x00020000L
1373 #define WINED3DPRASTERCAPS_WBUFFER                    0x00040000L
1374 #define WINED3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
1375 #define WINED3DPRASTERCAPS_WFOG                       0x00100000L
1376 #define WINED3DPRASTERCAPS_ZFOG                       0x00200000L
1377 #define WINED3DPRASTERCAPS_COLORPERSPECTIVE           0x00400000L
1378 #define WINED3DPRASTERCAPS_SCISSORTEST                0x01000000L
1379 #define WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS        0x02000000L
1380 #define WINED3DPRASTERCAPS_DEPTHBIAS                  0x04000000L 
1381 #define WINED3DPRASTERCAPS_MULTISAMPLE_TOGGLE         0x08000000L
1382
1383 #define WINED3DPSHADECAPS_COLORFLATMONO               0x000001
1384 #define WINED3DPSHADECAPS_COLORFLATRGB                0x000002
1385 #define WINED3DPSHADECAPS_COLORGOURAUDMONO            0x000004
1386 #define WINED3DPSHADECAPS_COLORGOURAUDRGB             0x000008
1387 #define WINED3DPSHADECAPS_COLORPHONGMONO              0x000010
1388 #define WINED3DPSHADECAPS_COLORPHONGRGB               0x000020
1389 #define WINED3DPSHADECAPS_SPECULARFLATMONO            0x000040
1390 #define WINED3DPSHADECAPS_SPECULARFLATRGB             0x000080
1391 #define WINED3DPSHADECAPS_SPECULARGOURAUDMONO         0x000100
1392 #define WINED3DPSHADECAPS_SPECULARGOURAUDRGB          0x000200
1393 #define WINED3DPSHADECAPS_SPECULARPHONGMONO           0x000400
1394 #define WINED3DPSHADECAPS_SPECULARPHONGRGB            0x000800
1395 #define WINED3DPSHADECAPS_ALPHAFLATBLEND              0x001000
1396 #define WINED3DPSHADECAPS_ALPHAFLATSTIPPLED           0x002000
1397 #define WINED3DPSHADECAPS_ALPHAGOURAUDBLEND           0x004000
1398 #define WINED3DPSHADECAPS_ALPHAGOURAUDSTIPPLED        0x008000
1399 #define WINED3DPSHADECAPS_ALPHAPHONGBLEND             0x010000
1400 #define WINED3DPSHADECAPS_ALPHAPHONGSTIPPLED          0x020000
1401 #define WINED3DPSHADECAPS_FOGFLAT                     0x040000
1402 #define WINED3DPSHADECAPS_FOGGOURAUD                  0x080000
1403 #define WINED3DPSHADECAPS_FOGPHONG                    0x100000
1404
1405 #define WINED3DPTEXTURECAPS_PERSPECTIVE              0x00000001L
1406 #define WINED3DPTEXTURECAPS_POW2                     0x00000002L
1407 #define WINED3DPTEXTURECAPS_ALPHA                    0x00000004L
1408 #define WINED3DPTEXTURECAPS_TRANSPARENCY             0x00000008L
1409 #define WINED3DPTEXTURECAPS_BORDER                   0x00000010L
1410 #define WINED3DPTEXTURECAPS_SQUAREONLY               0x00000020L
1411 #define WINED3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
1412 #define WINED3DPTEXTURECAPS_ALPHAPALETTE             0x00000080L
1413 #define WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL       0x00000100L
1414 #define WINED3DPTEXTURECAPS_PROJECTED                0x00000400L
1415 #define WINED3DPTEXTURECAPS_CUBEMAP                  0x00000800L
1416 #define WINED3DPTEXTURECAPS_COLORKEYBLEND            0x00001000L
1417 #define WINED3DPTEXTURECAPS_VOLUMEMAP                0x00002000L
1418 #define WINED3DPTEXTURECAPS_MIPMAP                   0x00004000L
1419 #define WINED3DPTEXTURECAPS_MIPVOLUMEMAP             0x00008000L
1420 #define WINED3DPTEXTURECAPS_MIPCUBEMAP               0x00010000L
1421 #define WINED3DPTEXTURECAPS_CUBEMAP_POW2             0x00020000L
1422 #define WINED3DPTEXTURECAPS_VOLUMEMAP_POW2           0x00040000L
1423 #define WINED3DPTEXTURECAPS_NOPROJECTEDBUMPENV       0x00200000L
1424
1425 #define WINED3DPTFILTERCAPS_NEAREST                  0x00000001
1426 #define WINED3DPTFILTERCAPS_LINEAR                   0x00000002
1427 #define WINED3DPTFILTERCAPS_MIPNEAREST               0x00000004
1428 #define WINED3DPTFILTERCAPS_MIPLINEAR                0x00000008
1429 #define WINED3DPTFILTERCAPS_LINEARMIPNEAREST         0x00000010
1430 #define WINED3DPTFILTERCAPS_LINEARMIPLINEAR          0x00000020
1431 #define WINED3DPTFILTERCAPS_MINFPOINT                0x00000100
1432 #define WINED3DPTFILTERCAPS_MINFLINEAR               0x00000200
1433 #define WINED3DPTFILTERCAPS_MINFANISOTROPIC          0x00000400
1434 #define WINED3DPTFILTERCAPS_MIPFPOINT                0x00010000
1435 #define WINED3DPTFILTERCAPS_MIPFLINEAR               0x00020000
1436 #define WINED3DPTFILTERCAPS_MAGFPOINT                0x01000000
1437 #define WINED3DPTFILTERCAPS_MAGFLINEAR               0x02000000
1438 #define WINED3DPTFILTERCAPS_MAGFANISOTROPIC          0x04000000
1439 #define WINED3DPTFILTERCAPS_MAGFPYRAMIDALQUAD        0x08000000
1440 #define WINED3DPTFILTERCAPS_MAGFGAUSSIANQUAD         0x10000000
1441
1442 #define WINED3DVTXPCAPS_TEXGEN                       0x00000001L
1443 #define WINED3DVTXPCAPS_MATERIALSOURCE7              0x00000002L
1444 #define WINED3DVTXPCAPS_VERTEXFOG                    0x00000004L
1445 #define WINED3DVTXPCAPS_DIRECTIONALLIGHTS            0x00000008L
1446 #define WINED3DVTXPCAPS_POSITIONALLIGHTS             0x00000010L
1447 #define WINED3DVTXPCAPS_LOCALVIEWER                  0x00000020L
1448 #define WINED3DVTXPCAPS_TWEENING                     0x00000040L
1449 #define WINED3DVTXPCAPS_TEXGEN_SPHEREMAP             0x00000100L
1450 #define WINED3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER     0x00000200L
1451
1452 #define WINED3DDEVCAPS_FLOATTLVERTEX                 0x000000001
1453 #define WINED3DDEVCAPS_SORTINCREASINGZ               0x000000002
1454 #define WINED3DDEVCAPS_SORTDECREASINGZ               0X000000004
1455 #define WINED3DDEVCAPS_SORTEXACT                     0x000000008
1456 #define WINED3DDEVCAPS_EXECUTESYSTEMMEMORY           0x000000010
1457 #define WINED3DDEVCAPS_EXECUTEVIDEOMEMORY            0x000000020
1458 #define WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY          0x000000040
1459 #define WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY           0x000000080
1460 #define WINED3DDEVCAPS_TEXTURESYSTEMMEMORY           0x000000100
1461 #define WINED3DDEVCAPS_TEXTUREVIDEOMEMORY            0x000000200
1462 #define WINED3DDEVCAPS_DRAWPRIMTLVERTEX              0x000000400
1463 #define WINED3DDEVCAPS_CANRENDERAFTERFLIP            0x000000800
1464 #define WINED3DDEVCAPS_TEXTURENONLOCALVIDMEM         0x000001000
1465 #define WINED3DDEVCAPS_DRAWPRIMITIVES2               0x000002000
1466 #define WINED3DDEVCAPS_SEPARATETEXTUREMEMORIES       0x000004000
1467 #define WINED3DDEVCAPS_DRAWPRIMITIVES2EX             0x000008000
1468 #define WINED3DDEVCAPS_HWTRANSFORMANDLIGHT           0x000010000
1469 #define WINED3DDEVCAPS_CANBLTSYSTONONLOCAL           0x000020000
1470 #define WINED3DDEVCAPS_HWRASTERIZATION               0x000080000
1471 #define WINED3DDEVCAPS_PUREDEVICE                    0x000100000
1472 #define WINED3DDEVCAPS_QUINTICRTPATCHES              0x000200000
1473 #define WINED3DDEVCAPS_RTPATCHES                     0x000400000
1474 #define WINED3DDEVCAPS_RTPATCHHANDLEZERO             0x000800000
1475 #define WINED3DDEVCAPS_NPATCHES                      0x001000000
1476
1477 #define WINED3DLOCK_READONLY           0x0010
1478 #define WINED3DLOCK_NOSYSLOCK          0x0800
1479 #define WINED3DLOCK_NOOVERWRITE        0x1000
1480 #define WINED3DLOCK_DISCARD            0x2000
1481 #define WINED3DLOCK_DONOTWAIT          0x4000
1482 #define WINED3DLOCK_NO_DIRTY_UPDATE    0x8000
1483
1484 #define WINED3DPRESENT_RATE_DEFAULT                  0x000000000
1485
1486 #define WINED3DPRESENT_INTERVAL_DEFAULT              0x00000000
1487 #define WINED3DPRESENT_INTERVAL_ONE                  0x00000001
1488 #define WINED3DPRESENT_INTERVAL_TWO                  0x00000002
1489 #define WINED3DPRESENT_INTERVAL_THREE                0x00000004
1490 #define WINED3DPRESENT_INTERVAL_FOUR                 0x00000008
1491 #define WINED3DPRESENT_INTERVAL_IMMEDIATE            0x80000000
1492
1493 #define WINED3DMAXUSERCLIPPLANES       32
1494 #define WINED3DCLIPPLANE0              (1 << 0)
1495 #define WINED3DCLIPPLANE1              (1 << 1)
1496 #define WINED3DCLIPPLANE2              (1 << 2)
1497 #define WINED3DCLIPPLANE3              (1 << 3)
1498 #define WINED3DCLIPPLANE4              (1 << 4)
1499 #define WINED3DCLIPPLANE5              (1 << 5)
1500
1501 /* FVF (Flexible Vertex Format) codes */
1502 #define WINED3DFVF_RESERVED0           0x0001
1503 #define WINED3DFVF_POSITION_MASK       0x000E
1504 #define WINED3DFVF_XYZ                 0x0002
1505 #define WINED3DFVF_XYZRHW              0x0004
1506 #define WINED3DFVF_XYZB1               0x0006
1507 #define WINED3DFVF_XYZB2               0x0008
1508 #define WINED3DFVF_XYZB3               0x000a
1509 #define WINED3DFVF_XYZB4               0x000c
1510 #define WINED3DFVF_XYZB5               0x000e
1511 #define WINED3DFVF_XYZW                0x4002
1512 #define WINED3DFVF_NORMAL              0x0010
1513 #define WINED3DFVF_PSIZE               0x0020
1514 #define WINED3DFVF_DIFFUSE             0x0040
1515 #define WINED3DFVF_SPECULAR            0x0080
1516 #define WINED3DFVF_TEXCOUNT_MASK       0x0f00
1517 #define WINED3DFVF_TEXCOUNT_SHIFT           8
1518 #define WINED3DFVF_TEX0                0x0000
1519 #define WINED3DFVF_TEX1                0x0100
1520 #define WINED3DFVF_TEX2                0x0200
1521 #define WINED3DFVF_TEX3                0x0300
1522 #define WINED3DFVF_TEX4                0x0400
1523 #define WINED3DFVF_TEX5                0x0500
1524 #define WINED3DFVF_TEX6                0x0600
1525 #define WINED3DFVF_TEX7                0x0700
1526 #define WINED3DFVF_TEX8                0x0800
1527 #define WINED3DFVF_LASTBETA_UBYTE4     0x1000
1528 #define WINED3DFVF_LASTBETA_D3DCOLOR   0x8000
1529 #define WINED3DFVF_RESERVED2           0x6000
1530
1531 #define WINED3DFVF_TEXTUREFORMAT1 3
1532 #define WINED3DFVF_TEXTUREFORMAT2 0
1533 #define WINED3DFVF_TEXTUREFORMAT3 1
1534 #define WINED3DFVF_TEXTUREFORMAT4 2
1535 #define WINED3DFVF_TEXCOORDSIZE1(CoordIndex) (WINED3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
1536 #define WINED3DFVF_TEXCOORDSIZE2(CoordIndex) (WINED3DFVF_TEXTUREFORMAT2)
1537 #define WINED3DFVF_TEXCOORDSIZE3(CoordIndex) (WINED3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
1538 #define WINED3DFVF_TEXCOORDSIZE4(CoordIndex) (WINED3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
1539
1540 /* Clear flags */
1541 #define WINED3DCLEAR_TARGET   0x00000001
1542 #define WINED3DCLEAR_ZBUFFER  0x00000002
1543 #define WINED3DCLEAR_STENCIL  0x00000004
1544
1545 /* Stream source flags */
1546 #define WINED3DSTREAMSOURCE_INDEXEDDATA  (1 << 30)
1547 #define WINED3DSTREAMSOURCE_INSTANCEDATA (2 << 30)
1548
1549 /* SetPrivateData flags */
1550 #define WINED3DSPD_IUNKNOWN 0x00000001
1551
1552 /* IWineD3D::CreateDevice behaviour flags */
1553 #define WINED3DCREATE_FPU_PRESERVE                  0x00000002
1554 #define WINED3DCREATE_PUREDEVICE                    0x00000010
1555 #define WINED3DCREATE_SOFTWARE_VERTEXPROCESSING     0x00000020
1556 #define WINED3DCREATE_HARDWARE_VERTEXPROCESSING     0x00000040
1557 #define WINED3DCREATE_MIXED_VERTEXPROCESSING        0x00000080
1558 #define WINED3DCREATE_DISABLE_DRIVER_MANAGEMENT     0x00000100
1559 #define WINED3DCREATE_ADAPTERGROUP_DEVICE           0x00000200
1560
1561 /* DirectDraw types */
1562
1563 typedef struct _WINEDDCOLORKEY
1564 {
1565     DWORD       dwColorSpaceLowValue;           /* low boundary of color space that is to
1566                                                  * be treated as Color Key, inclusive
1567                                                  */
1568     DWORD       dwColorSpaceHighValue;          /* high boundary of color space that is
1569                                                  * to be treated as Color Key, inclusive
1570                                                  */
1571 } WINEDDCOLORKEY,*LPWINEDDCOLORKEY;
1572
1573 typedef struct _WINEDDBLTFX
1574 {
1575     DWORD       dwSize;                         /* size of structure */
1576     DWORD       dwDDFX;                         /* FX operations */
1577     DWORD       dwROP;                          /* Win32 raster operations */
1578     DWORD       dwDDROP;                        /* Raster operations new for DirectDraw */
1579     DWORD       dwRotationAngle;                /* Rotation angle for blt */
1580     DWORD       dwZBufferOpCode;                /* ZBuffer compares */
1581     DWORD       dwZBufferLow;                   /* Low limit of Z buffer */
1582     DWORD       dwZBufferHigh;                  /* High limit of Z buffer */
1583     DWORD       dwZBufferBaseDest;              /* Destination base value */
1584     DWORD       dwZDestConstBitDepth;           /* Bit depth used to specify Z constant for destination */
1585     union
1586     {
1587         DWORD   dwZDestConst;                   /* Constant to use as Z buffer for dest */
1588         struct IWineD3DSurface *lpDDSZBufferDest;      /* Surface to use as Z buffer for dest */
1589     } DUMMYUNIONNAME1;
1590     DWORD       dwZSrcConstBitDepth;            /* Bit depth used to specify Z constant for source */
1591     union
1592     {
1593         DWORD   dwZSrcConst;                    /* Constant to use as Z buffer for src */
1594         struct IWineD3DSurface *lpDDSZBufferSrc;/* Surface to use as Z buffer for src */
1595     } DUMMYUNIONNAME2;
1596     DWORD       dwAlphaEdgeBlendBitDepth;       /* Bit depth used to specify constant for alpha edge blend */
1597     DWORD       dwAlphaEdgeBlend;               /* Alpha for edge blending */
1598     DWORD       dwReserved;
1599     DWORD       dwAlphaDestConstBitDepth;       /* Bit depth used to specify alpha constant for destination */
1600     union
1601     {
1602         DWORD   dwAlphaDestConst;               /* Constant to use as Alpha Channel */
1603         struct IWineD3DSurface *lpDDSAlphaDest; /* Surface to use as Alpha Channel */
1604     } DUMMYUNIONNAME3;
1605     DWORD       dwAlphaSrcConstBitDepth;        /* Bit depth used to specify alpha constant for source */
1606     union
1607     {
1608         DWORD   dwAlphaSrcConst;                /* Constant to use as Alpha Channel */
1609         struct IWineD3DSurface *lpDDSAlphaSrc;  /* Surface to use as Alpha Channel */
1610     } DUMMYUNIONNAME4;
1611     union
1612     {
1613         DWORD   dwFillColor;                    /* color in RGB or Palettized */
1614         DWORD   dwFillDepth;                    /* depth value for z-buffer */
1615         DWORD   dwFillPixel;                    /* pixel val for RGBA or RGBZ */
1616         struct IWineD3DSurface *lpDDSPattern;   /* Surface to use as pattern */
1617     } DUMMYUNIONNAME5;
1618     WINEDDCOLORKEY  ddckDestColorkey;          /* DestColorkey override */
1619     WINEDDCOLORKEY  ddckSrcColorkey;           /* SrcColorkey override */
1620 } WINEDDBLTFX,*LPWINEDDBLTFX;
1621
1622 typedef struct _WINEDDOVERLAYFX
1623 {
1624     DWORD       dwSize;                         /* size of structure */
1625     DWORD       dwAlphaEdgeBlendBitDepth;       /* Bit depth used to specify constant for alpha edge blend */
1626     DWORD       dwAlphaEdgeBlend;               /* Constant to use as alpha for edge blend */
1627     DWORD       dwReserved;
1628     DWORD       dwAlphaDestConstBitDepth;       /* Bit depth used to specify alpha constant for destination */
1629     union
1630     {
1631         DWORD   dwAlphaDestConst;               /* Constant to use as alpha channel for dest */
1632         struct IWineD3DSurface *lpDDSAlphaDest; /* Surface to use as alpha channel for dest */
1633     } DUMMYUNIONNAME1;
1634     DWORD       dwAlphaSrcConstBitDepth;        /* Bit depth used to specify alpha constant for source */
1635     union
1636     {
1637         DWORD   dwAlphaSrcConst;                /* Constant to use as alpha channel for src */
1638         struct IWineD3DSurface *lpDDSAlphaSrc;  /* Surface to use as alpha channel for src */
1639     } DUMMYUNIONNAME2;
1640     WINEDDCOLORKEY  dckDestColorkey;            /* DestColorkey override */
1641     WINEDDCOLORKEY  dckSrcColorkey;             /* DestColorkey override */
1642     DWORD       dwDDFX;                         /* Overlay FX */
1643     DWORD       dwFlags;                        /* flags */
1644 } WINEDDOVERLAYFX;
1645
1646 /* dwDDFX */
1647 /* arithmetic stretching along y axis */
1648 #define WINEDDBLTFX_ARITHSTRETCHY               0x00000001
1649 /* mirror on y axis */
1650 #define WINEDDBLTFX_MIRRORLEFTRIGHT             0x00000002
1651 /* mirror on x axis */
1652 #define WINEDDBLTFX_MIRRORUPDOWN                0x00000004
1653 /* do not tear */
1654 #define WINEDDBLTFX_NOTEARING                   0x00000008
1655 /* 180 degrees clockwise rotation */
1656 #define WINEDDBLTFX_ROTATE180                   0x00000010
1657 /* 270 degrees clockwise rotation */
1658 #define WINEDDBLTFX_ROTATE270                   0x00000020
1659 /* 90 degrees clockwise rotation */
1660 #define WINEDDBLTFX_ROTATE90                    0x00000040
1661 /* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
1662 #define WINEDDBLTFX_ZBUFFERRANGE                0x00000080
1663 /* add dwZBufferBaseDest to every source z value before compare */
1664 #define WINEDDBLTFX_ZBUFFERBASEDEST             0x00000100
1665
1666 /* dwFlags for Blt* */
1667 #define WINEDDBLT_ALPHADEST                     0x00000001
1668 #define WINEDDBLT_ALPHADESTCONSTOVERRIDE        0x00000002
1669 #define WINEDDBLT_ALPHADESTNEG                  0x00000004
1670 #define WINEDDBLT_ALPHADESTSURFACEOVERRIDE      0x00000008
1671 #define WINEDDBLT_ALPHAEDGEBLEND                0x00000010
1672 #define WINEDDBLT_ALPHASRC                      0x00000020
1673 #define WINEDDBLT_ALPHASRCCONSTOVERRIDE         0x00000040
1674 #define WINEDDBLT_ALPHASRCNEG                   0x00000080
1675 #define WINEDDBLT_ALPHASRCSURFACEOVERRIDE       0x00000100
1676 #define WINEDDBLT_ASYNC                         0x00000200
1677 #define WINEDDBLT_COLORFILL                     0x00000400
1678 #define WINEDDBLT_DDFX                          0x00000800
1679 #define WINEDDBLT_DDROPS                        0x00001000
1680 #define WINEDDBLT_KEYDEST                       0x00002000
1681 #define WINEDDBLT_KEYDESTOVERRIDE               0x00004000
1682 #define WINEDDBLT_KEYSRC                        0x00008000
1683 #define WINEDDBLT_KEYSRCOVERRIDE                0x00010000
1684 #define WINEDDBLT_ROP                           0x00020000
1685 #define WINEDDBLT_ROTATIONANGLE                 0x00040000
1686 #define WINEDDBLT_ZBUFFER                       0x00080000
1687 #define WINEDDBLT_ZBUFFERDESTCONSTOVERRIDE      0x00100000
1688 #define WINEDDBLT_ZBUFFERDESTOVERRIDE           0x00200000
1689 #define WINEDDBLT_ZBUFFERSRCCONSTOVERRIDE       0x00400000
1690 #define WINEDDBLT_ZBUFFERSRCOVERRIDE            0x00800000
1691 #define WINEDDBLT_WAIT                          0x01000000
1692 #define WINEDDBLT_DEPTHFILL                     0x02000000
1693 #define WINEDDBLT_DONOTWAIT                     0x08000000
1694
1695 /* dwTrans for BltFast */
1696 #define WINEDDBLTFAST_NOCOLORKEY                0x00000000
1697 #define WINEDDBLTFAST_SRCCOLORKEY               0x00000001
1698 #define WINEDDBLTFAST_DESTCOLORKEY              0x00000002
1699 #define WINEDDBLTFAST_WAIT                      0x00000010
1700 #define WINEDDBLTFAST_DONOTWAIT                 0x00000020
1701
1702 /* DDCAPS.dwPalCaps */
1703 #define WINEDDPCAPS_4BIT                        0x00000001
1704 #define WINEDDPCAPS_8BITENTRIES                 0x00000002
1705 #define WINEDDPCAPS_8BIT                        0x00000004
1706 #define WINEDDPCAPS_INITIALIZE                  0x00000008
1707 #define WINEDDPCAPS_PRIMARYSURFACE              0x00000010
1708 #define WINEDDPCAPS_PRIMARYSURFACELEFT          0x00000020
1709 #define WINEDDPCAPS_ALLOW256                    0x00000040
1710 #define WINEDDPCAPS_VSYNC                       0x00000080
1711 #define WINEDDPCAPS_1BIT                        0x00000100
1712 #define WINEDDPCAPS_2BIT                        0x00000200
1713 #define WINEDDPCAPS_ALPHA                       0x00000400
1714
1715 /* DDSURFACEDESC.dwFlags */
1716 #define WINEDDSD_CAPS                           0x00000001
1717 #define WINEDDSD_HEIGHT                         0x00000002
1718 #define WINEDDSD_WIDTH                          0x00000004
1719 #define WINEDDSD_PITCH                          0x00000008
1720 #define WINEDDSD_BACKBUFFERCOUNT                0x00000020
1721 #define WINEDDSD_ZBUFFERBITDEPTH                0x00000040
1722 #define WINEDDSD_ALPHABITDEPTH                  0x00000080
1723 #define WINEDDSD_LPSURFACE                      0x00000800
1724 #define WINEDDSD_PIXELFORMAT                    0x00001000
1725 #define WINEDDSD_CKDESTOVERLAY                  0x00002000
1726 #define WINEDDSD_CKDESTBLT                      0x00004000
1727 #define WINEDDSD_CKSRCOVERLAY                   0x00008000
1728 #define WINEDDSD_CKSRCBLT                       0x00010000
1729 #define WINEDDSD_MIPMAPCOUNT                    0x00020000
1730 #define WINEDDSD_REFRESHRATE                    0x00040000
1731 #define WINEDDSD_LINEARSIZE                     0x00080000
1732 #define WINEDDSD_TEXTURESTAGE                   0x00100000
1733 #define WINEDDSD_FVF                            0x00200000
1734 #define WINEDDSD_SRCVBHANDLE                    0x00400000
1735 #define WINEDDSD_ALL                            0x007ff9ee
1736
1737 /* Set/Get Colour Key Flags */
1738 #define WINEDDCKEY_COLORSPACE                   0x00000001  /* Struct is single colour space */
1739 #define WINEDDCKEY_DESTBLT                      0x00000002  /* To be used as dest for blt */
1740 #define WINEDDCKEY_DESTOVERLAY                  0x00000004  /* To be used as dest for CK overlays */
1741 #define WINEDDCKEY_SRCBLT                       0x00000008  /* To be used as src for blt */
1742 #define WINEDDCKEY_SRCOVERLAY                   0x00000010  /* To be used as src for CK overlays */
1743
1744 /* dwFlags for GetBltStatus */
1745 #define WINEDDGBS_CANBLT                        0x00000001
1746 #define WINEDDGBS_ISBLTDONE                     0x00000002
1747
1748 /* dwFlags for GetFlipStatus */
1749 #define WINEDDGFS_CANFLIP                       1L
1750 #define WINEDDGFS_ISFLIPDONE                    2L
1751
1752 #endif