netapi32: Fix the size of allocation for the string returned from NetpGetComputerName.
[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 #define WINED3D_VSHADER_MAX_CONSTANTS 96
122 #define WINED3D_PSHADER_MAX_CONSTANTS 32
123
124 typedef struct _WINED3DVECTOR_3 {
125     float x;
126     float y;
127     float z;
128 } WINED3DVECTOR_3;
129
130 typedef struct _WINED3DVECTOR_4 {
131     float x;
132     float y;
133     float z;
134     float w;
135 } WINED3DVECTOR_4;
136
137 typedef struct WINED3DSHADERVECTOR {
138   float x;
139   float y;
140   float z;
141   float w;
142 } WINED3DSHADERVECTOR;
143
144 typedef struct WINED3DSHADERSCALAR {
145   float x;
146 } WINED3DSHADERSCALAR;
147
148 typedef WINED3DSHADERVECTOR WINEVSHADERCONSTANTS8[WINED3D_VSHADER_MAX_CONSTANTS];
149
150 typedef struct VSHADERDATA {
151   /** Run Time Shader Function Constants */
152   /*D3DXBUFFER* constants;*/
153   WINEVSHADERCONSTANTS8 C;
154   /** Shader Code as char ... */
155   CONST DWORD* code;
156   UINT codeLength;
157 } VSHADERDATA;
158
159 /** temporary here waiting for buffer code */
160 typedef struct VSHADERINPUTDATA {
161   WINED3DSHADERVECTOR V[17];
162 } WINEVSHADERINPUTDATA;
163
164 /** temporary here waiting for buffer code */
165 typedef struct VSHADEROUTPUTDATA {
166   WINED3DSHADERVECTOR oPos;
167   WINED3DSHADERVECTOR oD[2];
168   WINED3DSHADERVECTOR oT[8];
169   WINED3DSHADERVECTOR oFog;
170   WINED3DSHADERVECTOR oPts;
171 } WINEVSHADEROUTPUTDATA;
172
173 typedef WINED3DSHADERVECTOR WINEPSHADERCONSTANTS8[WINED3D_PSHADER_MAX_CONSTANTS];
174
175 typedef struct PSHADERDATA {
176   /** Run Time Shader Function Constants */
177   /*D3DXBUFFER* constants;*/
178   WINEPSHADERCONSTANTS8 C;
179   /** Shader Code as char ... */
180   CONST DWORD* code;
181   UINT codeLength;
182 } PSHADERDATA;
183
184 /** temporary here waiting for buffer code */
185 typedef struct PSHADERINPUTDATA {
186   WINED3DSHADERVECTOR V[2];
187   WINED3DSHADERVECTOR T[8];
188   WINED3DSHADERVECTOR S[16];
189   /*D3DSHADERVECTOR R[12];*/
190 } WINEPSHADERINPUTDATA;
191
192 /** temporary here waiting for buffer code */
193 typedef struct PSHADEROUTPUTDATA {
194   WINED3DSHADERVECTOR oC[4];
195   WINED3DSHADERVECTOR oDepth;
196 } WINEPSHADEROUTPUTDATA;
197
198 /*****************************************************************************
199  * WineD3D Structures to be used when d3d8 and d3d9 are incompatible
200  */
201
202
203 typedef enum _WINED3DDEVTYPE {
204     WINED3DDEVTYPE_HAL         = 1,
205     WINED3DDEVTYPE_REF         = 2,
206     WINED3DDEVTYPE_SW          = 3,
207     WINED3DDEVTYPE_NULLREF     = 4,
208
209     WINED3DDEVTYPE_FORCE_DWORD = 0xffffffff
210 } WINED3DDEVTYPE;
211
212 typedef enum _WINED3DDEGREETYPE {
213     WINED3DDEGREE_LINEAR      = 1,
214     WINED3DDEGREE_QUADRATIC   = 2,
215     WINED3DDEGREE_CUBIC       = 3,
216     WINED3DDEGREE_QUINTIC     = 5,
217     
218     WINED3DDEGREE_FORCE_DWORD   = 0x7fffffff
219 } WINED3DDEGREETYPE;
220
221 typedef enum _WINED3DFORMAT {
222     WINED3DFMT_UNKNOWN              =   0,
223
224     WINED3DFMT_R8G8B8               =  20,
225     WINED3DFMT_A8R8G8B8             =  21,
226     WINED3DFMT_X8R8G8B8             =  22,
227     WINED3DFMT_R5G6B5               =  23,
228     WINED3DFMT_X1R5G5B5             =  24,
229     WINED3DFMT_A1R5G5B5             =  25,
230     WINED3DFMT_A4R4G4B4             =  26,
231     WINED3DFMT_R3G3B2               =  27,
232     WINED3DFMT_A8                   =  28,
233     WINED3DFMT_A8R3G3B2             =  29,
234     WINED3DFMT_X4R4G4B4             =  30,
235     WINED3DFMT_A2B10G10R10          =  31,
236     WINED3DFMT_A8B8G8R8             =  32,
237     WINED3DFMT_X8B8G8R8             =  33,
238     WINED3DFMT_G16R16               =  34,
239     WINED3DFMT_A2R10G10B10          =  35,
240     WINED3DFMT_A16B16G16R16         =  36,
241   
242
243     WINED3DFMT_A8P8                 =  40,
244     WINED3DFMT_P8                   =  41,
245
246     WINED3DFMT_L8                   =  50,
247     WINED3DFMT_A8L8                 =  51,
248     WINED3DFMT_A4L4                 =  52,
249
250     WINED3DFMT_V8U8                 =  60,
251     WINED3DFMT_L6V5U5               =  61,
252     WINED3DFMT_X8L8V8U8             =  62,
253     WINED3DFMT_Q8W8V8U8             =  63,
254     WINED3DFMT_V16U16               =  64,
255     WINED3DFMT_W11V11U10            =  65,
256     WINED3DFMT_A2W10V10U10          =  67,
257
258     WINED3DFMT_UYVY                 =  MAKEFOURCC('U', 'Y', 'V', 'Y'),
259     WINED3DFMT_YUY2                 =  MAKEFOURCC('Y', 'U', 'Y', '2'),
260     WINED3DFMT_DXT1                 =  MAKEFOURCC('D', 'X', 'T', '1'),
261     WINED3DFMT_DXT2                 =  MAKEFOURCC('D', 'X', 'T', '2'),
262     WINED3DFMT_DXT3                 =  MAKEFOURCC('D', 'X', 'T', '3'),
263     WINED3DFMT_DXT4                 =  MAKEFOURCC('D', 'X', 'T', '4'),
264     WINED3DFMT_DXT5                 =  MAKEFOURCC('D', 'X', 'T', '5'),
265     WINED3DFMT_MULTI2_ARGB          =  MAKEFOURCC('M', 'E', 'T', '1'),
266     WINED3DFMT_G8R8_G8B8            =  MAKEFOURCC('G', 'R', 'G', 'B'),
267     WINED3DFMT_R8G8_B8G8            =  MAKEFOURCC('R', 'G', 'B', 'G'),
268
269     WINED3DFMT_D16_LOCKABLE         =  70,
270     WINED3DFMT_D32                  =  71,
271     WINED3DFMT_D15S1                =  73,
272     WINED3DFMT_D24S8                =  75,
273     WINED3DFMT_D24X8                =  77,
274     WINED3DFMT_D24X4S4              =  79,
275     WINED3DFMT_D16                  =  80,
276     WINED3DFMT_L16                  =  81,
277     WINED3DFMT_D32F_LOCKABLE        =  82,
278     WINED3DFMT_D24FS8               =  83,
279
280     WINED3DFMT_VERTEXDATA           = 100,
281     WINED3DFMT_INDEX16              = 101,
282     WINED3DFMT_INDEX32              = 102,
283     WINED3DFMT_Q16W16V16U16         = 110,
284     /* Flaoting point formats */
285     WINED3DFMT_R16F                 = 111,
286     WINED3DFMT_G16R16F              = 112,
287     WINED3DFMT_A16B16G16R16F        = 113,
288     
289     /* IEEE formats */
290     WINED3DFMT_R32F                 = 114,
291     WINED3DFMT_G32R32F              = 115,
292     WINED3DFMT_A32B32G32R32F        = 116,
293     
294     WINED3DFMT_CxV8U8               = 117,
295
296
297     WINED3DFMT_FORCE_DWORD          = 0xFFFFFFFF
298 } WINED3DFORMAT;
299
300 typedef enum _WINED3DRENDERSTATETYPE {
301     WINED3DRS_TEXTUREHANDLE             =   1, /* d3d7 */
302     WINED3DRS_ANTIALIAS                 =   2, /* d3d7 */
303     WINED3DRS_TEXTUREADDRESS            =   3, /* d3d7 */
304     WINED3DRS_TEXTUREPERSPECTIVE        =   4, /* d3d7 */
305     WINED3DRS_WRAPU                     =   5, /* d3d7 */
306     WINED3DRS_WRAPV                     =   6, /* d3d7 */
307     WINED3DRS_ZENABLE                   =   7,
308     WINED3DRS_FILLMODE                  =   8,
309     WINED3DRS_SHADEMODE                 =   9,
310     WINED3DRS_LINEPATTERN               =  10, /* d3d7, d3d8 */
311     WINED3DRS_MONOENABLE                =  11, /* d3d7 */
312     WINED3DRS_ROP2                      =  12, /* d3d7 */
313     WINED3DRS_PLANEMASK                 =  13, /* d3d7 */
314     WINED3DRS_ZWRITEENABLE              =  14,
315     WINED3DRS_ALPHATESTENABLE           =  15,
316     WINED3DRS_LASTPIXEL                 =  16,
317     WINED3DRS_TEXTUREMAG                =  17, /* d3d7 */
318     WINED3DRS_TEXTUREMIN                =  18, /* d3d7 */
319     WINED3DRS_SRCBLEND                  =  19,
320     WINED3DRS_DESTBLEND                 =  20,
321     WINED3DRS_TEXTUREMAPBLEND           =  21, /* d3d7 */
322     WINED3DRS_CULLMODE                  =  22,
323     WINED3DRS_ZFUNC                     =  23,
324     WINED3DRS_ALPHAREF                  =  24,
325     WINED3DRS_ALPHAFUNC                 =  25,
326     WINED3DRS_DITHERENABLE              =  26,
327     WINED3DRS_ALPHABLENDENABLE          =  27,
328     WINED3DRS_FOGENABLE                 =  28,
329     WINED3DRS_SPECULARENABLE            =  29,
330     WINED3DRS_ZVISIBLE                  =  30, /* d3d7, d3d8 */
331     WINED3DRS_SUBPIXEL                  =  31, /* d3d7 */
332     WINED3DRS_SUBPIXELX                 =  32, /* d3d7 */
333     WINED3DRS_STIPPLEDALPHA             =  33, /* d3d7 */
334     WINED3DRS_FOGCOLOR                  =  34,
335     WINED3DRS_FOGTABLEMODE              =  35,
336     WINED3DRS_FOGSTART                  =  36,
337     WINED3DRS_FOGEND                    =  37,
338     WINED3DRS_FOGDENSITY                =  38,
339     WINED3DRS_STIPPLEENABLE             =  39, /* d3d7 */
340     WINED3DRS_EDGEANTIALIAS             =  40, /* d3d7, d3d8 */
341     WINED3DRS_COLORKEYENABLE            =  41, /* d3d7 */
342     WINED3DRS_BORDERCOLOR               =  43, /* d3d7 */
343     WINED3DRS_TEXTUREADDRESSU           =  44, /* d3d7 */
344     WINED3DRS_TEXTUREADDRESSV           =  45, /* d3d7 */
345     WINED3DRS_MIPMAPLODBIAS             =  46, /* d3d7 */
346     WINED3DRS_ZBIAS                     =  47, /* d3d7, d3d8 */
347     WINED3DRS_RANGEFOGENABLE            =  48,
348     WINED3DRS_ANISOTROPY                =  49, /* d3d7 */
349     WINED3DRS_FLUSHBATCH                =  50, /* d3d7 */
350     WINED3DRS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */
351     WINED3DRS_STENCILENABLE             =  52,
352     WINED3DRS_STENCILFAIL               =  53,
353     WINED3DRS_STENCILZFAIL              =  54,
354     WINED3DRS_STENCILPASS               =  55,
355     WINED3DRS_STENCILFUNC               =  56,
356     WINED3DRS_STENCILREF                =  57,
357     WINED3DRS_STENCILMASK               =  58,
358     WINED3DRS_STENCILWRITEMASK          =  59,
359     WINED3DRS_TEXTUREFACTOR             =  60,
360     WINED3DRS_WRAP0                     = 128,
361     WINED3DRS_WRAP1                     = 129,
362     WINED3DRS_WRAP2                     = 130,
363     WINED3DRS_WRAP3                     = 131,
364     WINED3DRS_WRAP4                     = 132,
365     WINED3DRS_WRAP5                     = 133,
366     WINED3DRS_WRAP6                     = 134,
367     WINED3DRS_WRAP7                     = 135,
368     WINED3DRS_CLIPPING                  = 136,
369     WINED3DRS_LIGHTING                  = 137,
370     WINED3DRS_EXTENTS                   = 138, /* d3d7 */
371     WINED3DRS_AMBIENT                   = 139,
372     WINED3DRS_FOGVERTEXMODE             = 140,
373     WINED3DRS_COLORVERTEX               = 141,
374     WINED3DRS_LOCALVIEWER               = 142,
375     WINED3DRS_NORMALIZENORMALS          = 143,
376     WINED3DRS_COLORKEYBLENDENABLE       = 144, /* d3d7 */
377     WINED3DRS_DIFFUSEMATERIALSOURCE     = 145,
378     WINED3DRS_SPECULARMATERIALSOURCE    = 146,
379     WINED3DRS_AMBIENTMATERIALSOURCE     = 147,
380     WINED3DRS_EMISSIVEMATERIALSOURCE    = 148,
381     WINED3DRS_VERTEXBLEND               = 151,
382     WINED3DRS_CLIPPLANEENABLE           = 152,  
383     WINED3DRS_SOFTWAREVERTEXPROCESSING  = 153, /* d3d8 */
384     WINED3DRS_POINTSIZE                 = 154,
385     WINED3DRS_POINTSIZE_MIN             = 155,
386     WINED3DRS_POINTSPRITEENABLE         = 156,
387     WINED3DRS_POINTSCALEENABLE          = 157,
388     WINED3DRS_POINTSCALE_A              = 158,
389     WINED3DRS_POINTSCALE_B              = 159,
390     WINED3DRS_POINTSCALE_C              = 160,
391     WINED3DRS_MULTISAMPLEANTIALIAS      = 161,
392     WINED3DRS_MULTISAMPLEMASK           = 162,
393     WINED3DRS_PATCHEDGESTYLE            = 163,
394     WINED3DRS_PATCHSEGMENTS             = 164, /* d3d8 */
395     WINED3DRS_DEBUGMONITORTOKEN         = 165,
396     WINED3DRS_POINTSIZE_MAX             = 166,
397     WINED3DRS_INDEXEDVERTEXBLENDENABLE  = 167,
398     WINED3DRS_COLORWRITEENABLE          = 168,
399     WINED3DRS_TWEENFACTOR               = 170,
400     WINED3DRS_BLENDOP                   = 171,
401     WINED3DRS_POSITIONORDER             = 172,
402     WINED3DRS_NORMALORDER               = 173,
403     WINED3DRS_POSITIONDEGREE            = 172,
404     WINED3DRS_NORMALDEGREE              = 173,
405     WINED3DRS_SCISSORTESTENABLE         = 174,
406     WINED3DRS_SLOPESCALEDEPTHBIAS       = 175,
407     WINED3DRS_ANTIALIASEDLINEENABLE     = 176,
408     WINED3DRS_MINTESSELLATIONLEVEL      = 178,
409     WINED3DRS_MAXTESSELLATIONLEVEL      = 179,
410     WINED3DRS_ADAPTIVETESS_X            = 180,
411     WINED3DRS_ADAPTIVETESS_Y            = 181,
412     WINED3DRS_ADAPTIVETESS_Z            = 182,
413     WINED3DRS_ADAPTIVETESS_W            = 183,
414     WINED3DRS_ENABLEADAPTIVETESSELLATION= 184,
415     WINED3DRS_TWOSIDEDSTENCILMODE       = 185,
416     WINED3DRS_CCW_STENCILFAIL           = 186,
417     WINED3DRS_CCW_STENCILZFAIL          = 187,
418     WINED3DRS_CCW_STENCILPASS           = 188,
419     WINED3DRS_CCW_STENCILFUNC           = 189,
420     WINED3DRS_COLORWRITEENABLE1         = 190,
421     WINED3DRS_COLORWRITEENABLE2         = 191,
422     WINED3DRS_COLORWRITEENABLE3         = 192,
423     WINED3DRS_BLENDFACTOR               = 193,
424     WINED3DRS_SRGBWRITEENABLE           = 194,
425     WINED3DRS_DEPTHBIAS                 = 195,
426     WINED3DRS_WRAP8                     = 198,
427     WINED3DRS_WRAP9                     = 199,
428     WINED3DRS_WRAP10                    = 200,
429     WINED3DRS_WRAP11                    = 201,
430     WINED3DRS_WRAP12                    = 202,
431     WINED3DRS_WRAP13                    = 203,
432     WINED3DRS_WRAP14                    = 204,
433     WINED3DRS_WRAP15                    = 205,
434     WINED3DRS_SEPARATEALPHABLENDENABLE  = 206,
435     WINED3DRS_SRCBLENDALPHA             = 207,
436     WINED3DRS_DESTBLENDALPHA            = 208,
437     WINED3DRS_BLENDOPALPHA              = 209,
438
439     WINED3DRS_FORCE_DWORD               = 0x7fffffff
440 } WINED3DRENDERSTATETYPE;
441
442 #define WINEHIGHEST_RENDER_STATE   WINED3DRS_BLENDOPALPHA
443         /* Highest WINED3DRS_ value   */
444
445 typedef enum _WINED3DVERTEXBLENDFLAGS {
446     WINED3DVBF_DISABLE  =   0,
447     WINED3DVBF_1WEIGHTS =   1,
448     WINED3DVBF_2WEIGHTS =   2,
449     WINED3DVBF_3WEIGHTS =   3,
450     WINED3DVBF_TWEENING = 255,
451     WINED3DVBF_0WEIGHTS = 256
452 } WINED3DVERTEXBLENDFLAGS;
453
454 typedef struct _WINED3DDISPLAYMODE {
455     UINT            Width;
456     UINT            Height;
457     UINT            RefreshRate;
458     WINED3DFORMAT   Format;
459 } WINED3DDISPLAYMODE;
460
461 typedef enum _WINED3DBACKBUFFER_TYPE {
462     WINED3DBACKBUFFER_TYPE_MONO         = 0,
463     WINED3DBACKBUFFER_TYPE_LEFT         = 1,
464     WINED3DBACKBUFFER_TYPE_RIGHT        = 2,
465
466     WINED3DBACKBUFFER_TYPE_FORCE_DWORD  = 0x7fffffff
467 } WINED3DBACKBUFFER_TYPE;
468
469 typedef enum _WINED3DSWAPEFFECT {
470     WINED3DSWAPEFFECT_DISCARD         = 1,
471     WINED3DSWAPEFFECT_FLIP            = 2,
472     WINED3DSWAPEFFECT_COPY            = 3,
473     WINED3DSWAPEFFECT_COPY_VSYNC      = 4,
474     WINED3DSWAPEFFECT_FORCE_DWORD     = 0xFFFFFFFF
475 } WINED3DSWAPEFFECT;
476
477 typedef enum _WINED3DSAMPLERSTATETYPE {
478     WINED3DSAMP_ADDRESSU       = 1,
479     WINED3DSAMP_ADDRESSV       = 2,
480     WINED3DSAMP_ADDRESSW       = 3,
481     WINED3DSAMP_BORDERCOLOR    = 4,
482     WINED3DSAMP_MAGFILTER      = 5,
483     WINED3DSAMP_MINFILTER      = 6,
484     WINED3DSAMP_MIPFILTER      = 7,
485     WINED3DSAMP_MIPMAPLODBIAS  = 8,
486     WINED3DSAMP_MAXMIPLEVEL    = 9,
487     WINED3DSAMP_MAXANISOTROPY  = 10,
488     WINED3DSAMP_SRGBTEXTURE    = 11,
489     WINED3DSAMP_ELEMENTINDEX   = 12,
490     WINED3DSAMP_DMAPOFFSET     = 13,
491
492     WINED3DSAMP_FORCE_DWORD   = 0x7fffffff,
493 } WINED3DSAMPLERSTATETYPE;
494 #define WINED3D_HIGHEST_SAMPLER_STATE WINED3DSAMP_DMAPOFFSET
495
496 typedef enum _WINED3DMULTISAMPLE_TYPE {
497     WINED3DMULTISAMPLE_NONE          =  0,
498     WINED3DMULTISAMPLE_NONMASKABLE   =  1,
499     WINED3DMULTISAMPLE_2_SAMPLES     =  2,
500     WINED3DMULTISAMPLE_3_SAMPLES     =  3,
501     WINED3DMULTISAMPLE_4_SAMPLES     =  4,
502     WINED3DMULTISAMPLE_5_SAMPLES     =  5,
503     WINED3DMULTISAMPLE_6_SAMPLES     =  6,
504     WINED3DMULTISAMPLE_7_SAMPLES     =  7,
505     WINED3DMULTISAMPLE_8_SAMPLES     =  8,
506     WINED3DMULTISAMPLE_9_SAMPLES     =  9,
507     WINED3DMULTISAMPLE_10_SAMPLES    = 10,
508     WINED3DMULTISAMPLE_11_SAMPLES    = 11,
509     WINED3DMULTISAMPLE_12_SAMPLES    = 12,
510     WINED3DMULTISAMPLE_13_SAMPLES    = 13,
511     WINED3DMULTISAMPLE_14_SAMPLES    = 14,
512     WINED3DMULTISAMPLE_15_SAMPLES    = 15,
513     WINED3DMULTISAMPLE_16_SAMPLES    = 16,
514
515     WINED3DMULTISAMPLE_FORCE_DWORD   = 0xffffffff
516 } WINED3DMULTISAMPLE_TYPE;
517
518 typedef enum _WINED3DTEXTURESTAGESTATETYPE {
519     WINED3DTSS_COLOROP               =  1,
520     WINED3DTSS_COLORARG1             =  2,
521     WINED3DTSS_COLORARG2             =  3,
522     WINED3DTSS_ALPHAOP               =  4,
523     WINED3DTSS_ALPHAARG1             =  5,
524     WINED3DTSS_ALPHAARG2             =  6,
525     WINED3DTSS_BUMPENVMAT00          =  7,
526     WINED3DTSS_BUMPENVMAT01          =  8,
527     WINED3DTSS_BUMPENVMAT10          =  9,
528     WINED3DTSS_BUMPENVMAT11          = 10,
529     WINED3DTSS_TEXCOORDINDEX         = 11,
530     WINED3DTSS_ADDRESS               = 12,
531     WINED3DTSS_ADDRESSU              = 13,
532     WINED3DTSS_ADDRESSV              = 14,
533     WINED3DTSS_BORDERCOLOR           = 15,
534     WINED3DTSS_MAGFILTER             = 16,
535     WINED3DTSS_MINFILTER             = 17,
536     WINED3DTSS_MIPFILTER             = 18,
537     WINED3DTSS_MIPMAPLODBIAS         = 19,
538     WINED3DTSS_MAXMIPLEVEL           = 20,
539     WINED3DTSS_MAXANISOTROPY         = 21,
540     WINED3DTSS_BUMPENVLSCALE         = 22,
541     WINED3DTSS_BUMPENVLOFFSET        = 23,
542     WINED3DTSS_TEXTURETRANSFORMFLAGS = 24,
543     WINED3DTSS_ADDRESSW              = 25,
544     WINED3DTSS_COLORARG0             = 26,
545     WINED3DTSS_ALPHAARG0             = 27,
546     WINED3DTSS_RESULTARG             = 28,
547     WINED3DTSS_CONSTANT              = 32,
548
549     WINED3DTSS_FORCE_DWORD           = 0x7fffffff
550 } WINED3DTEXTURESTAGESTATETYPE;
551
552 #define WINED3D_HIGHEST_TEXTURE_STATE WINED3DTSS_CONSTANT
553
554 typedef enum _WINED3DTEXTURETRANSFORMFLAGS {
555     WINED3DTTFF_DISABLE         =   0,
556     WINED3DTTFF_COUNT1          =   1,
557     WINED3DTTFF_COUNT2          =   2,
558     WINED3DTTFF_COUNT3          =   3,
559     WINED3DTTFF_COUNT4          =   4,
560     WINED3DTTFF_PROJECTED       = 256,
561
562     WINED3DTTFF_FORCE_DWORD     = 0x7fffffff
563 } WINED3DTEXTURETRANSFORMFLAGS;
564
565 typedef enum _WINED3DTEXTUREOP {
566     WINED3DTOP_DISABLE                   =  1,
567     WINED3DTOP_SELECTARG1                =  2,
568     WINED3DTOP_SELECTARG2                =  3,
569     WINED3DTOP_MODULATE                  =  4,
570     WINED3DTOP_MODULATE2X                =  5,
571     WINED3DTOP_MODULATE4X                =  6,
572     WINED3DTOP_ADD                       =  7,
573     WINED3DTOP_ADDSIGNED                 =  8,
574     WINED3DTOP_ADDSIGNED2X               =  9,
575     WINED3DTOP_SUBTRACT                  = 10,
576     WINED3DTOP_ADDSMOOTH                 = 11,
577     WINED3DTOP_BLENDDIFFUSEALPHA         = 12,
578     WINED3DTOP_BLENDTEXTUREALPHA         = 13,
579     WINED3DTOP_BLENDFACTORALPHA          = 14,
580     WINED3DTOP_BLENDTEXTUREALPHAPM       = 15,
581     WINED3DTOP_BLENDCURRENTALPHA         = 16,
582     WINED3DTOP_PREMODULATE               = 17,
583     WINED3DTOP_MODULATEALPHA_ADDCOLOR    = 18,
584     WINED3DTOP_MODULATECOLOR_ADDALPHA    = 19,
585     WINED3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
586     WINED3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
587     WINED3DTOP_BUMPENVMAP                = 22,
588     WINED3DTOP_BUMPENVMAPLUMINANCE       = 23,
589     WINED3DTOP_DOTPRODUCT3               = 24,
590     WINED3DTOP_MULTIPLYADD               = 25,
591     WINED3DTOP_LERP                      = 26,
592
593     WINED3DTOP_FORCE_DWORD               = 0x7fffffff,
594 } WINED3DTEXTUREOP;
595
596 typedef enum _WINED3DTRANSFORMSTATETYPE {
597     WINED3DTS_VIEW            =  2,
598     WINED3DTS_PROJECTION      =  3,
599     WINED3DTS_TEXTURE0        = 16,
600     WINED3DTS_TEXTURE1        = 17,
601     WINED3DTS_TEXTURE2        = 18,
602     WINED3DTS_TEXTURE3        = 19,
603     WINED3DTS_TEXTURE4        = 20,
604     WINED3DTS_TEXTURE5        = 21,
605     WINED3DTS_TEXTURE6        = 22,
606     WINED3DTS_TEXTURE7        = 23,
607
608     WINED3DTS_FORCE_DWORD     = 0x7fffffff
609 } WINED3DTRANSFORMSTATETYPE;
610
611 #define WINED3DTS_WORLD  WINED3DTS_WORLDMATRIX(0)
612 #define WINED3DTS_WORLD1 WINED3DTS_WORLDMATRIX(1)
613 #define WINED3DTS_WORLD2 WINED3DTS_WORLDMATRIX(2)
614 #define WINED3DTS_WORLD3 WINED3DTS_WORLDMATRIX(3)
615 #define WINED3DTS_WORLDMATRIX(index) (WINED3DTRANSFORMSTATETYPE)(index + 256)
616
617 typedef enum _WINED3DBASISTYPE {
618    WINED3DBASIS_BEZIER        = 0,
619    WINED3DBASIS_BSPLINE       = 1,
620    WINED3DBASIS_INTERPOLATE   = 2,
621
622    WINED3DBASIS_FORCE_DWORD   = 0x7fffffff
623 } WINED3DBASISTYPE;
624
625 typedef enum _WINED3DCUBEMAP_FACES {
626     WINED3DCUBEMAP_FACE_POSITIVE_X     = 0,
627     WINED3DCUBEMAP_FACE_NEGATIVE_X     = 1,
628     WINED3DCUBEMAP_FACE_POSITIVE_Y     = 2,
629     WINED3DCUBEMAP_FACE_NEGATIVE_Y     = 3,
630     WINED3DCUBEMAP_FACE_POSITIVE_Z     = 4,
631     WINED3DCUBEMAP_FACE_NEGATIVE_Z     = 5,
632
633     WINED3DCUBEMAP_FACE_FORCE_DWORD    = 0xffffffff
634 } WINED3DCUBEMAP_FACES;
635
636 typedef enum _WINED3DTEXTUREFILTERTYPE {
637     WINED3DTEXF_NONE            = 0,
638     WINED3DTEXF_POINT           = 1,
639     WINED3DTEXF_LINEAR          = 2,
640     WINED3DTEXF_ANISOTROPIC     = 3,
641     WINED3DTEXF_FLATCUBIC       = 4,
642     WINED3DTEXF_GAUSSIANCUBIC   = 5,
643     WINED3DTEXF_PYRAMIDALQUAD   = 6,
644     WINED3DTEXF_GAUSSIANQUAD    = 7,
645     WINED3DTEXF_FORCE_DWORD     = 0x7fffffff
646 } WINED3DTEXTUREFILTERTYPE;
647
648 typedef struct _WINEDD3DRECTPATCH_INFO {
649     UINT                StartVertexOffsetWidth;
650     UINT                StartVertexOffsetHeight;
651     UINT                Width;
652     UINT                Height;
653     UINT                Stride;
654     WINED3DBASISTYPE    Basis;
655     WINED3DDEGREETYPE   Degree;
656 } WINED3DRECTPATCH_INFO;
657
658 typedef struct _WINED3DTRIPATCH_INFO {
659     UINT                StartVertexOffset;
660     UINT                NumVertices;
661     WINED3DBASISTYPE    Basis;
662     WINED3DDEGREETYPE   Degree;
663 } WINED3DTRIPATCH_INFO;
664
665
666 typedef struct _WINED3DADAPTER_IDENTIFIER {
667     char           *Driver;
668     char           *Description;
669     char           *DeviceName;
670     LARGE_INTEGER  *DriverVersion; 
671     DWORD          *VendorId;
672     DWORD          *DeviceId;
673     DWORD          *SubSysId;
674     DWORD          *Revision;
675     GUID           *DeviceIdentifier;
676     DWORD          *WHQLLevel;
677 } WINED3DADAPTER_IDENTIFIER;
678
679 typedef struct _WINED3DPRESENT_PARAMETERS {
680     UINT                    *BackBufferWidth;
681     UINT                    *BackBufferHeight;
682     WINED3DFORMAT           *BackBufferFormat;
683     UINT                    *BackBufferCount;
684     WINED3DMULTISAMPLE_TYPE *MultiSampleType;
685     DWORD                   *MultiSampleQuality;
686     WINED3DSWAPEFFECT       *SwapEffect;
687     HWND                    *hDeviceWindow;
688     BOOL                    *Windowed;
689     BOOL                    *EnableAutoDepthStencil;
690     WINED3DFORMAT           *AutoDepthStencilFormat;
691     DWORD                   *Flags;
692     UINT                    *FullScreen_RefreshRateInHz;
693     UINT                    *PresentationInterval;
694 } WINED3DPRESENT_PARAMETERS;
695
696 typedef enum _WINED3DRESOURCETYPE {
697     WINED3DRTYPE_SURFACE                =  1,
698     WINED3DRTYPE_VOLUME                 =  2,
699     WINED3DRTYPE_TEXTURE                =  3,
700     WINED3DRTYPE_VOLUMETEXTURE          =  4,
701     WINED3DRTYPE_CUBETEXTURE            =  5,
702     WINED3DRTYPE_VERTEXBUFFER           =  6,
703     WINED3DRTYPE_INDEXBUFFER            =  7,
704
705     WINED3DRTYPE_FORCE_DWORD            = 0x7fffffff
706 } WINED3DRESOURCETYPE;
707
708 #define WINED3DRTYPECOUNT (WINED3DRTYPE_INDEXBUFFER+1)
709
710 typedef enum _WINED3DPOOL {
711     WINED3DPOOL_DEFAULT                 = 0,
712     WINED3DPOOL_MANAGED                 = 1,
713     WINED3DPOOL_SYSTEMMEM               = 2,
714     WINED3DPOOL_SCRATCH                 = 3,
715
716     WINED3DPOOL_FORCE_DWORD             = 0x7fffffff
717 } WINED3DPOOL;
718
719 typedef struct _WINED3DSURFACE_DESC
720 {
721     WINED3DFORMAT           *Format;
722     WINED3DRESOURCETYPE     *Type;
723     DWORD                   *Usage;
724     WINED3DPOOL             *Pool;
725     UINT                    *Size;
726
727     WINED3DMULTISAMPLE_TYPE *MultiSampleType;
728     DWORD                   *MultiSampleQuality;
729     UINT                    *Width;
730     UINT                    *Height;
731 } WINED3DSURFACE_DESC;
732
733 typedef struct _WINED3DVOLUME_DESC
734 {
735     WINED3DFORMAT       *Format;
736     WINED3DRESOURCETYPE *Type;
737     DWORD               *Usage;
738     WINED3DPOOL         *Pool;
739     UINT                *Size;
740
741     UINT                *Width;
742     UINT                *Height;
743     UINT                *Depth;
744 } WINED3DVOLUME_DESC;
745
746 typedef struct _WINED3DCLIPSTATUS {
747    DWORD ClipUnion;
748    DWORD ClipIntersection;
749 } WINED3DCLIPSTATUS;
750
751
752 typedef struct _WINED3DVERTEXELEMENT {
753   WORD    Stream;
754   WORD    Offset;
755   BYTE    Type;
756   BYTE    Method;
757   BYTE    Usage;
758   BYTE    UsageIndex;
759   int     Reg; /* DirectX 8 */
760 } WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
761
762
763 typedef enum _WINED3DQUERYTYPE {
764     WINED3DQUERYTYPE_VCACHE             = 4,
765     WINED3DQUERYTYPE_RESOURCEMANAGER    = 5,
766     WINED3DQUERYTYPE_VERTEXSTATS        = 6,
767     WINED3DQUERYTYPE_EVENT              = 8,
768     WINED3DQUERYTYPE_OCCLUSION          = 9,
769     WINED3DQUERYTYPE_TIMESTAMP          = 10,
770     WINED3DQUERYTYPE_TIMESTAMPDISJOINT  = 11,
771     WINED3DQUERYTYPE_TIMESTAMPFREQ      = 12,
772     WINED3DQUERYTYPE_PIPELINETIMINGS    = 13,
773     WINED3DQUERYTYPE_INTERFACETIMINGS   = 14,
774     WINED3DQUERYTYPE_VERTEXTIMINGS      = 15,
775     WINED3DQUERYTYPE_PIXELTIMINGS       = 16,
776     WINED3DQUERYTYPE_BANDWIDTHTIMINGS   = 17,
777     WINED3DQUERYTYPE_CACHEUTILIZATION   = 18
778 } WINED3DQUERYTYPE;
779
780 #define WINED3DISSUE_BEGIN   (1 << 1)
781 #define WINED3DISSUE_END     (1 << 0)
782 #define WINED3DGETDATA_FLUSH (1 << 0)
783
784 typedef struct _WINED3DDEVICE_CREATION_PARAMETERS {
785     UINT           AdapterOrdinal;
786     WINED3DDEVTYPE DeviceType;
787     HWND           hFocusWindow;
788     DWORD          BehaviorFlags;
789 } WINED3DDEVICE_CREATION_PARAMETERS;
790
791 typedef struct _WINED3DDEVINFO_BANDWIDTHTIMINGS {
792     float         MaxBandwidthUtilized;
793     float         FrontEndUploadMemoryUtilizedPercent;
794     float         VertexRateUtilizedPercent;
795     float         TriangleSetupRateUtilizedPercent;
796     float         FillRateUtilizedPercent;
797 } WINED3DDEVINFO_BANDWIDTHTIMINGS;
798
799 typedef struct _WINED3DDEVINFO_CACHEUTILIZATION {
800     float         TextureCacheHitRate;
801     float         PostTransformVertexCacheHitRate;
802 } WINED3DDEVINFO_CACHEUTILIZATION;
803
804 typedef struct _WINED3DDEVINFO_INTERFACETIMINGS {
805     float         WaitingForGPUToUseApplicationResourceTimePercent;
806     float         WaitingForGPUToAcceptMoreCommandsTimePercent;
807     float         WaitingForGPUToStayWithinLatencyTimePercent;
808     float         WaitingForGPUExclusiveResourceTimePercent;
809     float         WaitingForGPUOtherTimePercent;
810 } WINED3DDEVINFO_INTERFACETIMINGS;
811
812 typedef struct _WINED3DDEVINFO_PIPELINETIMINGS {
813     float         VertexProcessingTimePercent;
814     float         PixelProcessingTimePercent;
815     float         OtherGPUProcessingTimePercent;
816     float         GPUIdleTimePercent;
817 } WINED3DDEVINFO_PIPELINETIMINGS;
818
819 typedef struct _WINED3DDEVINFO_STAGETIMINGS {
820     float         MemoryProcessingPercent;
821     float         ComputationProcessingPercent;
822 } WINED3DDEVINFO_STAGETIMINGS;
823
824 typedef struct _WINED3DRASTER_STATUS {
825     BOOL            InVBlank;
826     UINT            ScanLine;
827 } WINED3DRASTER_STATUS;
828
829
830 typedef struct WINED3DRESOURCESTATS {
831     BOOL                bThrashing;
832     DWORD               ApproxBytesDownloaded;
833     DWORD               NumEvicts;
834     DWORD               NumVidCreates;
835     DWORD               LastPri;
836     DWORD               NumUsed;
837     DWORD               NumUsedInVidMem;
838     DWORD               WorkingSet;
839     DWORD               WorkingSetBytes;
840     DWORD               TotalManaged;
841     DWORD               TotalBytes;
842 } WINED3DRESOURCESTATS;
843
844 typedef struct _WINED3DDEVINFO_RESOURCEMANAGER {
845     WINED3DRESOURCESTATS stats[WINED3DRTYPECOUNT];
846 } WINED3DDEVINFO_RESOURCEMANAGER;
847
848 typedef struct _WINED3DDEVINFO_VERTEXSTATS {
849     DWORD NumRenderedTriangles;
850     DWORD NumExtraClippingTriangles;
851 } WINED3DDEVINFO_VERTEXSTATS;
852
853 typedef struct _WINED3DLOCKED_RECT {
854     INT                 Pitch;
855     void*               pBits;
856 } WINED3DLOCKED_RECT;
857
858 typedef struct _WINED3DLOCKED_BOX {
859     INT                 RowPitch;
860     INT                 SlicePitch;
861     void*               pBits;
862 } WINED3DLOCKED_BOX;
863
864
865 typedef struct _WINED3DBOX {
866     UINT                Left;
867     UINT                Top;
868     UINT                Right;
869     UINT                Bottom;
870     UINT                Front;
871     UINT                Back;
872 } WINED3DBOX;
873
874 /*Vertex cache optimization hints.*/
875 typedef struct WINED3DDEVINFO_VCACHE {
876     /*Must be a 4 char code FOURCC (e.g. CACH)*/
877     DWORD         Pattern; 
878     /*0 to get the longest  strips, 1 vertex cache*/
879     DWORD         OptMethod; 
880      /*Cache size to use (only valid if OptMethod==1) */
881     DWORD         CacheSize;
882     /*internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1)*/
883     DWORD         MagicNumber; 
884 } WINED3DDEVINFO_VCACHE;
885
886 typedef struct _WINED3DVERTEXBUFFER_DESC {
887     WINED3DFORMAT           Format;
888     WINED3DRESOURCETYPE     Type;
889     DWORD                   Usage;
890     WINED3DPOOL             Pool;
891     UINT                    Size;
892     DWORD                   FVF;
893 } WINED3DVERTEXBUFFER_DESC;
894
895 typedef struct _WINED3DINDEXBUFFER_DESC {
896     WINED3DFORMAT           Format;
897     WINED3DRESOURCETYPE     Type;
898     DWORD                   Usage;
899     WINED3DPOOL             Pool;
900     UINT                    Size;
901 } WINED3DINDEXBUFFER_DESC;
902
903 /*
904  * The wined3dcaps structure
905  */
906
907 typedef struct _WINED3DVSHADERCAPS2_0 {
908   DWORD  *Caps;
909   INT    *DynamicFlowControlDepth;
910   INT    *NumTemps;
911   INT    *StaticFlowControlDepth;
912 } WINED3DVSHADERCAPS2_0;
913
914 typedef struct _WINED3DPSHADERCAPS2_0 {
915   DWORD  *Caps;
916   INT    *DynamicFlowControlDepth;
917   INT    *NumTemps;
918   INT    *StaticFlowControlDepth;
919   INT    *NumInstructionSlots;
920 } WINED3DPSHADERCAPS2_0;
921
922 typedef struct _WINED3DCAPS {
923   WINED3DDEVTYPE      *DeviceType;
924   UINT                *AdapterOrdinal;
925
926   DWORD               *Caps;
927   DWORD               *Caps2;
928   DWORD               *Caps3;
929   DWORD               *PresentationIntervals;
930
931   DWORD               *CursorCaps;
932
933   DWORD               *DevCaps;
934
935   DWORD               *PrimitiveMiscCaps;
936   DWORD               *RasterCaps;
937   DWORD               *ZCmpCaps;
938   DWORD               *SrcBlendCaps;
939   DWORD               *DestBlendCaps;
940   DWORD               *AlphaCmpCaps;
941   DWORD               *ShadeCaps;
942   DWORD               *TextureCaps;
943   DWORD               *TextureFilterCaps;
944   DWORD               *CubeTextureFilterCaps;
945   DWORD               *VolumeTextureFilterCaps;
946   DWORD               *TextureAddressCaps;
947   DWORD               *VolumeTextureAddressCaps;
948
949   DWORD               *LineCaps;
950
951   DWORD               *MaxTextureWidth;
952   DWORD               *MaxTextureHeight;
953   DWORD               *MaxVolumeExtent;
954
955   DWORD               *MaxTextureRepeat;
956   DWORD               *MaxTextureAspectRatio;
957   DWORD               *MaxAnisotropy;
958   float               *MaxVertexW;
959
960   float               *GuardBandLeft;
961   float               *GuardBandTop;
962   float               *GuardBandRight;
963   float               *GuardBandBottom;
964
965   float               *ExtentsAdjust;
966   DWORD               *StencilCaps;
967
968   DWORD               *FVFCaps;
969   DWORD               *TextureOpCaps;
970   DWORD               *MaxTextureBlendStages;
971   DWORD               *MaxSimultaneousTextures;
972
973   DWORD               *VertexProcessingCaps;
974   DWORD               *MaxActiveLights;
975   DWORD               *MaxUserClipPlanes;
976   DWORD               *MaxVertexBlendMatrices;
977   DWORD               *MaxVertexBlendMatrixIndex;
978
979   float               *MaxPointSize;
980
981   DWORD               *MaxPrimitiveCount;
982   DWORD               *MaxVertexIndex;
983   DWORD               *MaxStreams;
984   DWORD               *MaxStreamStride;
985
986   DWORD               *VertexShaderVersion;
987   DWORD               *MaxVertexShaderConst;
988
989   DWORD               *PixelShaderVersion;
990   float               *PixelShader1xMaxValue;
991
992   /* DX 9 */
993   DWORD               *DevCaps2;
994
995   float               *MaxNpatchTessellationLevel;
996   DWORD               *Reserved5; /*undocumented*/
997
998   UINT                *MasterAdapterOrdinal;
999   UINT                *AdapterOrdinalInGroup;
1000   UINT                *NumberOfAdaptersInGroup;
1001   DWORD               *DeclTypes;
1002   DWORD               *NumSimultaneousRTs;
1003   DWORD               *StretchRectFilterCaps;
1004   WINED3DVSHADERCAPS2_0   VS20Caps;
1005   WINED3DPSHADERCAPS2_0   PS20Caps;
1006   DWORD               *VertexTextureFilterCaps;
1007   DWORD               *MaxVShaderInstructionsExecuted;
1008   DWORD               *MaxPShaderInstructionsExecuted;
1009   DWORD               *MaxVertexShader30InstructionSlots; 
1010   DWORD               *MaxPixelShader30InstructionSlots;
1011   DWORD               *Reserved2;/* Not in the microsoft headers but documented */
1012   DWORD               *Reserved3;
1013
1014 } WINED3DCAPS;
1015
1016 typedef enum _WINED3DSTATEBLOCKTYPE {
1017     WINED3DSBT_INIT          = 0,
1018     WINED3DSBT_ALL           = 1,
1019     WINED3DSBT_PIXELSTATE    = 2,
1020     WINED3DSBT_VERTEXSTATE   = 3,
1021
1022     WINED3DSBT_FORCE_DWORD   = 0xffffffff
1023 } WINED3DSTATEBLOCKTYPE;
1024
1025 typedef struct glDescriptor {
1026     UINT          textureName;
1027     int           level;
1028     int           target;
1029     int/*GLenum*/ glFormat;
1030     int/*GLenum*/ glFormatInternal;
1031     int/*GLenum*/ glType;
1032 } glDescriptor;
1033
1034 #define WINED3DDP_MAXTEXCOORD 8
1035
1036 typedef enum _WINED3DDECLMETHOD {
1037     WINED3DDECLMETHOD_DEFAULT          = 0,
1038     WINED3DDECLMETHOD_PARTIALU         = 1,
1039     WINED3DDECLMETHOD_PARTIALV         = 2,
1040     WINED3DDECLMETHOD_CROSSUV          = 3,
1041     WINED3DDECLMETHOD_UV               = 4,
1042     WINED3DDECLMETHOD_LOOKUP           = 5,
1043     WINED3DDECLMETHOD_LOOKUPPRESAMPLED = 6
1044 } WINED3DDECLMETHOD;
1045
1046 typedef enum _WINED3DDECLTYPE {
1047   WINED3DDECLTYPE_FLOAT1    =  0,
1048   WINED3DDECLTYPE_FLOAT2    =  1,
1049   WINED3DDECLTYPE_FLOAT3    =  2,
1050   WINED3DDECLTYPE_FLOAT4    =  3,
1051   WINED3DDECLTYPE_D3DCOLOR  =  4,
1052   WINED3DDECLTYPE_UBYTE4    =  5,
1053   WINED3DDECLTYPE_SHORT2    =  6,
1054   WINED3DDECLTYPE_SHORT4    =  7,
1055   /* VS 2.0 */
1056   WINED3DDECLTYPE_UBYTE4N   =  8,
1057   WINED3DDECLTYPE_SHORT2N   =  9,
1058   WINED3DDECLTYPE_SHORT4N   = 10,
1059   WINED3DDECLTYPE_USHORT2N  = 11,
1060   WINED3DDECLTYPE_USHORT4N  = 12,
1061   WINED3DDECLTYPE_UDEC3     = 13,
1062   WINED3DDECLTYPE_DEC3N     = 14,
1063   WINED3DDECLTYPE_FLOAT16_2 = 15,
1064   WINED3DDECLTYPE_FLOAT16_4 = 16,
1065   WINED3DDECLTYPE_UNUSED    = 17,
1066 } WINED3DDECLTYPE;
1067
1068 typedef struct WineDirect3DStridedData {
1069     BYTE     *lpData;        /* Pointer to start of data               */
1070     DWORD     dwStride;      /* Stride between occurances of this data */
1071     DWORD     dwType;        /* Type (as in D3DVSDT_TYPE)              */
1072     int       VBO;           /* Vertex buffer object this data is in   */
1073 } WineDirect3DStridedData;
1074
1075 typedef struct WineDirect3DVertexStridedData {
1076     union {
1077         struct {
1078
1079              /* Do not add or reorder fields here,
1080               * so this can be indexed as an array */
1081              WineDirect3DStridedData  position;
1082              WineDirect3DStridedData  blendWeights;
1083              WineDirect3DStridedData  blendMatrixIndices;
1084              WineDirect3DStridedData  normal;
1085              WineDirect3DStridedData  pSize;
1086              WineDirect3DStridedData  diffuse;
1087              WineDirect3DStridedData  specular;
1088              WineDirect3DStridedData  texCoords[WINED3DDP_MAXTEXCOORD];
1089              WineDirect3DStridedData  position2; /* tween data */
1090              WineDirect3DStridedData  normal2;   /* tween data */
1091              WineDirect3DStridedData  tangent;
1092              WineDirect3DStridedData  binormal;
1093              WineDirect3DStridedData  tessFactor;
1094              WineDirect3DStridedData  fog;
1095              WineDirect3DStridedData  depth;
1096              WineDirect3DStridedData  sample;
1097
1098              /* Add fields here */
1099              BOOL position_transformed;
1100
1101         } s;
1102         WineDirect3DStridedData input[16];  /* Indexed by constants in D3DVSDE_REGISTER */
1103     } u;
1104 } WineDirect3DVertexStridedData;
1105
1106 typedef struct _WINEDDOVERLAYFX
1107 {
1108     DWORD       dwSize;                         /* size of structure */
1109     DWORD       dwAlphaEdgeBlendBitDepth;       /* Bit depth used to specify constant for alpha edge blend */
1110     DWORD       dwAlphaEdgeBlend;               /* Constant to use as alpha for edge blend */
1111     DWORD       dwReserved;
1112     DWORD       dwAlphaDestConstBitDepth;       /* Bit depth used to specify alpha constant for destination */
1113     union
1114     {
1115         DWORD   dwAlphaDestConst;               /* Constant to use as alpha channel for dest */
1116         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     /* Surface to use as alpha channel for dest */
1117     } DUMMYUNIONNAME1;
1118     DWORD       dwAlphaSrcConstBitDepth;        /* Bit depth used to specify alpha constant for source */
1119     union
1120     {
1121         DWORD   dwAlphaSrcConst;                /* Constant to use as alpha channel for src */
1122         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      /* Surface to use as alpha channel for src */
1123     } DUMMYUNIONNAME2;
1124     DDCOLORKEY  dckDestColorkey;                /* DestColorkey override */
1125     DDCOLORKEY  dckSrcColorkey;                 /* DestColorkey override */
1126     DWORD       dwDDFX;                         /* Overlay FX */
1127     DWORD       dwFlags;                        /* flags */
1128 } WINEDDOVERLAYFX;
1129
1130 /**************************** 
1131  *  * Vertex Shaders Declaration
1132  *   */
1133
1134 typedef enum _WINED3DDECLUSAGE {
1135       WINED3DSHADERDECLUSAGE_POSITION     = 0,
1136       WINED3DSHADERDECLUSAGE_BLENDWEIGHT,
1137       WINED3DSHADERDECLUSAGE_BLENDINDICES,
1138       WINED3DSHADERDECLUSAGE_NORMAL,
1139       WINED3DSHADERDECLUSAGE_PSIZE ,
1140       WINED3DSHADERDECLUSAGE_TEXCOORD0,
1141       WINED3DSHADERDECLUSAGE_TEXCOORD1,
1142       WINED3DSHADERDECLUSAGE_TEXCOORD2,
1143       WINED3DSHADERDECLUSAGE_TEXCOORD3,
1144       WINED3DSHADERDECLUSAGE_TEXCOORD4,
1145       WINED3DSHADERDECLUSAGE_TEXCOORD5,
1146       WINED3DSHADERDECLUSAGE_TEXCOORD6,
1147       WINED3DSHADERDECLUSAGE_TEXCOORD7,
1148       WINED3DSHADERDECLUSAGE_TANGENT,
1149       WINED3DSHADERDECLUSAGE_BINORMAL,
1150       WINED3DSHADERDECLUSAGE_TESSFACTOR,
1151       WINED3DSHADERDECLUSAGE_POSITIONT,
1152       WINED3DSHADERDECLUSAGE_DIFFUSE,
1153       WINED3DSHADERDECLUSAGE_SPECULAR,
1154       WINED3DSHADERDECLUSAGE_FOG,
1155       WINED3DSHADERDECLUSAGE_DEPTH,
1156       WINED3DSHADERDECLUSAGE_SAMPLE,
1157       WINED3DSHADERDECLUSAGE_POSITION2,
1158       WINED3DSHADERDECLUSAGE_POSITION21,
1159       WINED3DSHADERDECLUSAGE_POSITION22,
1160       WINED3DSHADERDECLUSAGE_POSITION23,
1161       WINED3DSHADERDECLUSAGE_POSITION24,
1162       WINED3DSHADERDECLUSAGE_POSITION25,
1163       WINED3DSHADERDECLUSAGE_POSITION26,
1164       WINED3DSHADERDECLUSAGE_POSITION27,
1165       WINED3DSHADERDECLUSAGE_POSITION28,
1166       WINED3DSHADERDECLUSAGE_NORMAL2,
1167       WINED3DSHADERDECLUSAGE_POSITIONT2,
1168       WINED3DSHADERDECLUSAGE_MAX_USAGE
1169 } WINED3DSHADERDECLUSAGE;
1170
1171 #define WINED3DUSAGE_RENDERTARGET                     0x00000001L
1172 #define WINED3DUSAGE_DEPTHSTENCIL                     0x00000002L
1173 #define WINED3DUSAGE_WRITEONLY                        0x00000008L
1174 #define WINED3DUSAGE_SOFTWAREPROCESSING               0x00000010L
1175 #define WINED3DUSAGE_DONOTCLIP                        0x00000020L
1176 #define WINED3DUSAGE_POINTS                           0x00000040L
1177 #define WINED3DUSAGE_RTPATCHES                        0x00000080L
1178 #define WINED3DUSAGE_NPATCHES                         0x00000100L
1179 #define WINED3DUSAGE_DYNAMIC                          0x00000200L
1180 #define WINED3DUSAGE_AUTOGENMIPMAP                    0x00000400L 
1181 #define WINED3DUSAGE_DMAP                             0x00004000L
1182 #define WINED3DUSAGE_MASK                             0x00004FFFL
1183 #define WINED3DUSAGE_OVERLAY                          0x00010000L
1184
1185 #define WINED3DUSAGE_QUERY_LEGACYBUMPMAP            0x00008000L
1186 #define WINED3DUSAGE_QUERY_FILTER                   0x00020000L
1187 #define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000L
1188 #define WINED3DUSAGE_QUERY_SRGBREAD                 0x00010000L
1189 #define WINED3DUSAGE_QUERY_SRGBWRITE                0x00040000L
1190 #define WINED3DUSAGE_QUERY_VERTEXTEXTURE            0x00100000L
1191 #define WINED3DUSAGE_QUERY_WRAPANDMIP               0x00200000L
1192 #define WINED3DUSAGE_QUERY_MASK                     0x002F8000L
1193
1194 typedef enum _WINED3DSURFTYPE {
1195     SURFACE_UNKNOWN    = 0,   /* Default / Unknown surface type */
1196     SURFACE_OPENGL,           /* OpenGL surface: Renders using libGL, needed for 3D */
1197     SURFACE_GDI,              /* User surface. No 3D, DirectDraw rendering with GDI */
1198     SURFACE_XRENDER           /* Future dreams: Use XRENDER / EXA / whatever stuff */
1199 } WINED3DSURFTYPE;
1200
1201 #define WINED3DCAPS2_NO2DDURING3DSCENE                 0x00000002L
1202 #define WINED3DCAPS2_FULLSCREENGAMMA                   0x00020000L
1203 #define WINED3DCAPS2_CANRENDERWINDOWED                 0x00080000L
1204 #define WINED3DCAPS2_CANCALIBRATEGAMMA                 0x00100000L
1205 #define WINED3DCAPS2_RESERVED                          0x02000000L
1206 #define WINED3DCAPS2_CANMANAGERESOURCE                 0x10000000L
1207 #define WINED3DCAPS2_DYNAMICTEXTURES                   0x20000000L
1208 #define WINED3DCAPS2_CANAUTOGENMIPMAP                  0x40000000L
1209
1210 #define WINED3DPRASTERCAPS_DITHER                     0x00000001L
1211 #define WINED3DPRASTERCAPS_ROP2                       0x00000002L
1212 #define WINED3DPRASTERCAPS_XOR                        0x00000004L
1213 #define WINED3DPRASTERCAPS_PAT                        0x00000008L
1214 #define WINED3DPRASTERCAPS_ZTEST                      0x00000010L
1215 #define WINED3DPRASTERCAPS_SUBPIXEL                   0x00000020L
1216 #define WINED3DPRASTERCAPS_SUBPIXELX                  0x00000040L
1217 #define WINED3DPRASTERCAPS_FOGVERTEX                  0x00000080L
1218 #define WINED3DPRASTERCAPS_FOGTABLE                   0x00000100L
1219 #define WINED3DPRASTERCAPS_STIPPLE                    0x00000200L
1220 #define WINED3DPRASTERCAPS_ANTIALIASSORTDEPENDENT     0x00000400L
1221 #define WINED3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT   0x00000800L
1222 #define WINED3DPRASTERCAPS_ANTIALIASEDGES             0x00001000L
1223 #define WINED3DPRASTERCAPS_MIPMAPLODBIAS              0x00002000L
1224 #define WINED3DPRASTERCAPS_ZBIAS                      0x00004000L
1225 #define WINED3DPRASTERCAPS_ZBUFFERLESSHSR             0x00008000L
1226 #define WINED3DPRASTERCAPS_FOGRANGE                   0x00010000L
1227 #define WINED3DPRASTERCAPS_ANISOTROPY                 0x00020000L
1228 #define WINED3DPRASTERCAPS_WBUFFER                    0x00040000L
1229 #define WINED3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
1230 #define WINED3DPRASTERCAPS_WFOG                       0x00100000L
1231 #define WINED3DPRASTERCAPS_ZFOG                       0x00200000L
1232 #define WINED3DPRASTERCAPS_COLORPERSPECTIVE           0x00400000L
1233 #define WINED3DPRASTERCAPS_SCISSORTEST                0x01000000L
1234 #define WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS        0x02000000L
1235 #define WINED3DPRASTERCAPS_DEPTHBIAS                  0x04000000L 
1236 #define WINED3DPRASTERCAPS_MULTISAMPLE_TOGGLE         0x08000000L
1237
1238 #define WINED3DPSHADECAPS_COLORFLATMONO               0x000001
1239 #define WINED3DPSHADECAPS_COLORFLATRGB                0x000002
1240 #define WINED3DPSHADECAPS_COLORGOURAUDMONO            0x000004
1241 #define WINED3DPSHADECAPS_COLORGOURAUDRGB             0x000008
1242 #define WINED3DPSHADECAPS_COLORPHONGMONO              0x000010
1243 #define WINED3DPSHADECAPS_COLORPHONGRGB               0x000020
1244 #define WINED3DPSHADECAPS_SPECULARFLATMONO            0x000040
1245 #define WINED3DPSHADECAPS_SPECULARFLATRGB             0x000080
1246 #define WINED3DPSHADECAPS_SPECULARGOURAUDMONO         0x000100
1247 #define WINED3DPSHADECAPS_SPECULARGOURAUDRGB          0x000200
1248 #define WINED3DPSHADECAPS_SPECULARPHONGMONO           0x000400
1249 #define WINED3DPSHADECAPS_SPECULARPHONGRGB            0x000800
1250 #define WINED3DPSHADECAPS_ALPHAFLATBLEND              0x001000
1251 #define WINED3DPSHADECAPS_ALPHAFLATSTIPPLED           0x002000
1252 #define WINED3DPSHADECAPS_ALPHAGOURAUDBLEND           0x004000
1253 #define WINED3DPSHADECAPS_ALPHAGOURAUDSTIPPLED        0x008000
1254 #define WINED3DPSHADECAPS_ALPHAPHONGBLEND             0x010000
1255 #define WINED3DPSHADECAPS_ALPHAPHONGSTIPPLED          0x020000
1256 #define WINED3DPSHADECAPS_FOGFLAT                     0x040000
1257 #define WINED3DPSHADECAPS_FOGGOURAUD                  0x080000
1258 #define WINED3DPSHADECAPS_FOGPHONG                    0x100000
1259
1260 #define WINED3DPTEXTURECAPS_PERSPECTIVE              0x00000001L
1261 #define WINED3DPTEXTURECAPS_POW2                     0x00000002L
1262 #define WINED3DPTEXTURECAPS_ALPHA                    0x00000004L
1263 #define WINED3DPTEXTURECAPS_TRANSPARENCY             0x00000008L
1264 #define WINED3DPTEXTURECAPS_BORDER                   0x00000010L
1265 #define WINED3DPTEXTURECAPS_SQUAREONLY               0x00000020L
1266 #define WINED3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
1267 #define WINED3DPTEXTURECAPS_ALPHAPALETTE             0x00000080L
1268 #define WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL       0x00000100L
1269 #define WINED3DPTEXTURECAPS_PROJECTED                0x00000400L
1270 #define WINED3DPTEXTURECAPS_CUBEMAP                  0x00000800L
1271 #define WINED3DPTEXTURECAPS_COLORKEYBLEND            0x00001000L
1272 #define WINED3DPTEXTURECAPS_VOLUMEMAP                0x00002000L
1273 #define WINED3DPTEXTURECAPS_MIPMAP                   0x00004000L
1274 #define WINED3DPTEXTURECAPS_MIPVOLUMEMAP             0x00008000L
1275 #define WINED3DPTEXTURECAPS_MIPCUBEMAP               0x00010000L
1276 #define WINED3DPTEXTURECAPS_CUBEMAP_POW2             0x00020000L
1277 #define WINED3DPTEXTURECAPS_VOLUMEMAP_POW2           0x00040000L
1278 #define WINED3DPTEXTURECAPS_NOPROJECTEDBUMPENV       0x00200000L
1279
1280 #define WINED3DPTFILTERCAPS_NEAREST                  0x00000001
1281 #define WINED3DPTFILTERCAPS_LINEAR                   0x00000002
1282 #define WINED3DPTFILTERCAPS_MIPNEAREST               0x00000004
1283 #define WINED3DPTFILTERCAPS_MIPLINEAR                0x00000008
1284 #define WINED3DPTFILTERCAPS_LINEARMIPNEAREST         0x00000010
1285 #define WINED3DPTFILTERCAPS_LINEARMIPLINEAR          0x00000020
1286 #define WINED3DPTFILTERCAPS_MINFPOINT                0x00000100
1287 #define WINED3DPTFILTERCAPS_MINFLINEAR               0x00000200
1288 #define WINED3DPTFILTERCAPS_MINFANISOTROPIC          0x00000400
1289 #define WINED3DPTFILTERCAPS_MIPFPOINT                0x00010000
1290 #define WINED3DPTFILTERCAPS_MIPFLINEAR               0x00020000
1291 #define WINED3DPTFILTERCAPS_MAGFPOINT                0x01000000
1292 #define WINED3DPTFILTERCAPS_MAGFLINEAR               0x02000000
1293 #define WINED3DPTFILTERCAPS_MAGFANISOTROPIC          0x04000000
1294 #define WINED3DPTFILTERCAPS_MAGFPYRAMIDALQUAD        0x08000000
1295 #define WINED3DPTFILTERCAPS_MAGFGAUSSIANQUAD         0x10000000
1296
1297 #define WINED3DVTXPCAPS_TEXGEN                       0x00000001L
1298 #define WINED3DVTXPCAPS_MATERIALSOURCE7              0x00000002L
1299 #define WINED3DVTXPCAPS_VERTEXFOG                    0x00000004L
1300 #define WINED3DVTXPCAPS_DIRECTIONALLIGHTS            0x00000008L
1301 #define WINED3DVTXPCAPS_POSITIONALLIGHTS             0x00000010L
1302 #define WINED3DVTXPCAPS_LOCALVIEWER                  0x00000020L
1303 #define WINED3DVTXPCAPS_TWEENING                     0x00000040L
1304 #define WINED3DVTXPCAPS_TEXGEN_SPHEREMAP             0x00000100L
1305 #define WINED3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER     0x00000200L
1306
1307 #define WINED3DDEVCAPS_FLOATTLVERTEX                 0x000000001
1308 #define WINED3DDEVCAPS_SORTINCREASINGZ               0x000000002
1309 #define WINED3DDEVCAPS_SORTDECREASINGZ               0X000000004
1310 #define WINED3DDEVCAPS_SORTEXACT                     0x000000008
1311 #define WINED3DDEVCAPS_EXECUTESYSTEMMEMORY           0x000000010
1312 #define WINED3DDEVCAPS_EXECUTEVIDEOMEMORY            0x000000020
1313 #define WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY          0x000000040
1314 #define WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY           0x000000080
1315 #define WINED3DDEVCAPS_TEXTURESYSTEMMEMORY           0x000000100
1316 #define WINED3DDEVCAPS_TEXTUREVIDEOMEMORY            0x000000200
1317 #define WINED3DDEVCAPS_DRAWPRIMTLVERTEX              0x000000400
1318 #define WINED3DDEVCAPS_CANRENDERAFTERFLIP            0x000000800
1319 #define WINED3DDEVCAPS_TEXTURENONLOCALVIDMEM         0x000001000
1320 #define WINED3DDEVCAPS_DRAWPRIMITIVES2               0x000002000
1321 #define WINED3DDEVCAPS_SEPARATETEXTUREMEMORIES       0x000004000
1322 #define WINED3DDEVCAPS_DRAWPRIMITIVES2EX             0x000008000
1323 #define WINED3DDEVCAPS_HWTRANSFORMANDLIGHT           0x000010000
1324 #define WINED3DDEVCAPS_CANBLTSYSTONONLOCAL           0x000020000
1325 #define WINED3DDEVCAPS_HWRASTERIZATION               0x000080000
1326 #define WINED3DDEVCAPS_PUREDEVICE                    0x000100000
1327 #define WINED3DDEVCAPS_QUINTICRTPATCHES              0x000200000
1328 #define WINED3DDEVCAPS_RTPATCHES                     0x000400000
1329 #define WINED3DDEVCAPS_RTPATCHHANDLEZERO             0x000800000
1330 #define WINED3DDEVCAPS_NPATCHES                      0x001000000
1331
1332 #define WINED3DLOCK_READONLY           0x0010
1333 #define WINED3DLOCK_NOSYSLOCK          0x0800
1334 #define WINED3DLOCK_NOOVERWRITE        0x1000
1335 #define WINED3DLOCK_DISCARD            0x2000
1336 #define WINED3DLOCK_DONOTWAIT          0x4000
1337 #define WINED3DLOCK_NO_DIRTY_UPDATE    0x8000
1338
1339 #define WINED3DPRESENT_RATE_DEFAULT                  0x000000000
1340
1341 #define WINED3DPRESENT_INTERVAL_DEFAULT              0x00000000
1342 #define WINED3DPRESENT_INTERVAL_ONE                  0x00000001
1343 #define WINED3DPRESENT_INTERVAL_TWO                  0x00000002
1344 #define WINED3DPRESENT_INTERVAL_THREE                0x00000004
1345 #define WINED3DPRESENT_INTERVAL_FOUR                 0x00000008
1346 #define WINED3DPRESENT_INTERVAL_IMMEDIATE            0x80000000
1347
1348 #define WINED3DMAXUSERCLIPPLANES       32
1349 #define WINED3DCLIPPLANE0              (1 << 0)
1350 #define WINED3DCLIPPLANE1              (1 << 1)
1351 #define WINED3DCLIPPLANE2              (1 << 2)
1352 #define WINED3DCLIPPLANE3              (1 << 3)
1353 #define WINED3DCLIPPLANE4              (1 << 4)
1354 #define WINED3DCLIPPLANE5              (1 << 5)
1355
1356 #endif