server: Generate padding in request structures from make_requests.
[wine] / include / wine / wined3d.idl
1 /*
2  * Copyright 2002-2003 The wine-d3d team
3  * Copyright 2002-2003 Jason Edmeades
4  * Copyright 2002-2003 Raphael Junqueira
5  * Copyright 2005 Oliver Stieber
6  * Copyright 2006 Stefan Dösinger
7  * Copyright 2006 Stefan Dösinger for CodeWeavers
8  * Copyright 2007 Henri Verbeet
9  * Copyright 2008 Henri Verbeet for CodeWeavers
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25
26 import "unknwn.idl";
27
28 cpp_quote("#if 0")
29 typedef HANDLE HMONITOR;
30
31 typedef struct _RGNDATAHEADER
32 {
33     DWORD dwSize;
34     DWORD iType;
35     DWORD nCount;
36     DWORD nRgnSize;
37     RECT rcBound;
38 } RGNDATAHEADER;
39
40 typedef struct _RGNDATA
41 {
42     RGNDATAHEADER rdh;
43     char Buffer[1];
44 } RGNDATA;
45 cpp_quote("#endif")
46
47 cpp_quote("#define WINED3D_OK                                  S_OK")
48
49 const UINT _FACWINED3D = 0x876;
50 cpp_quote("#define MAKE_WINED3DSTATUS(code)                    MAKE_HRESULT(0, _FACWINED3D, code)")
51 cpp_quote("#define WINED3DOK_NOAUTOGEN                         MAKE_WINED3DSTATUS(2159)")
52
53 cpp_quote("#define MAKE_WINED3DHRESULT(code)                   MAKE_HRESULT(1, _FACWINED3D, code)")
54 cpp_quote("#define WINED3DERR_WRONGTEXTUREFORMAT               MAKE_WINED3DHRESULT(2072)")
55 cpp_quote("#define WINED3DERR_UNSUPPORTEDCOLOROPERATION        MAKE_WINED3DHRESULT(2073)")
56 cpp_quote("#define WINED3DERR_UNSUPPORTEDCOLORARG              MAKE_WINED3DHRESULT(2074)")
57 cpp_quote("#define WINED3DERR_UNSUPPORTEDALPHAOPERATION        MAKE_WINED3DHRESULT(2075)")
58 cpp_quote("#define WINED3DERR_UNSUPPORTEDALPHAARG              MAKE_WINED3DHRESULT(2076)")
59 cpp_quote("#define WINED3DERR_TOOMANYOPERATIONS                MAKE_WINED3DHRESULT(2077)")
60 cpp_quote("#define WINED3DERR_CONFLICTINGTEXTUREFILTER         MAKE_WINED3DHRESULT(2078)")
61 cpp_quote("#define WINED3DERR_UNSUPPORTEDFACTORVALUE           MAKE_WINED3DHRESULT(2079)")
62 cpp_quote("#define WINED3DERR_CONFLICTINGRENDERSTATE           MAKE_WINED3DHRESULT(2081)")
63 cpp_quote("#define WINED3DERR_UNSUPPORTEDTEXTUREFILTER         MAKE_WINED3DHRESULT(2082)")
64 cpp_quote("#define WINED3DERR_CONFLICTINGTEXTUREPALETTE        MAKE_WINED3DHRESULT(2086)")
65 cpp_quote("#define WINED3DERR_DRIVERINTERNALERROR              MAKE_WINED3DHRESULT(2087)")
66 cpp_quote("#define WINED3DERR_NOTFOUND                         MAKE_WINED3DHRESULT(2150)")
67 cpp_quote("#define WINED3DERR_MOREDATA                         MAKE_WINED3DHRESULT(2151)")
68 cpp_quote("#define WINED3DERR_DEVICELOST                       MAKE_WINED3DHRESULT(2152)")
69 cpp_quote("#define WINED3DERR_DEVICENOTRESET                   MAKE_WINED3DHRESULT(2153)")
70 cpp_quote("#define WINED3DERR_NOTAVAILABLE                     MAKE_WINED3DHRESULT(2154)")
71 cpp_quote("#define WINED3DERR_OUTOFVIDEOMEMORY                 MAKE_WINED3DHRESULT(380)")
72 cpp_quote("#define WINED3DERR_INVALIDDEVICE                    MAKE_WINED3DHRESULT(2155)")
73 cpp_quote("#define WINED3DERR_INVALIDCALL                      MAKE_WINED3DHRESULT(2156)")
74 cpp_quote("#define WINED3DERR_DRIVERINVALIDCALL                MAKE_WINED3DHRESULT(2157)")
75 cpp_quote("#define WINED3DERR_WASSTILLDRAWING                  MAKE_WINED3DHRESULT(540)")
76 cpp_quote("#define WINEDDERR_NOTAOVERLAYSURFACE                MAKE_WINED3DHRESULT(580)")
77 cpp_quote("#define WINEDDERR_NOTLOCKED                         MAKE_WINED3DHRESULT(584)")
78 cpp_quote("#define WINEDDERR_NODC                              MAKE_WINED3DHRESULT(586)")
79 cpp_quote("#define WINEDDERR_DCALREADYCREATED                  MAKE_WINED3DHRESULT(620)")
80 cpp_quote("#define WINEDDERR_NOTFLIPPABLE                      MAKE_WINED3DHRESULT(582)")
81 cpp_quote("#define WINEDDERR_SURFACEBUSY                       MAKE_WINED3DHRESULT(430)")
82 cpp_quote("#define WINEDDERR_INVALIDRECT                       MAKE_WINED3DHRESULT(150)")
83 cpp_quote("#define WINEDDERR_NOCLIPLIST                        MAKE_WINED3DHRESULT(205)")
84 cpp_quote("#define WINEDDERR_OVERLAYNOTVISIBLE                 MAKE_WINED3DHRESULT(577)")
85
86 typedef DWORD WINED3DCOLOR;
87
88 typedef enum _WINED3DLIGHTTYPE
89 {
90     WINED3DLIGHT_POINT                      = 1,
91     WINED3DLIGHT_SPOT                       = 2,
92     WINED3DLIGHT_DIRECTIONAL                = 3,
93     WINED3DLIGHT_PARALLELPOINT              = 4, /* D3D7 */
94     WINED3DLIGHT_GLSPOT                     = 5, /* D3D7 */
95     WINED3DLIGHT_FORCE_DWORD                = 0x7fffffff
96 } WINED3DLIGHTTYPE;
97
98 typedef enum _WINED3DPRIMITIVETYPE
99 {
100     WINED3DPT_POINTLIST                     = 1,
101     WINED3DPT_LINELIST                      = 2,
102     WINED3DPT_LINESTRIP                     = 3,
103     WINED3DPT_TRIANGLELIST                  = 4,
104     WINED3DPT_TRIANGLESTRIP                 = 5,
105     WINED3DPT_TRIANGLEFAN                   = 6,
106     WINED3DPT_FORCE_DWORD                   = 0x7fffffff
107 } WINED3DPRIMITIVETYPE;
108
109 typedef enum _WINED3DDEVTYPE
110 {
111     WINED3DDEVTYPE_HAL                      = 1,
112     WINED3DDEVTYPE_REF                      = 2,
113     WINED3DDEVTYPE_SW                       = 3,
114     WINED3DDEVTYPE_NULLREF                  = 4,
115     WINED3DDEVTYPE_FORCE_DWORD              = 0xffffffff
116 } WINED3DDEVTYPE;
117
118 typedef enum _WINED3DDEGREETYPE
119 {
120     WINED3DDEGREE_LINEAR                    = 1,
121     WINED3DDEGREE_QUADRATIC                 = 2,
122     WINED3DDEGREE_CUBIC                     = 3,
123     WINED3DDEGREE_QUINTIC                   = 5,
124     WINED3DDEGREE_FORCE_DWORD               = 0x7fffffff
125 } WINED3DDEGREETYPE;
126
127 typedef enum _WINED3DFORMAT
128 {
129     WINED3DFMT_UNKNOWN                      = 0,
130     WINED3DFMT_R8G8B8                       = 20,
131     WINED3DFMT_A8R8G8B8                     = 21,
132     WINED3DFMT_X8R8G8B8                     = 22,
133     WINED3DFMT_R5G6B5                       = 23,
134     WINED3DFMT_X1R5G5B5                     = 24,
135     WINED3DFMT_A1R5G5B5                     = 25,
136     WINED3DFMT_A4R4G4B4                     = 26,
137     WINED3DFMT_R3G3B2                       = 27,
138     WINED3DFMT_A8                           = 28,
139     WINED3DFMT_A8R3G3B2                     = 29,
140     WINED3DFMT_X4R4G4B4                     = 30,
141     WINED3DFMT_A2B10G10R10                  = 31,
142     WINED3DFMT_A8B8G8R8                     = 32,
143     WINED3DFMT_X8B8G8R8                     = 33,
144     WINED3DFMT_G16R16                       = 34,
145     WINED3DFMT_A2R10G10B10                  = 35,
146     WINED3DFMT_A16B16G16R16                 = 36,
147     WINED3DFMT_A8P8                         = 40,
148     WINED3DFMT_P8                           = 41,
149     WINED3DFMT_L8                           = 50,
150     WINED3DFMT_A8L8                         = 51,
151     WINED3DFMT_A4L4                         = 52,
152     WINED3DFMT_V8U8                         = 60,
153     WINED3DFMT_L6V5U5                       = 61,
154     WINED3DFMT_X8L8V8U8                     = 62,
155     WINED3DFMT_Q8W8V8U8                     = 63,
156     WINED3DFMT_V16U16                       = 64,
157     WINED3DFMT_W11V11U10                    = 65,
158     WINED3DFMT_A2W10V10U10                  = 67,
159     WINED3DFMT_D16_LOCKABLE                 = 70,
160     WINED3DFMT_D32                          = 71,
161     WINED3DFMT_D15S1                        = 73,
162     WINED3DFMT_D24S8                        = 75,
163     WINED3DFMT_D24X8                        = 77,
164     WINED3DFMT_D24X4S4                      = 79,
165     WINED3DFMT_D16                          = 80,
166     WINED3DFMT_L16                          = 81,
167     WINED3DFMT_D32F_LOCKABLE                = 82,
168     WINED3DFMT_D24FS8                       = 83,
169     WINED3DFMT_VERTEXDATA                   = 100,
170     WINED3DFMT_INDEX16                      = 101,
171     WINED3DFMT_INDEX32                      = 102,
172     WINED3DFMT_Q16W16V16U16                 = 110,
173     WINED3DFMT_R16F                         = 111,
174     WINED3DFMT_G16R16F                      = 112,
175     WINED3DFMT_A16B16G16R16F                = 113,
176     WINED3DFMT_R32F                         = 114,
177     WINED3DFMT_G32R32F                      = 115,
178     WINED3DFMT_A32B32G32R32F                = 116,
179     WINED3DFMT_CxV8U8                       = 117,
180     WINED3DFMT_FORCE_DWORD                  = 0xffffffff
181 } WINED3DFORMAT;
182 cpp_quote("#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3) \\")
183 cpp_quote("        ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \\")
184 cpp_quote("        ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))")
185 cpp_quote("#define WINED3DFMT_UYVY         WINEMAKEFOURCC('U', 'Y', 'V', 'Y')")
186 cpp_quote("#define WINED3DFMT_YUY2         WINEMAKEFOURCC('Y', 'U', 'Y', '2')")
187 cpp_quote("#define WINED3DFMT_YV12         WINEMAKEFOURCC('Y', 'V', '1', '2')")
188 cpp_quote("#define WINED3DFMT_DXT1         WINEMAKEFOURCC('D', 'X', 'T', '1')")
189 cpp_quote("#define WINED3DFMT_DXT2         WINEMAKEFOURCC('D', 'X', 'T', '2')")
190 cpp_quote("#define WINED3DFMT_DXT3         WINEMAKEFOURCC('D', 'X', 'T', '3')")
191 cpp_quote("#define WINED3DFMT_DXT4         WINEMAKEFOURCC('D', 'X', 'T', '4')")
192 cpp_quote("#define WINED3DFMT_DXT5         WINEMAKEFOURCC('D', 'X', 'T', '5')")
193 cpp_quote("#define WINED3DFMT_MULTI2_ARGB8 WINEMAKEFOURCC('M', 'E', 'T', '1')")
194 cpp_quote("#define WINED3DFMT_G8R8_G8B8    WINEMAKEFOURCC('G', 'R', 'G', 'B')")
195 cpp_quote("#define WINED3DFMT_R8G8_B8G8    WINEMAKEFOURCC('R', 'G', 'B', 'G')")
196 /* Vendor specific formats */
197 cpp_quote("#define WINED3DFMT_ATI2N        WINEMAKEFOURCC('A', 'T', 'I', '2')")
198 cpp_quote("#define WINED3DFMT_NVHU         WINEMAKEFOURCC('N', 'V', 'H', 'U')")
199 cpp_quote("#define WINED3DFMT_NVHS         WINEMAKEFOURCC('N', 'V', 'H', 'S')")
200
201 typedef enum _WINED3DRENDERSTATETYPE
202 {
203     WINED3DRS_TEXTUREHANDLE                 = 1, /* d3d7 */
204     WINED3DRS_ANTIALIAS                     = 2, /* d3d7 */
205     WINED3DRS_TEXTUREADDRESS                = 3, /* d3d7 */
206     WINED3DRS_TEXTUREPERSPECTIVE            = 4, /* d3d7 */
207     WINED3DRS_WRAPU                         = 5, /* d3d7 */
208     WINED3DRS_WRAPV                         = 6, /* d3d7 */
209     WINED3DRS_ZENABLE                       = 7,
210     WINED3DRS_FILLMODE                      = 8,
211     WINED3DRS_SHADEMODE                     = 9,
212     WINED3DRS_LINEPATTERN                   = 10, /* d3d7, d3d8 */
213     WINED3DRS_MONOENABLE                    = 11, /* d3d7 */
214     WINED3DRS_ROP2                          = 12, /* d3d7 */
215     WINED3DRS_PLANEMASK                     = 13, /* d3d7 */
216     WINED3DRS_ZWRITEENABLE                  = 14,
217     WINED3DRS_ALPHATESTENABLE               = 15,
218     WINED3DRS_LASTPIXEL                     = 16,
219     WINED3DRS_TEXTUREMAG                    = 17, /* d3d7 */
220     WINED3DRS_TEXTUREMIN                    = 18, /* d3d7 */
221     WINED3DRS_SRCBLEND                      = 19,
222     WINED3DRS_DESTBLEND                     = 20,
223     WINED3DRS_TEXTUREMAPBLEND               = 21, /* d3d7 */
224     WINED3DRS_CULLMODE                      = 22,
225     WINED3DRS_ZFUNC                         = 23,
226     WINED3DRS_ALPHAREF                      = 24,
227     WINED3DRS_ALPHAFUNC                     = 25,
228     WINED3DRS_DITHERENABLE                  = 26,
229     WINED3DRS_ALPHABLENDENABLE              = 27,
230     WINED3DRS_FOGENABLE                     = 28,
231     WINED3DRS_SPECULARENABLE                = 29,
232     WINED3DRS_ZVISIBLE                      = 30, /* d3d7, d3d8 */
233     WINED3DRS_SUBPIXEL                      = 31, /* d3d7 */
234     WINED3DRS_SUBPIXELX                     = 32, /* d3d7 */
235     WINED3DRS_STIPPLEDALPHA                 = 33, /* d3d7 */
236     WINED3DRS_FOGCOLOR                      = 34,
237     WINED3DRS_FOGTABLEMODE                  = 35,
238     WINED3DRS_FOGSTART                      = 36,
239     WINED3DRS_FOGEND                        = 37,
240     WINED3DRS_FOGDENSITY                    = 38,
241     WINED3DRS_STIPPLEENABLE                 = 39, /* d3d7 */
242     WINED3DRS_EDGEANTIALIAS                 = 40, /* d3d7, d3d8 */
243     WINED3DRS_COLORKEYENABLE                = 41, /* d3d7 */
244     WINED3DRS_BORDERCOLOR                   = 43, /* d3d7 */
245     WINED3DRS_TEXTUREADDRESSU               = 44, /* d3d7 */
246     WINED3DRS_TEXTUREADDRESSV               = 45, /* d3d7 */
247     WINED3DRS_MIPMAPLODBIAS                 = 46, /* d3d7 */
248     WINED3DRS_ZBIAS                         = 47, /* d3d7, d3d8 */
249     WINED3DRS_RANGEFOGENABLE                = 48,
250     WINED3DRS_ANISOTROPY                    = 49, /* d3d7 */
251     WINED3DRS_FLUSHBATCH                    = 50, /* d3d7 */
252     WINED3DRS_TRANSLUCENTSORTINDEPENDENT    = 51, /* d3d7 */
253     WINED3DRS_STENCILENABLE                 = 52,
254     WINED3DRS_STENCILFAIL                   = 53,
255     WINED3DRS_STENCILZFAIL                  = 54,
256     WINED3DRS_STENCILPASS                   = 55,
257     WINED3DRS_STENCILFUNC                   = 56,
258     WINED3DRS_STENCILREF                    = 57,
259     WINED3DRS_STENCILMASK                   = 58,
260     WINED3DRS_STENCILWRITEMASK              = 59,
261     WINED3DRS_TEXTUREFACTOR                 = 60,
262     WINED3DRS_STIPPLEPATTERN00              = 64,
263     WINED3DRS_STIPPLEPATTERN01              = 65,
264     WINED3DRS_STIPPLEPATTERN02              = 66,
265     WINED3DRS_STIPPLEPATTERN03              = 67,
266     WINED3DRS_STIPPLEPATTERN04              = 68,
267     WINED3DRS_STIPPLEPATTERN05              = 69,
268     WINED3DRS_STIPPLEPATTERN06              = 70,
269     WINED3DRS_STIPPLEPATTERN07              = 71,
270     WINED3DRS_STIPPLEPATTERN08              = 72,
271     WINED3DRS_STIPPLEPATTERN09              = 73,
272     WINED3DRS_STIPPLEPATTERN10              = 74,
273     WINED3DRS_STIPPLEPATTERN11              = 75,
274     WINED3DRS_STIPPLEPATTERN12              = 76,
275     WINED3DRS_STIPPLEPATTERN13              = 77,
276     WINED3DRS_STIPPLEPATTERN14              = 78,
277     WINED3DRS_STIPPLEPATTERN15              = 79,
278     WINED3DRS_STIPPLEPATTERN16              = 80,
279     WINED3DRS_STIPPLEPATTERN17              = 81,
280     WINED3DRS_STIPPLEPATTERN18              = 82,
281     WINED3DRS_STIPPLEPATTERN19              = 83,
282     WINED3DRS_STIPPLEPATTERN20              = 84,
283     WINED3DRS_STIPPLEPATTERN21              = 85,
284     WINED3DRS_STIPPLEPATTERN22              = 86,
285     WINED3DRS_STIPPLEPATTERN23              = 87,
286     WINED3DRS_STIPPLEPATTERN24              = 88,
287     WINED3DRS_STIPPLEPATTERN25              = 89,
288     WINED3DRS_STIPPLEPATTERN26              = 90,
289     WINED3DRS_STIPPLEPATTERN27              = 91,
290     WINED3DRS_STIPPLEPATTERN28              = 92,
291     WINED3DRS_STIPPLEPATTERN29              = 93,
292     WINED3DRS_STIPPLEPATTERN30              = 94,
293     WINED3DRS_STIPPLEPATTERN31              = 95,
294     WINED3DRS_WRAP0                         = 128,
295     WINED3DRS_WRAP1                         = 129,
296     WINED3DRS_WRAP2                         = 130,
297     WINED3DRS_WRAP3                         = 131,
298     WINED3DRS_WRAP4                         = 132,
299     WINED3DRS_WRAP5                         = 133,
300     WINED3DRS_WRAP6                         = 134,
301     WINED3DRS_WRAP7                         = 135,
302     WINED3DRS_CLIPPING                      = 136,
303     WINED3DRS_LIGHTING                      = 137,
304     WINED3DRS_EXTENTS                       = 138, /* d3d7 */
305     WINED3DRS_AMBIENT                       = 139,
306     WINED3DRS_FOGVERTEXMODE                 = 140,
307     WINED3DRS_COLORVERTEX                   = 141,
308     WINED3DRS_LOCALVIEWER                   = 142,
309     WINED3DRS_NORMALIZENORMALS              = 143,
310     WINED3DRS_COLORKEYBLENDENABLE           = 144, /* d3d7 */
311     WINED3DRS_DIFFUSEMATERIALSOURCE         = 145,
312     WINED3DRS_SPECULARMATERIALSOURCE        = 146,
313     WINED3DRS_AMBIENTMATERIALSOURCE         = 147,
314     WINED3DRS_EMISSIVEMATERIALSOURCE        = 148,
315     WINED3DRS_VERTEXBLEND                   = 151,
316     WINED3DRS_CLIPPLANEENABLE               = 152,
317     WINED3DRS_SOFTWAREVERTEXPROCESSING      = 153, /* d3d8 */
318     WINED3DRS_POINTSIZE                     = 154,
319     WINED3DRS_POINTSIZE_MIN                 = 155,
320     WINED3DRS_POINTSPRITEENABLE             = 156,
321     WINED3DRS_POINTSCALEENABLE              = 157,
322     WINED3DRS_POINTSCALE_A                  = 158,
323     WINED3DRS_POINTSCALE_B                  = 159,
324     WINED3DRS_POINTSCALE_C                  = 160,
325     WINED3DRS_MULTISAMPLEANTIALIAS          = 161,
326     WINED3DRS_MULTISAMPLEMASK               = 162,
327     WINED3DRS_PATCHEDGESTYLE                = 163,
328     WINED3DRS_PATCHSEGMENTS                 = 164, /* d3d8 */
329     WINED3DRS_DEBUGMONITORTOKEN             = 165,
330     WINED3DRS_POINTSIZE_MAX                 = 166,
331     WINED3DRS_INDEXEDVERTEXBLENDENABLE      = 167,
332     WINED3DRS_COLORWRITEENABLE              = 168,
333     WINED3DRS_TWEENFACTOR                   = 170,
334     WINED3DRS_BLENDOP                       = 171,
335     WINED3DRS_POSITIONORDER                 = 172,
336     WINED3DRS_NORMALORDER                   = 173,
337     WINED3DRS_POSITIONDEGREE                = 172,
338     WINED3DRS_NORMALDEGREE                  = 173,
339     WINED3DRS_SCISSORTESTENABLE             = 174,
340     WINED3DRS_SLOPESCALEDEPTHBIAS           = 175,
341     WINED3DRS_ANTIALIASEDLINEENABLE         = 176,
342     WINED3DRS_MINTESSELLATIONLEVEL          = 178,
343     WINED3DRS_MAXTESSELLATIONLEVEL          = 179,
344     WINED3DRS_ADAPTIVETESS_X                = 180,
345     WINED3DRS_ADAPTIVETESS_Y                = 181,
346     WINED3DRS_ADAPTIVETESS_Z                = 182,
347     WINED3DRS_ADAPTIVETESS_W                = 183,
348     WINED3DRS_ENABLEADAPTIVETESSELLATION    = 184,
349     WINED3DRS_TWOSIDEDSTENCILMODE           = 185,
350     WINED3DRS_CCW_STENCILFAIL               = 186,
351     WINED3DRS_CCW_STENCILZFAIL              = 187,
352     WINED3DRS_CCW_STENCILPASS               = 188,
353     WINED3DRS_CCW_STENCILFUNC               = 189,
354     WINED3DRS_COLORWRITEENABLE1             = 190,
355     WINED3DRS_COLORWRITEENABLE2             = 191,
356     WINED3DRS_COLORWRITEENABLE3             = 192,
357     WINED3DRS_BLENDFACTOR                   = 193,
358     WINED3DRS_SRGBWRITEENABLE               = 194,
359     WINED3DRS_DEPTHBIAS                     = 195,
360     WINED3DRS_WRAP8                         = 198,
361     WINED3DRS_WRAP9                         = 199,
362     WINED3DRS_WRAP10                        = 200,
363     WINED3DRS_WRAP11                        = 201,
364     WINED3DRS_WRAP12                        = 202,
365     WINED3DRS_WRAP13                        = 203,
366     WINED3DRS_WRAP14                        = 204,
367     WINED3DRS_WRAP15                        = 205,
368     WINED3DRS_SEPARATEALPHABLENDENABLE      = 206,
369     WINED3DRS_SRCBLENDALPHA                 = 207,
370     WINED3DRS_DESTBLENDALPHA                = 208,
371     WINED3DRS_BLENDOPALPHA                  = 209,
372     WINED3DRS_FORCE_DWORD                   = 0x7fffffff
373 } WINED3DRENDERSTATETYPE;
374 const UINT WINEHIGHEST_RENDER_STATE         = WINED3DRS_BLENDOPALPHA;
375
376 typedef enum _WINED3DBLEND
377 {
378     WINED3DBLEND_ZERO                       =  1,
379     WINED3DBLEND_ONE                        =  2,
380     WINED3DBLEND_SRCCOLOR                   =  3,
381     WINED3DBLEND_INVSRCCOLOR                =  4,
382     WINED3DBLEND_SRCALPHA                   =  5,
383     WINED3DBLEND_INVSRCALPHA                =  6,
384     WINED3DBLEND_DESTALPHA                  =  7,
385     WINED3DBLEND_INVDESTALPHA               =  8,
386     WINED3DBLEND_DESTCOLOR                  =  9,
387     WINED3DBLEND_INVDESTCOLOR               = 10,
388     WINED3DBLEND_SRCALPHASAT                = 11,
389     WINED3DBLEND_BOTHSRCALPHA               = 12,
390     WINED3DBLEND_BOTHINVSRCALPHA            = 13,
391     WINED3DBLEND_BLENDFACTOR                = 14,
392     WINED3DBLEND_INVBLENDFACTOR             = 15,
393     WINED3DBLEND_FORCE_DWORD                = 0x7fffffff
394 } WINED3DBLEND;
395
396 typedef enum _WINED3DBLENDOP
397 {
398     WINED3DBLENDOP_ADD                      = 1,
399     WINED3DBLENDOP_SUBTRACT                 = 2,
400     WINED3DBLENDOP_REVSUBTRACT              = 3,
401     WINED3DBLENDOP_MIN                      = 4,
402     WINED3DBLENDOP_MAX                      = 5,
403     WINED3DBLENDOP_FORCE_DWORD              = 0x7fffffff
404 } WINED3DBLENDOP;
405
406 typedef enum _WINED3DVERTEXBLENDFLAGS
407 {
408     WINED3DVBF_DISABLE                      = 0,
409     WINED3DVBF_1WEIGHTS                     = 1,
410     WINED3DVBF_2WEIGHTS                     = 2,
411     WINED3DVBF_3WEIGHTS                     = 3,
412     WINED3DVBF_TWEENING                     = 255,
413     WINED3DVBF_0WEIGHTS                     = 256
414 } WINED3DVERTEXBLENDFLAGS;
415
416 typedef enum _WINED3DCMPFUNC
417 {
418     WINED3DCMP_NEVER                        = 1,
419     WINED3DCMP_LESS                         = 2,
420     WINED3DCMP_EQUAL                        = 3,
421     WINED3DCMP_LESSEQUAL                    = 4,
422     WINED3DCMP_GREATER                      = 5,
423     WINED3DCMP_NOTEQUAL                     = 6,
424     WINED3DCMP_GREATEREQUAL                 = 7,
425     WINED3DCMP_ALWAYS                       = 8,
426     WINED3DCMP_FORCE_DWORD                  = 0x7fffffff
427 } WINED3DCMPFUNC;
428
429 typedef enum _WINED3DZBUFFERTYPE
430 {
431     WINED3DZB_FALSE                         = 0,
432     WINED3DZB_TRUE                          = 1,
433     WINED3DZB_USEW                          = 2,
434     WINED3DZB_FORCE_DWORD                   = 0x7fffffff
435 } WINED3DZBUFFERTYPE;
436
437 typedef enum _WINED3DFOGMODE
438 {
439     WINED3DFOG_NONE                         = 0,
440     WINED3DFOG_EXP                          = 1,
441     WINED3DFOG_EXP2                         = 2,
442     WINED3DFOG_LINEAR                       = 3,
443     WINED3DFOG_FORCE_DWORD                  = 0x7fffffff
444 } WINED3DFOGMODE;
445
446 typedef enum _WINED3DSHADEMODE
447 {
448     WINED3DSHADE_FLAT                       = 1,
449     WINED3DSHADE_GOURAUD                    = 2,
450     WINED3DSHADE_PHONG                      = 3,
451     WINED3DSHADE_FORCE_DWORD                = 0x7fffffff
452 } WINED3DSHADEMODE;
453
454 typedef enum _WINED3DFILLMODE
455 {
456     WINED3DFILL_POINT                       = 1,
457     WINED3DFILL_WIREFRAME                   = 2,
458     WINED3DFILL_SOLID                       = 3,
459     WINED3DFILL_FORCE_DWORD                 = 0x7fffffff
460 } WINED3DFILLMODE;
461
462 typedef enum _WINED3DCULL
463 {
464     WINED3DCULL_NONE                        = 1,
465     WINED3DCULL_CW                          = 2,
466     WINED3DCULL_CCW                         = 3,
467     WINED3DCULL_FORCE_DWORD                 = 0x7fffffff
468 } WINED3DCULL;
469
470 typedef enum _WINED3DSTENCILOP
471 {
472     WINED3DSTENCILOP_KEEP                   = 1,
473     WINED3DSTENCILOP_ZERO                   = 2,
474     WINED3DSTENCILOP_REPLACE                = 3,
475     WINED3DSTENCILOP_INCRSAT                = 4,
476     WINED3DSTENCILOP_DECRSAT                = 5,
477     WINED3DSTENCILOP_INVERT                 = 6,
478     WINED3DSTENCILOP_INCR                   = 7,
479     WINED3DSTENCILOP_DECR                   = 8,
480     WINED3DSTENCILOP_FORCE_DWORD            = 0x7fffffff
481 } WINED3DSTENCILOP;
482
483 typedef enum _WINED3DMATERIALCOLORSOURCE
484 {
485     WINED3DMCS_MATERIAL                     = 0,
486     WINED3DMCS_COLOR1                       = 1,
487     WINED3DMCS_COLOR2                       = 2,
488     WINED3DMCS_FORCE_DWORD                  = 0x7fffffff
489 } WINED3DMATERIALCOLORSOURCE;
490
491 typedef enum _WINED3DPATCHEDGESTYLE
492 {
493     WINED3DPATCHEDGE_DISCRETE               = 0,
494     WINED3DPATCHEDGE_CONTINUOUS             = 1,
495     WINED3DPATCHEDGE_FORCE_DWORD            = 0x7fffffff
496 } WINED3DPATCHEDGESTYLE;
497
498 typedef enum _WINED3DBACKBUFFER_TYPE
499 {
500     WINED3DBACKBUFFER_TYPE_MONO             = 0,
501     WINED3DBACKBUFFER_TYPE_LEFT             = 1,
502     WINED3DBACKBUFFER_TYPE_RIGHT            = 2,
503     WINED3DBACKBUFFER_TYPE_FORCE_DWORD      = 0x7fffffff
504 } WINED3DBACKBUFFER_TYPE;
505
506 typedef enum _WINED3DSWAPEFFECT
507 {
508     WINED3DSWAPEFFECT_DISCARD               = 1,
509     WINED3DSWAPEFFECT_FLIP                  = 2,
510     WINED3DSWAPEFFECT_COPY                  = 3,
511     WINED3DSWAPEFFECT_COPY_VSYNC            = 4,
512     WINED3DSWAPEFFECT_FORCE_DWORD           = 0xffffffff
513 } WINED3DSWAPEFFECT;
514
515 typedef enum _WINED3DSAMPLERSTATETYPE
516 {
517     WINED3DSAMP_ADDRESSU                    = 1,
518     WINED3DSAMP_ADDRESSV                    = 2,
519     WINED3DSAMP_ADDRESSW                    = 3,
520     WINED3DSAMP_BORDERCOLOR                 = 4,
521     WINED3DSAMP_MAGFILTER                   = 5,
522     WINED3DSAMP_MINFILTER                   = 6,
523     WINED3DSAMP_MIPFILTER                   = 7,
524     WINED3DSAMP_MIPMAPLODBIAS               = 8,
525     WINED3DSAMP_MAXMIPLEVEL                 = 9,
526     WINED3DSAMP_MAXANISOTROPY               = 10,
527     WINED3DSAMP_SRGBTEXTURE                 = 11,
528     WINED3DSAMP_ELEMENTINDEX                = 12,
529     WINED3DSAMP_DMAPOFFSET                  = 13,
530     WINED3DSAMP_FORCE_DWORD                 = 0x7fffffff,
531 } WINED3DSAMPLERSTATETYPE;
532 const UINT WINED3D_HIGHEST_SAMPLER_STATE    = WINED3DSAMP_DMAPOFFSET;
533
534 typedef enum _WINED3DMULTISAMPLE_TYPE
535 {
536     WINED3DMULTISAMPLE_NONE                 = 0,
537     WINED3DMULTISAMPLE_NONMASKABLE          = 1,
538     WINED3DMULTISAMPLE_2_SAMPLES            = 2,
539     WINED3DMULTISAMPLE_3_SAMPLES            = 3,
540     WINED3DMULTISAMPLE_4_SAMPLES            = 4,
541     WINED3DMULTISAMPLE_5_SAMPLES            = 5,
542     WINED3DMULTISAMPLE_6_SAMPLES            = 6,
543     WINED3DMULTISAMPLE_7_SAMPLES            = 7,
544     WINED3DMULTISAMPLE_8_SAMPLES            = 8,
545     WINED3DMULTISAMPLE_9_SAMPLES            = 9,
546     WINED3DMULTISAMPLE_10_SAMPLES           = 10,
547     WINED3DMULTISAMPLE_11_SAMPLES           = 11,
548     WINED3DMULTISAMPLE_12_SAMPLES           = 12,
549     WINED3DMULTISAMPLE_13_SAMPLES           = 13,
550     WINED3DMULTISAMPLE_14_SAMPLES           = 14,
551     WINED3DMULTISAMPLE_15_SAMPLES           = 15,
552     WINED3DMULTISAMPLE_16_SAMPLES           = 16,
553     WINED3DMULTISAMPLE_FORCE_DWORD          = 0xffffffff
554 } WINED3DMULTISAMPLE_TYPE;
555
556 typedef enum _WINED3DTEXTURESTAGESTATETYPE
557 {
558     WINED3DTSS_COLOROP                      = 0,
559     WINED3DTSS_COLORARG1                    = 1,
560     WINED3DTSS_COLORARG2                    = 2,
561     WINED3DTSS_ALPHAOP                      = 3,
562     WINED3DTSS_ALPHAARG1                    = 4,
563     WINED3DTSS_ALPHAARG2                    = 5,
564     WINED3DTSS_BUMPENVMAT00                 = 6,
565     WINED3DTSS_BUMPENVMAT01                 = 7,
566     WINED3DTSS_BUMPENVMAT10                 = 8,
567     WINED3DTSS_BUMPENVMAT11                 = 9,
568     WINED3DTSS_TEXCOORDINDEX                = 10,
569     WINED3DTSS_BUMPENVLSCALE                = 11,
570     WINED3DTSS_BUMPENVLOFFSET               = 12,
571     WINED3DTSS_TEXTURETRANSFORMFLAGS        = 13,
572     WINED3DTSS_COLORARG0                    = 14,
573     WINED3DTSS_ALPHAARG0                    = 15,
574     WINED3DTSS_RESULTARG                    = 16,
575     WINED3DTSS_CONSTANT                     = 17,
576     WINED3DTSS_FORCE_DWORD                  = 0x7fffffff
577 } WINED3DTEXTURESTAGESTATETYPE;
578 const UINT WINED3D_HIGHEST_TEXTURE_STATE    = WINED3DTSS_CONSTANT;
579
580 typedef enum _WINED3DTEXTURETRANSFORMFLAGS
581 {
582     WINED3DTTFF_DISABLE                     = 0,
583     WINED3DTTFF_COUNT1                      = 1,
584     WINED3DTTFF_COUNT2                      = 2,
585     WINED3DTTFF_COUNT3                      = 3,
586     WINED3DTTFF_COUNT4                      = 4,
587     WINED3DTTFF_PROJECTED                   = 256,
588     WINED3DTTFF_FORCE_DWORD                 = 0x7fffffff
589 } WINED3DTEXTURETRANSFORMFLAGS;
590
591 typedef enum _WINED3DTEXTUREOP
592 {
593     WINED3DTOP_DISABLE                      = 1,
594     WINED3DTOP_SELECTARG1                   = 2,
595     WINED3DTOP_SELECTARG2                   = 3,
596     WINED3DTOP_MODULATE                     = 4,
597     WINED3DTOP_MODULATE2X                   = 5,
598     WINED3DTOP_MODULATE4X                   = 6,
599     WINED3DTOP_ADD                          = 7,
600     WINED3DTOP_ADDSIGNED                    = 8,
601     WINED3DTOP_ADDSIGNED2X                  = 9,
602     WINED3DTOP_SUBTRACT                     = 10,
603     WINED3DTOP_ADDSMOOTH                    = 11,
604     WINED3DTOP_BLENDDIFFUSEALPHA            = 12,
605     WINED3DTOP_BLENDTEXTUREALPHA            = 13,
606     WINED3DTOP_BLENDFACTORALPHA             = 14,
607     WINED3DTOP_BLENDTEXTUREALPHAPM          = 15,
608     WINED3DTOP_BLENDCURRENTALPHA            = 16,
609     WINED3DTOP_PREMODULATE                  = 17,
610     WINED3DTOP_MODULATEALPHA_ADDCOLOR       = 18,
611     WINED3DTOP_MODULATECOLOR_ADDALPHA       = 19,
612     WINED3DTOP_MODULATEINVALPHA_ADDCOLOR    = 20,
613     WINED3DTOP_MODULATEINVCOLOR_ADDALPHA    = 21,
614     WINED3DTOP_BUMPENVMAP                   = 22,
615     WINED3DTOP_BUMPENVMAPLUMINANCE          = 23,
616     WINED3DTOP_DOTPRODUCT3                  = 24,
617     WINED3DTOP_MULTIPLYADD                  = 25,
618     WINED3DTOP_LERP                         = 26,
619     WINED3DTOP_FORCE_DWORD                  = 0x7fffffff,
620 } WINED3DTEXTUREOP;
621
622 typedef enum _WINED3DTEXTUREADDRESS
623 {
624     WINED3DTADDRESS_WRAP                    = 1,
625     WINED3DTADDRESS_MIRROR                  = 2,
626     WINED3DTADDRESS_CLAMP                   = 3,
627     WINED3DTADDRESS_BORDER                  = 4,
628     WINED3DTADDRESS_MIRRORONCE              = 5,
629     WINED3DTADDRESS_FORCE_DWORD             = 0x7fffffff
630 } WINED3DTEXTUREADDRESS;
631
632 typedef enum _WINED3DTRANSFORMSTATETYPE
633 {
634     WINED3DTS_VIEW                          = 2,
635     WINED3DTS_PROJECTION                    = 3,
636     WINED3DTS_TEXTURE0                      = 16,
637     WINED3DTS_TEXTURE1                      = 17,
638     WINED3DTS_TEXTURE2                      = 18,
639     WINED3DTS_TEXTURE3                      = 19,
640     WINED3DTS_TEXTURE4                      = 20,
641     WINED3DTS_TEXTURE5                      = 21,
642     WINED3DTS_TEXTURE6                      = 22,
643     WINED3DTS_TEXTURE7                      = 23,
644     WINED3DTS_FORCE_DWORD                   = 0x7fffffff
645 } WINED3DTRANSFORMSTATETYPE;
646 cpp_quote("#define WINED3DTS_WORLD  WINED3DTS_WORLDMATRIX(0)")
647 cpp_quote("#define WINED3DTS_WORLD1 WINED3DTS_WORLDMATRIX(1)")
648 cpp_quote("#define WINED3DTS_WORLD2 WINED3DTS_WORLDMATRIX(2)")
649 cpp_quote("#define WINED3DTS_WORLD3 WINED3DTS_WORLDMATRIX(3)")
650 cpp_quote("#define WINED3DTS_WORLDMATRIX(index) (WINED3DTRANSFORMSTATETYPE)(index + 256)")
651
652 typedef enum _WINED3DBASISTYPE
653 {
654     WINED3DBASIS_BEZIER                     = 0,
655     WINED3DBASIS_BSPLINE                    = 1,
656     WINED3DBASIS_INTERPOLATE                = 2,
657     WINED3DBASIS_FORCE_DWORD                = 0x7fffffff
658 } WINED3DBASISTYPE;
659
660 typedef enum _WINED3DCUBEMAP_FACES
661 {
662     WINED3DCUBEMAP_FACE_POSITIVE_X          = 0,
663     WINED3DCUBEMAP_FACE_NEGATIVE_X          = 1,
664     WINED3DCUBEMAP_FACE_POSITIVE_Y          = 2,
665     WINED3DCUBEMAP_FACE_NEGATIVE_Y          = 3,
666     WINED3DCUBEMAP_FACE_POSITIVE_Z          = 4,
667     WINED3DCUBEMAP_FACE_NEGATIVE_Z          = 5,
668     WINED3DCUBEMAP_FACE_FORCE_DWORD         = 0xffffffff
669 } WINED3DCUBEMAP_FACES;
670
671 typedef enum _WINED3DTEXTUREFILTERTYPE
672 {
673     WINED3DTEXF_NONE                        = 0,
674     WINED3DTEXF_POINT                       = 1,
675     WINED3DTEXF_LINEAR                      = 2,
676     WINED3DTEXF_ANISOTROPIC                 = 3,
677     WINED3DTEXF_FLATCUBIC                   = 4,
678     WINED3DTEXF_GAUSSIANCUBIC               = 5,
679     WINED3DTEXF_PYRAMIDALQUAD               = 6,
680     WINED3DTEXF_GAUSSIANQUAD                = 7,
681     WINED3DTEXF_FORCE_DWORD                 = 0x7fffffff
682 } WINED3DTEXTUREFILTERTYPE;
683
684 typedef enum _WINED3DRESOURCETYPE
685 {
686     WINED3DRTYPE_SURFACE                    = 1,
687     WINED3DRTYPE_VOLUME                     = 2,
688     WINED3DRTYPE_TEXTURE                    = 3,
689     WINED3DRTYPE_VOLUMETEXTURE              = 4,
690     WINED3DRTYPE_CUBETEXTURE                = 5,
691     WINED3DRTYPE_VERTEXBUFFER               = 6,
692     WINED3DRTYPE_INDEXBUFFER                = 7,
693     WINED3DRTYPE_FORCE_DWORD                = 0x7fffffff
694 } WINED3DRESOURCETYPE;
695 const UINT WINED3DRTYPECOUNT                = WINED3DRTYPE_INDEXBUFFER + 1;
696
697 typedef enum _WINED3DPOOL
698 {
699     WINED3DPOOL_DEFAULT                     = 0,
700     WINED3DPOOL_MANAGED                     = 1,
701     WINED3DPOOL_SYSTEMMEM                   = 2,
702     WINED3DPOOL_SCRATCH                     = 3,
703     WINED3DPOOL_FORCE_DWORD                 = 0x7fffffff
704 } WINED3DPOOL;
705
706 typedef enum _WINED3DQUERYTYPE
707 {
708     WINED3DQUERYTYPE_VCACHE                 = 4,
709     WINED3DQUERYTYPE_RESOURCEMANAGER        = 5,
710     WINED3DQUERYTYPE_VERTEXSTATS            = 6,
711     WINED3DQUERYTYPE_EVENT                  = 8,
712     WINED3DQUERYTYPE_OCCLUSION              = 9,
713     WINED3DQUERYTYPE_TIMESTAMP              = 10,
714     WINED3DQUERYTYPE_TIMESTAMPDISJOINT      = 11,
715     WINED3DQUERYTYPE_TIMESTAMPFREQ          = 12,
716     WINED3DQUERYTYPE_PIPELINETIMINGS        = 13,
717     WINED3DQUERYTYPE_INTERFACETIMINGS       = 14,
718     WINED3DQUERYTYPE_VERTEXTIMINGS          = 15,
719     WINED3DQUERYTYPE_PIXELTIMINGS           = 16,
720     WINED3DQUERYTYPE_BANDWIDTHTIMINGS       = 17,
721     WINED3DQUERYTYPE_CACHEUTILIZATION       = 18
722 } WINED3DQUERYTYPE;
723
724 const UINT WINED3DISSUE_BEGIN               = (1 << 1);
725 const UINT WINED3DISSUE_END                 = (1 << 0);
726 const UINT WINED3DGETDATA_FLUSH             = (1 << 0);
727
728 typedef enum _WINED3DSTATEBLOCKTYPE
729 {
730     WINED3DSBT_INIT                         = 0,
731     WINED3DSBT_ALL                          = 1,
732     WINED3DSBT_PIXELSTATE                   = 2,
733     WINED3DSBT_VERTEXSTATE                  = 3,
734     WINED3DSBT_RECORDED                     = 4, /* WineD3D private */
735     WINED3DSBT_FORCE_DWORD                  = 0xffffffff
736 } WINED3DSTATEBLOCKTYPE;
737
738 typedef enum _WINED3DDECLMETHOD
739 {
740     WINED3DDECLMETHOD_DEFAULT               = 0,
741     WINED3DDECLMETHOD_PARTIALU              = 1,
742     WINED3DDECLMETHOD_PARTIALV              = 2,
743     WINED3DDECLMETHOD_CROSSUV               = 3,
744     WINED3DDECLMETHOD_UV                    = 4,
745     WINED3DDECLMETHOD_LOOKUP                = 5,
746     WINED3DDECLMETHOD_LOOKUPPRESAMPLED      = 6
747 } WINED3DDECLMETHOD;
748
749 typedef enum _WINED3DDECLTYPE
750 {
751     WINED3DDECLTYPE_FLOAT1                  = 0,
752     WINED3DDECLTYPE_FLOAT2                  = 1,
753     WINED3DDECLTYPE_FLOAT3                  = 2,
754     WINED3DDECLTYPE_FLOAT4                  = 3,
755     WINED3DDECLTYPE_D3DCOLOR                = 4,
756     WINED3DDECLTYPE_UBYTE4                  = 5,
757     WINED3DDECLTYPE_SHORT2                  = 6,
758     WINED3DDECLTYPE_SHORT4                  = 7,
759     /* VS 2.0 */
760     WINED3DDECLTYPE_UBYTE4N                 = 8,
761     WINED3DDECLTYPE_SHORT2N                 = 9,
762     WINED3DDECLTYPE_SHORT4N                 = 10,
763     WINED3DDECLTYPE_USHORT2N                = 11,
764     WINED3DDECLTYPE_USHORT4N                = 12,
765     WINED3DDECLTYPE_UDEC3                   = 13,
766     WINED3DDECLTYPE_DEC3N                   = 14,
767     WINED3DDECLTYPE_FLOAT16_2               = 15,
768     WINED3DDECLTYPE_FLOAT16_4               = 16,
769     WINED3DDECLTYPE_UNUSED                  = 17,
770 } WINED3DDECLTYPE;
771 cpp_quote("#define WINED3DDECL_END() {0xFF, 0, WINED3DDECLTYPE_UNUSED, 0, 0, 0, -1}")
772
773 typedef enum _WINED3DDECLUSAGE
774 {
775     WINED3DDECLUSAGE_POSITION               = 0,
776     WINED3DDECLUSAGE_BLENDWEIGHT            = 1,
777     WINED3DDECLUSAGE_BLENDINDICES           = 2,
778     WINED3DDECLUSAGE_NORMAL                 = 3,
779     WINED3DDECLUSAGE_PSIZE                  = 4,
780     WINED3DDECLUSAGE_TEXCOORD               = 5,
781     WINED3DDECLUSAGE_TANGENT                = 6,
782     WINED3DDECLUSAGE_BINORMAL               = 7,
783     WINED3DDECLUSAGE_TESSFACTOR             = 8,
784     WINED3DDECLUSAGE_POSITIONT              = 9,
785     WINED3DDECLUSAGE_COLOR                  = 10,
786     WINED3DDECLUSAGE_FOG                    = 11,
787     WINED3DDECLUSAGE_DEPTH                  = 12,
788     WINED3DDECLUSAGE_SAMPLE                 = 13
789 } WINED3DDECLUSAGE;
790
791 typedef enum _WINED3DSURFTYPE
792 {
793     SURFACE_UNKNOWN                         = 0,    /* Default / Unknown surface type */
794     SURFACE_OPENGL,                                 /* OpenGL surface: Renders using libGL, needed for 3D */
795     SURFACE_GDI,                                    /* User surface. No 3D, DirectDraw rendering with GDI */
796 } WINED3DSURFTYPE;
797
798 const UINT WINED3DCOLORWRITEENABLE_RED                          = (1<<0);
799 const UINT WINED3DCOLORWRITEENABLE_GREEN                        = (1<<1);
800 const UINT WINED3DCOLORWRITEENABLE_BLUE                         = (1<<2);
801 const UINT WINED3DCOLORWRITEENABLE_ALPHA                        = (1<<3);
802
803 const UINT WINED3DADAPTER_DEFAULT                               = 0;
804 const UINT WINED3DENUM_NO_WHQL_LEVEL                            = 2;
805 const UINT WINED3DPRESENT_BACK_BUFFER_MAX                       = 3;
806
807 const UINT WINED3DTSS_TCI_PASSTHRU                              = 0x00000;
808 const UINT WINED3DTSS_TCI_CAMERASPACENORMAL                     = 0x10000;
809 const UINT WINED3DTSS_TCI_CAMERASPACEPOSITION                   = 0x20000;
810 const UINT WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR           = 0x30000;
811 const UINT WINED3DTSS_TCI_SPHEREMAP                             = 0x40000;
812
813 const UINT WINED3DTA_SELECTMASK                                 = 0x0000000f;
814 const UINT WINED3DTA_DIFFUSE                                    = 0x00000000;
815 const UINT WINED3DTA_CURRENT                                    = 0x00000001;
816 const UINT WINED3DTA_TEXTURE                                    = 0x00000002;
817 const UINT WINED3DTA_TFACTOR                                    = 0x00000003;
818 const UINT WINED3DTA_SPECULAR                                   = 0x00000004;
819 const UINT WINED3DTA_TEMP                                       = 0x00000005;
820 const UINT WINED3DTA_CONSTANT                                   = 0x00000006;
821 const UINT WINED3DTA_COMPLEMENT                                 = 0x00000010;
822 const UINT WINED3DTA_ALPHAREPLICATE                             = 0x00000020;
823
824 const UINT WINED3DPRESENTFLAG_LOCKABLE_BACKBUFFER               = 0x00000001;
825 const UINT WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL              = 0x00000002;
826 const UINT WINED3DPRESENTFLAG_DEVICECLIP                        = 0x00000004;
827 const UINT WINED3DPRESENTFLAG_VIDEO                             = 0x00000010;
828 const UINT WINED3DPRESENTFLAG_NOAUTOROTATE                      = 0x00000020;
829 const UINT WINED3DPRESENTFLAG_UNPRUNEDMODE                      = 0x00000040;
830
831 const UINT WINED3DDP_MAXTEXCOORD                                = 8;
832
833 const UINT WINED3DUSAGE_RENDERTARGET                            = 0x00000001;
834 const UINT WINED3DUSAGE_DEPTHSTENCIL                            = 0x00000002;
835 const UINT WINED3DUSAGE_WRITEONLY                               = 0x00000008;
836 const UINT WINED3DUSAGE_SOFTWAREPROCESSING                      = 0x00000010;
837 const UINT WINED3DUSAGE_DONOTCLIP                               = 0x00000020;
838 const UINT WINED3DUSAGE_POINTS                                  = 0x00000040;
839 const UINT WINED3DUSAGE_RTPATCHES                               = 0x00000080;
840 const UINT WINED3DUSAGE_NPATCHES                                = 0x00000100;
841 const UINT WINED3DUSAGE_DYNAMIC                                 = 0x00000200;
842 const UINT WINED3DUSAGE_AUTOGENMIPMAP                           = 0x00000400;
843 const UINT WINED3DUSAGE_DMAP                                    = 0x00004000;
844 const UINT WINED3DUSAGE_MASK                                    = 0x00004fff;
845 const UINT WINED3DUSAGE_OVERLAY                                 = 0x80000000;
846
847 const UINT WINED3DUSAGE_QUERY_LEGACYBUMPMAP                     = 0x00008000;
848 const UINT WINED3DUSAGE_QUERY_FILTER                            = 0x00020000;
849 const UINT WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING          = 0x00080000;
850 const UINT WINED3DUSAGE_QUERY_SRGBREAD                          = 0x00010000;
851 const UINT WINED3DUSAGE_QUERY_SRGBWRITE                         = 0x00040000;
852 const UINT WINED3DUSAGE_QUERY_VERTEXTEXTURE                     = 0x00100000;
853 const UINT WINED3DUSAGE_QUERY_WRAPANDMIP                        = 0x00200000;
854 const UINT WINED3DUSAGE_QUERY_MASK                              = 0x003f8000;
855
856 const UINT WINED3DLOCK_READONLY                                 = 0x0010;
857 const UINT WINED3DLOCK_NOSYSLOCK                                = 0x0800;
858 const UINT WINED3DLOCK_NOOVERWRITE                              = 0x1000;
859 const UINT WINED3DLOCK_DISCARD                                  = 0x2000;
860 const UINT WINED3DLOCK_DONOTWAIT                                = 0x4000;
861 const UINT WINED3DLOCK_NO_DIRTY_UPDATE                          = 0x8000;
862
863 const UINT WINED3DPRESENT_RATE_DEFAULT                          = 0x000000000;
864
865 const UINT WINED3DPRESENT_INTERVAL_DEFAULT                      = 0x00000000;
866 const UINT WINED3DPRESENT_INTERVAL_ONE                          = 0x00000001;
867 const UINT WINED3DPRESENT_INTERVAL_TWO                          = 0x00000002;
868 const UINT WINED3DPRESENT_INTERVAL_THREE                        = 0x00000004;
869 const UINT WINED3DPRESENT_INTERVAL_FOUR                         = 0x00000008;
870 const UINT WINED3DPRESENT_INTERVAL_IMMEDIATE                    = 0x80000000;
871
872 const UINT WINED3DMAXUSERCLIPPLANES                             = 32;
873 const UINT WINED3DCLIPPLANE0                                    = (1 << 0);
874 const UINT WINED3DCLIPPLANE1                                    = (1 << 1);
875 const UINT WINED3DCLIPPLANE2                                    = (1 << 2);
876 const UINT WINED3DCLIPPLANE3                                    = (1 << 3);
877 const UINT WINED3DCLIPPLANE4                                    = (1 << 4);
878 const UINT WINED3DCLIPPLANE5                                    = (1 << 5);
879
880 /* FVF (Flexible Vertex Format) codes */
881 const UINT WINED3DFVF_RESERVED0                                 = 0x0001;
882 const UINT WINED3DFVF_POSITION_MASK                             = 0x400e;
883 const UINT WINED3DFVF_XYZ                                       = 0x0002;
884 const UINT WINED3DFVF_XYZRHW                                    = 0x0004;
885 const UINT WINED3DFVF_XYZB1                                     = 0x0006;
886 const UINT WINED3DFVF_XYZB2                                     = 0x0008;
887 const UINT WINED3DFVF_XYZB3                                     = 0x000a;
888 const UINT WINED3DFVF_XYZB4                                     = 0x000c;
889 const UINT WINED3DFVF_XYZB5                                     = 0x000e;
890 const UINT WINED3DFVF_XYZW                                      = 0x4002;
891 const UINT WINED3DFVF_NORMAL                                    = 0x0010;
892 const UINT WINED3DFVF_PSIZE                                     = 0x0020;
893 const UINT WINED3DFVF_DIFFUSE                                   = 0x0040;
894 const UINT WINED3DFVF_SPECULAR                                  = 0x0080;
895 const UINT WINED3DFVF_TEXCOUNT_MASK                             = 0x0f00;
896 const UINT WINED3DFVF_TEXCOUNT_SHIFT                            = 8;
897 const UINT WINED3DFVF_TEX0                                      = 0x0000;
898 const UINT WINED3DFVF_TEX1                                      = 0x0100;
899 const UINT WINED3DFVF_TEX2                                      = 0x0200;
900 const UINT WINED3DFVF_TEX3                                      = 0x0300;
901 const UINT WINED3DFVF_TEX4                                      = 0x0400;
902 const UINT WINED3DFVF_TEX5                                      = 0x0500;
903 const UINT WINED3DFVF_TEX6                                      = 0x0600;
904 const UINT WINED3DFVF_TEX7                                      = 0x0700;
905 const UINT WINED3DFVF_TEX8                                      = 0x0800;
906 const UINT WINED3DFVF_LASTBETA_UBYTE4                           = 0x1000;
907 const UINT WINED3DFVF_LASTBETA_D3DCOLOR                         = 0x8000;
908 const UINT WINED3DFVF_RESERVED2                                 = 0x6000;
909
910 const UINT WINED3DFVF_TEXTUREFORMAT1                            = 3;
911 const UINT WINED3DFVF_TEXTUREFORMAT2                            = 0;
912 const UINT WINED3DFVF_TEXTUREFORMAT3                            = 1;
913 const UINT WINED3DFVF_TEXTUREFORMAT4                            = 2;
914 cpp_quote("#define WINED3DFVF_TEXCOORDSIZE1(CoordIndex) (WINED3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))")
915 cpp_quote("#define WINED3DFVF_TEXCOORDSIZE2(CoordIndex) (WINED3DFVF_TEXTUREFORMAT2)")
916 cpp_quote("#define WINED3DFVF_TEXCOORDSIZE3(CoordIndex) (WINED3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))")
917 cpp_quote("#define WINED3DFVF_TEXCOORDSIZE4(CoordIndex) (WINED3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))")
918
919 /* Clear flags */
920 const UINT WINED3DCLEAR_TARGET                                  = 0x00000001;
921 const UINT WINED3DCLEAR_ZBUFFER                                 = 0x00000002;
922 const UINT WINED3DCLEAR_STENCIL                                 = 0x00000004;
923
924 /* Stream source flags */
925 const UINT WINED3DSTREAMSOURCE_INDEXEDDATA                      = (1 << 30);
926 const UINT WINED3DSTREAMSOURCE_INSTANCEDATA                     = (2 << 30);
927
928 /* SetPrivateData flags */
929 const UINT WINED3DSPD_IUNKNOWN                                  = 0x00000001;
930
931 /* IWineD3D::CreateDevice behaviour flags */
932 const UINT WINED3DCREATE_FPU_PRESERVE                           = 0x00000002;
933 const UINT WINED3DCREATE_PUREDEVICE                             = 0x00000010;
934 const UINT WINED3DCREATE_SOFTWARE_VERTEXPROCESSING              = 0x00000020;
935 const UINT WINED3DCREATE_HARDWARE_VERTEXPROCESSING              = 0x00000040;
936 const UINT WINED3DCREATE_MIXED_VERTEXPROCESSING                 = 0x00000080;
937 const UINT WINED3DCREATE_DISABLE_DRIVER_MANAGEMENT              = 0x00000100;
938 const UINT WINED3DCREATE_ADAPTERGROUP_DEVICE                    = 0x00000200;
939
940 /* VTF defines */
941 const UINT WINED3DDMAPSAMPLER                                   = 0x100;
942 const UINT WINED3DVERTEXTEXTURESAMPLER0                         = (WINED3DDMAPSAMPLER + 1);
943 const UINT WINED3DVERTEXTEXTURESAMPLER1                         = (WINED3DDMAPSAMPLER + 2);
944 const UINT WINED3DVERTEXTEXTURESAMPLER2                         = (WINED3DDMAPSAMPLER + 3);
945 const UINT WINED3DVERTEXTEXTURESAMPLER3                         = (WINED3DDMAPSAMPLER + 4);
946
947 const UINT WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD        = 0x00000020;
948 const UINT WINED3DCAPS3_LINEAR_TO_SRGB_PRESENTATION             = 0x00000080;
949 const UINT WINED3DCAPS3_COPY_TO_VIDMEM                          = 0x00000100;
950 const UINT WINED3DCAPS3_COPY_TO_SYSTEMMEM                       = 0x00000200;
951 const UINT WINED3DCAPS3_RESERVED                                = 0x8000001f;
952
953 const UINT WINED3DDEVCAPS2_STREAMOFFSET                         = 0x00000001;
954 const UINT WINED3DDEVCAPS2_DMAPNPATCH                           = 0x00000002;
955 const UINT WINED3DDEVCAPS2_ADAPTIVETESSRTPATCH                  = 0x00000004;
956 const UINT WINED3DDEVCAPS2_ADAPTIVETESSNPATCH                   = 0x00000008;
957 const UINT WINED3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES        = 0x00000010;
958 const UINT WINED3DDEVCAPS2_PRESAMPLEDDMAPNPATCH                 = 0x00000020;
959 const UINT WINED3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET   = 0x00000040;
960
961 const UINT WINED3DDTCAPS_UBYTE4                                 = 0x00000001;
962 const UINT WINED3DDTCAPS_UBYTE4N                                = 0x00000002;
963 const UINT WINED3DDTCAPS_SHORT2N                                = 0x00000004;
964 const UINT WINED3DDTCAPS_SHORT4N                                = 0x00000008;
965 const UINT WINED3DDTCAPS_USHORT2N                               = 0x00000010;
966 const UINT WINED3DDTCAPS_USHORT4N                               = 0x00000020;
967 const UINT WINED3DDTCAPS_UDEC3                                  = 0x00000040;
968 const UINT WINED3DDTCAPS_DEC3N                                  = 0x00000080;
969 const UINT WINED3DDTCAPS_FLOAT16_2                              = 0x00000100;
970 const UINT WINED3DDTCAPS_FLOAT16_4                              = 0x00000200;
971
972 const UINT WINED3DFVFCAPS_TEXCOORDCOUNTMASK                     = 0x0000ffff;
973 const UINT WINED3DFVFCAPS_DONOTSTRIPELEMENTS                    = 0x00080000;
974 const UINT WINED3DFVFCAPS_PSIZE                                 = 0x00100000;
975
976 const UINT WINED3DLINECAPS_TEXTURE                              = 0x00000001;
977 const UINT WINED3DLINECAPS_ZTEST                                = 0x00000002;
978 const UINT WINED3DLINECAPS_BLEND                                = 0x00000004;
979 const UINT WINED3DLINECAPS_ALPHACMP                             = 0x00000008;
980 const UINT WINED3DLINECAPS_FOG                                  = 0x00000010;
981 const UINT WINED3DLINECAPS_ANTIALIAS                            = 0x00000020;
982
983 const UINT WINED3DMAX30SHADERINSTRUCTIONS                       = 32768;
984 const UINT WINED3DMIN30SHADERINSTRUCTIONS                       = 512;
985
986 const UINT WINED3DPBLENDCAPS_ZERO                               = 0x00000001;
987 const UINT WINED3DPBLENDCAPS_ONE                                = 0x00000002;
988 const UINT WINED3DPBLENDCAPS_SRCCOLOR                           = 0x00000004;
989 const UINT WINED3DPBLENDCAPS_INVSRCCOLOR                        = 0x00000008;
990 const UINT WINED3DPBLENDCAPS_SRCALPHA                           = 0x00000010;
991 const UINT WINED3DPBLENDCAPS_INVSRCALPHA                        = 0x00000020;
992 const UINT WINED3DPBLENDCAPS_DESTALPHA                          = 0x00000040;
993 const UINT WINED3DPBLENDCAPS_INVDESTALPHA                       = 0x00000080;
994 const UINT WINED3DPBLENDCAPS_DESTCOLOR                          = 0x00000100;
995 const UINT WINED3DPBLENDCAPS_INVDESTCOLOR                       = 0x00000200;
996 const UINT WINED3DPBLENDCAPS_SRCALPHASAT                        = 0x00000400;
997 const UINT WINED3DPBLENDCAPS_BOTHSRCALPHA                       = 0x00000800;
998 const UINT WINED3DPBLENDCAPS_BOTHINVSRCALPHA                    = 0x00001000;
999 const UINT WINED3DPBLENDCAPS_BLENDFACTOR                        = 0x00002000;
1000
1001 const UINT WINED3DPCMPCAPS_NEVER                                = 0x00000001;
1002 const UINT WINED3DPCMPCAPS_LESS                                 = 0x00000002;
1003 const UINT WINED3DPCMPCAPS_EQUAL                                = 0x00000004;
1004 const UINT WINED3DPCMPCAPS_LESSEQUAL                            = 0x00000008;
1005 const UINT WINED3DPCMPCAPS_GREATER                              = 0x00000010;
1006 const UINT WINED3DPCMPCAPS_NOTEQUAL                             = 0x00000020;
1007 const UINT WINED3DPCMPCAPS_GREATEREQUAL                         = 0x00000040;
1008 const UINT WINED3DPCMPCAPS_ALWAYS                               = 0x00000080;
1009
1010 const UINT WINED3DPMISCCAPS_MASKZ                               = 0x00000002;
1011 const UINT WINED3DPMISCCAPS_LINEPATTERNREP                      = 0x00000004;
1012 const UINT WINED3DPMISCCAPS_CULLNONE                            = 0x00000010;
1013 const UINT WINED3DPMISCCAPS_CULLCW                              = 0x00000020;
1014 const UINT WINED3DPMISCCAPS_CULLCCW                             = 0x00000040;
1015 const UINT WINED3DPMISCCAPS_COLORWRITEENABLE                    = 0x00000080;
1016 const UINT WINED3DPMISCCAPS_CLIPPLANESCALEDPOINTS               = 0x00000100;
1017 const UINT WINED3DPMISCCAPS_CLIPTLVERTS                         = 0x00000200;
1018 const UINT WINED3DPMISCCAPS_TSSARGTEMP                          = 0x00000400;
1019 const UINT WINED3DPMISCCAPS_BLENDOP                             = 0x00000800;
1020 const UINT WINED3DPMISCCAPS_NULLREFERENCE                       = 0x00001000;
1021 const UINT WINED3DPMISCCAPS_INDEPENDENTWRITEMASKS               = 0x00004000;
1022 const UINT WINED3DPMISCCAPS_PERSTAGECONSTANT                    = 0x00008000;
1023 const UINT WINED3DPMISCCAPS_FOGANDSPECULARALPHA                 = 0x00010000;
1024 const UINT WINED3DPMISCCAPS_SEPARATEALPHABLEND                  = 0x00020000;
1025 const UINT WINED3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS             = 0x00040000;
1026 const UINT WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING          = 0x00080000;
1027 const UINT WINED3DPMISCCAPS_FOGVERTEXCLAMPED                    = 0x00100000;
1028
1029 const UINT WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH              = 24;
1030 const UINT WINED3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH              = 0;
1031 const UINT WINED3DPS20_MAX_NUMTEMPS                             = 32;
1032 const UINT WINED3DPS20_MIN_NUMTEMPS                             = 12;
1033 const UINT WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH               = 4;
1034 const UINT WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH               = 0;
1035 const UINT WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS                  = 512;
1036 const UINT WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS                  = 96;
1037
1038 const UINT WINED3DPS20CAPS_ARBITRARYSWIZZLE                     = 0x00000001;
1039 const UINT WINED3DPS20CAPS_GRADIENTINSTRUCTIONS                 = 0x00000002;
1040 const UINT WINED3DPS20CAPS_PREDICATION                          = 0x00000004;
1041 const UINT WINED3DPS20CAPS_NODEPENDENTREADLIMIT                 = 0x00000008;
1042 const UINT WINED3DPS20CAPS_NOTEXINSTRUCTIONLIMIT                = 0x00000010;
1043
1044 const UINT WINED3DPTADDRESSCAPS_WRAP                            = 0x00000001;
1045 const UINT WINED3DPTADDRESSCAPS_MIRROR                          = 0x00000002;
1046 const UINT WINED3DPTADDRESSCAPS_CLAMP                           = 0x00000004;
1047 const UINT WINED3DPTADDRESSCAPS_BORDER                          = 0x00000008;
1048 const UINT WINED3DPTADDRESSCAPS_INDEPENDENTUV                   = 0x00000010;
1049 const UINT WINED3DPTADDRESSCAPS_MIRRORONCE                      = 0x00000020;
1050
1051 const UINT WINED3DSTENCILCAPS_KEEP                              = 0x00000001;
1052 const UINT WINED3DSTENCILCAPS_ZERO                              = 0x00000002;
1053 const UINT WINED3DSTENCILCAPS_REPLACE                           = 0x00000004;
1054 const UINT WINED3DSTENCILCAPS_INCRSAT                           = 0x00000008;
1055 const UINT WINED3DSTENCILCAPS_DECRSAT                           = 0x00000010;
1056 const UINT WINED3DSTENCILCAPS_INVERT                            = 0x00000020;
1057 const UINT WINED3DSTENCILCAPS_INCR                              = 0x00000040;
1058 const UINT WINED3DSTENCILCAPS_DECR                              = 0x00000080;
1059 const UINT WINED3DSTENCILCAPS_TWOSIDED                          = 0x00000100;
1060
1061 const UINT WINED3DTEXOPCAPS_DISABLE                             = 0x00000001;
1062 const UINT WINED3DTEXOPCAPS_SELECTARG1                          = 0x00000002;
1063 const UINT WINED3DTEXOPCAPS_SELECTARG2                          = 0x00000004;
1064 const UINT WINED3DTEXOPCAPS_MODULATE                            = 0x00000008;
1065 const UINT WINED3DTEXOPCAPS_MODULATE2X                          = 0x00000010;
1066 const UINT WINED3DTEXOPCAPS_MODULATE4X                          = 0x00000020;
1067 const UINT WINED3DTEXOPCAPS_ADD                                 = 0x00000040;
1068 const UINT WINED3DTEXOPCAPS_ADDSIGNED                           = 0x00000080;
1069 const UINT WINED3DTEXOPCAPS_ADDSIGNED2X                         = 0x00000100;
1070 const UINT WINED3DTEXOPCAPS_SUBTRACT                            = 0x00000200;
1071 const UINT WINED3DTEXOPCAPS_ADDSMOOTH                           = 0x00000400;
1072 const UINT WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA                   = 0x00000800;
1073 const UINT WINED3DTEXOPCAPS_BLENDTEXTUREALPHA                   = 0x00001000;
1074 const UINT WINED3DTEXOPCAPS_BLENDFACTORALPHA                    = 0x00002000;
1075 const UINT WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM                 = 0x00004000;
1076 const UINT WINED3DTEXOPCAPS_BLENDCURRENTALPHA                   = 0x00008000;
1077 const UINT WINED3DTEXOPCAPS_PREMODULATE                         = 0x00010000;
1078 const UINT WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR              = 0x00020000;
1079 const UINT WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA              = 0x00040000;
1080 const UINT WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR           = 0x00080000;
1081 const UINT WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA           = 0x00100000;
1082 const UINT WINED3DTEXOPCAPS_BUMPENVMAP                          = 0x00200000;
1083 const UINT WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE                 = 0x00400000;
1084 const UINT WINED3DTEXOPCAPS_DOTPRODUCT3                         = 0x00800000;
1085 const UINT WINED3DTEXOPCAPS_MULTIPLYADD                         = 0x01000000;
1086 const UINT WINED3DTEXOPCAPS_LERP                                = 0x02000000;
1087
1088 const UINT WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH              = 24;
1089 const UINT WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH              = 0;
1090 const UINT WINED3DVS20_MAX_NUMTEMPS                             = 32;
1091 const UINT WINED3DVS20_MIN_NUMTEMPS                             = 12;
1092 const UINT WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH               = 4;
1093 const UINT WINED3DVS20_MIN_STATICFLOWCONTROLDEPTH               = 1;
1094
1095 const UINT WINED3DVS20CAPS_PREDICATION                          = 0x00000001;
1096
1097 const UINT WINED3DCAPS2_NO2DDURING3DSCENE                       = 0x00000002;
1098 const UINT WINED3DCAPS2_FULLSCREENGAMMA                         = 0x00020000;
1099 const UINT WINED3DCAPS2_CANRENDERWINDOWED                       = 0x00080000;
1100 const UINT WINED3DCAPS2_CANCALIBRATEGAMMA                       = 0x00100000;
1101 const UINT WINED3DCAPS2_RESERVED                                = 0x02000000;
1102 const UINT WINED3DCAPS2_CANMANAGERESOURCE                       = 0x10000000;
1103 const UINT WINED3DCAPS2_DYNAMICTEXTURES                         = 0x20000000;
1104 const UINT WINED3DCAPS2_CANAUTOGENMIPMAP                        = 0x40000000;
1105
1106 const UINT WINED3DPRASTERCAPS_DITHER                            = 0x00000001;
1107 const UINT WINED3DPRASTERCAPS_ROP2                              = 0x00000002;
1108 const UINT WINED3DPRASTERCAPS_XOR                               = 0x00000004;
1109 const UINT WINED3DPRASTERCAPS_PAT                               = 0x00000008;
1110 const UINT WINED3DPRASTERCAPS_ZTEST                             = 0x00000010;
1111 const UINT WINED3DPRASTERCAPS_SUBPIXEL                          = 0x00000020;
1112 const UINT WINED3DPRASTERCAPS_SUBPIXELX                         = 0x00000040;
1113 const UINT WINED3DPRASTERCAPS_FOGVERTEX                         = 0x00000080;
1114 const UINT WINED3DPRASTERCAPS_FOGTABLE                          = 0x00000100;
1115 const UINT WINED3DPRASTERCAPS_STIPPLE                           = 0x00000200;
1116 const UINT WINED3DPRASTERCAPS_ANTIALIASSORTDEPENDENT            = 0x00000400;
1117 const UINT WINED3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT          = 0x00000800;
1118 const UINT WINED3DPRASTERCAPS_ANTIALIASEDGES                    = 0x00001000;
1119 const UINT WINED3DPRASTERCAPS_MIPMAPLODBIAS                     = 0x00002000;
1120 const UINT WINED3DPRASTERCAPS_ZBIAS                             = 0x00004000;
1121 const UINT WINED3DPRASTERCAPS_ZBUFFERLESSHSR                    = 0x00008000;
1122 const UINT WINED3DPRASTERCAPS_FOGRANGE                          = 0x00010000;
1123 const UINT WINED3DPRASTERCAPS_ANISOTROPY                        = 0x00020000;
1124 const UINT WINED3DPRASTERCAPS_WBUFFER                           = 0x00040000;
1125 const UINT WINED3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT        = 0x00080000;
1126 const UINT WINED3DPRASTERCAPS_WFOG                              = 0x00100000;
1127 const UINT WINED3DPRASTERCAPS_ZFOG                              = 0x00200000;
1128 const UINT WINED3DPRASTERCAPS_COLORPERSPECTIVE                  = 0x00400000;
1129 const UINT WINED3DPRASTERCAPS_SCISSORTEST                       = 0x01000000;
1130 const UINT WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS               = 0x02000000;
1131 const UINT WINED3DPRASTERCAPS_DEPTHBIAS                         = 0x04000000;
1132 const UINT WINED3DPRASTERCAPS_MULTISAMPLE_TOGGLE                = 0x08000000;
1133
1134 const UINT WINED3DPSHADECAPS_COLORFLATMONO                      = 0x00000001;
1135 const UINT WINED3DPSHADECAPS_COLORFLATRGB                       = 0x00000002;
1136 const UINT WINED3DPSHADECAPS_COLORGOURAUDMONO                   = 0x00000004;
1137 const UINT WINED3DPSHADECAPS_COLORGOURAUDRGB                    = 0x00000008;
1138 const UINT WINED3DPSHADECAPS_COLORPHONGMONO                     = 0x00000010;
1139 const UINT WINED3DPSHADECAPS_COLORPHONGRGB                      = 0x00000020;
1140 const UINT WINED3DPSHADECAPS_SPECULARFLATMONO                   = 0x00000040;
1141 const UINT WINED3DPSHADECAPS_SPECULARFLATRGB                    = 0x00000080;
1142 const UINT WINED3DPSHADECAPS_SPECULARGOURAUDMONO                = 0x00000100;
1143 const UINT WINED3DPSHADECAPS_SPECULARGOURAUDRGB                 = 0x00000200;
1144 const UINT WINED3DPSHADECAPS_SPECULARPHONGMONO                  = 0x00000400;
1145 const UINT WINED3DPSHADECAPS_SPECULARPHONGRGB                   = 0x00000800;
1146 const UINT WINED3DPSHADECAPS_ALPHAFLATBLEND                     = 0x00001000;
1147 const UINT WINED3DPSHADECAPS_ALPHAFLATSTIPPLED                  = 0x00002000;
1148 const UINT WINED3DPSHADECAPS_ALPHAGOURAUDBLEND                  = 0x00004000;
1149 const UINT WINED3DPSHADECAPS_ALPHAGOURAUDSTIPPLED               = 0x00008000;
1150 const UINT WINED3DPSHADECAPS_ALPHAPHONGBLEND                    = 0x00010000;
1151 const UINT WINED3DPSHADECAPS_ALPHAPHONGSTIPPLED                 = 0x00020000;
1152 const UINT WINED3DPSHADECAPS_FOGFLAT                            = 0x00040000;
1153 const UINT WINED3DPSHADECAPS_FOGGOURAUD                         = 0x00080000;
1154 const UINT WINED3DPSHADECAPS_FOGPHONG                           = 0x00100000;
1155
1156 const UINT WINED3DPTEXTURECAPS_PERSPECTIVE                      = 0x00000001;
1157 const UINT WINED3DPTEXTURECAPS_POW2                             = 0x00000002;
1158 const UINT WINED3DPTEXTURECAPS_ALPHA                            = 0x00000004;
1159 const UINT WINED3DPTEXTURECAPS_TRANSPARENCY                     = 0x00000008;
1160 const UINT WINED3DPTEXTURECAPS_BORDER                           = 0x00000010;
1161 const UINT WINED3DPTEXTURECAPS_SQUAREONLY                       = 0x00000020;
1162 const UINT WINED3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE         = 0x00000040;
1163 const UINT WINED3DPTEXTURECAPS_ALPHAPALETTE                     = 0x00000080;
1164 const UINT WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL               = 0x00000100;
1165 const UINT WINED3DPTEXTURECAPS_PROJECTED                        = 0x00000400;
1166 const UINT WINED3DPTEXTURECAPS_CUBEMAP                          = 0x00000800;
1167 const UINT WINED3DPTEXTURECAPS_COLORKEYBLEND                    = 0x00001000;
1168 const UINT WINED3DPTEXTURECAPS_VOLUMEMAP                        = 0x00002000;
1169 const UINT WINED3DPTEXTURECAPS_MIPMAP                           = 0x00004000;
1170 const UINT WINED3DPTEXTURECAPS_MIPVOLUMEMAP                     = 0x00008000;
1171 const UINT WINED3DPTEXTURECAPS_MIPCUBEMAP                       = 0x00010000;
1172 const UINT WINED3DPTEXTURECAPS_CUBEMAP_POW2                     = 0x00020000;
1173 const UINT WINED3DPTEXTURECAPS_VOLUMEMAP_POW2                   = 0x00040000;
1174 const UINT WINED3DPTEXTURECAPS_NOPROJECTEDBUMPENV               = 0x00200000;
1175
1176 const UINT WINED3DPTFILTERCAPS_NEAREST                          = 0x00000001;
1177 const UINT WINED3DPTFILTERCAPS_LINEAR                           = 0x00000002;
1178 const UINT WINED3DPTFILTERCAPS_MIPNEAREST                       = 0x00000004;
1179 const UINT WINED3DPTFILTERCAPS_MIPLINEAR                        = 0x00000008;
1180 const UINT WINED3DPTFILTERCAPS_LINEARMIPNEAREST                 = 0x00000010;
1181 const UINT WINED3DPTFILTERCAPS_LINEARMIPLINEAR                  = 0x00000020;
1182 const UINT WINED3DPTFILTERCAPS_MINFPOINT                        = 0x00000100;
1183 const UINT WINED3DPTFILTERCAPS_MINFLINEAR                       = 0x00000200;
1184 const UINT WINED3DPTFILTERCAPS_MINFANISOTROPIC                  = 0x00000400;
1185 const UINT WINED3DPTFILTERCAPS_MIPFPOINT                        = 0x00010000;
1186 const UINT WINED3DPTFILTERCAPS_MIPFLINEAR                       = 0x00020000;
1187 const UINT WINED3DPTFILTERCAPS_MAGFPOINT                        = 0x01000000;
1188 const UINT WINED3DPTFILTERCAPS_MAGFLINEAR                       = 0x02000000;
1189 const UINT WINED3DPTFILTERCAPS_MAGFANISOTROPIC                  = 0x04000000;
1190 const UINT WINED3DPTFILTERCAPS_MAGFPYRAMIDALQUAD                = 0x08000000;
1191 const UINT WINED3DPTFILTERCAPS_MAGFGAUSSIANQUAD                 = 0x10000000;
1192
1193 const UINT WINED3DVTXPCAPS_TEXGEN                               = 0x00000001;
1194 const UINT WINED3DVTXPCAPS_MATERIALSOURCE7                      = 0x00000002;
1195 const UINT WINED3DVTXPCAPS_VERTEXFOG                            = 0x00000004;
1196 const UINT WINED3DVTXPCAPS_DIRECTIONALLIGHTS                    = 0x00000008;
1197 const UINT WINED3DVTXPCAPS_POSITIONALLIGHTS                     = 0x00000010;
1198 const UINT WINED3DVTXPCAPS_LOCALVIEWER                          = 0x00000020;
1199 const UINT WINED3DVTXPCAPS_TWEENING                             = 0x00000040;
1200 const UINT WINED3DVTXPCAPS_TEXGEN_SPHEREMAP                     = 0x00000100;
1201 const UINT WINED3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER             = 0x00000200;
1202
1203 const UINT WINED3DCURSORCAPS_COLOR                              = 0x00000001;
1204 const UINT WINED3DCURSORCAPS_LOWRES                             = 0x00000002;
1205
1206 const UINT WINED3DDEVCAPS_FLOATTLVERTEX                         = 0x00000001;
1207 const UINT WINED3DDEVCAPS_SORTINCREASINGZ                       = 0x00000002;
1208 const UINT WINED3DDEVCAPS_SORTDECREASINGZ                       = 0X00000004;
1209 const UINT WINED3DDEVCAPS_SORTEXACT                             = 0x00000008;
1210 const UINT WINED3DDEVCAPS_EXECUTESYSTEMMEMORY                   = 0x00000010;
1211 const UINT WINED3DDEVCAPS_EXECUTEVIDEOMEMORY                    = 0x00000020;
1212 const UINT WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY                  = 0x00000040;
1213 const UINT WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY                   = 0x00000080;
1214 const UINT WINED3DDEVCAPS_TEXTURESYSTEMMEMORY                   = 0x00000100;
1215 const UINT WINED3DDEVCAPS_TEXTUREVIDEOMEMORY                    = 0x00000200;
1216 const UINT WINED3DDEVCAPS_DRAWPRIMTLVERTEX                      = 0x00000400;
1217 const UINT WINED3DDEVCAPS_CANRENDERAFTERFLIP                    = 0x00000800;
1218 const UINT WINED3DDEVCAPS_TEXTURENONLOCALVIDMEM                 = 0x00001000;
1219 const UINT WINED3DDEVCAPS_DRAWPRIMITIVES2                       = 0x00002000;
1220 const UINT WINED3DDEVCAPS_SEPARATETEXTUREMEMORIES               = 0x00004000;
1221 const UINT WINED3DDEVCAPS_DRAWPRIMITIVES2EX                     = 0x00008000;
1222 const UINT WINED3DDEVCAPS_HWTRANSFORMANDLIGHT                   = 0x00010000;
1223 const UINT WINED3DDEVCAPS_CANBLTSYSTONONLOCAL                   = 0x00020000;
1224 const UINT WINED3DDEVCAPS_HWRASTERIZATION                       = 0x00080000;
1225 const UINT WINED3DDEVCAPS_PUREDEVICE                            = 0x00100000;
1226 const UINT WINED3DDEVCAPS_QUINTICRTPATCHES                      = 0x00200000;
1227 const UINT WINED3DDEVCAPS_RTPATCHES                             = 0x00400000;
1228 const UINT WINED3DDEVCAPS_RTPATCHHANDLEZERO                     = 0x00800000;
1229 const UINT WINED3DDEVCAPS_NPATCHES                              = 0x01000000;
1230
1231 /* dwDDFX */
1232 /* arithmetic stretching along y axis */
1233 const UINT WINEDDBLTFX_ARITHSTRETCHY                            = 0x00000001;
1234 /* mirror on y axis */
1235 const UINT WINEDDBLTFX_MIRRORLEFTRIGHT                          = 0x00000002;
1236 /* mirror on x axis */
1237 const UINT WINEDDBLTFX_MIRRORUPDOWN                             = 0x00000004;
1238 /* do not tear */
1239 const UINT WINEDDBLTFX_NOTEARING                                = 0x00000008;
1240 /* 180 degrees clockwise rotation */
1241 const UINT WINEDDBLTFX_ROTATE180                                = 0x00000010;
1242 /* 270 degrees clockwise rotation */
1243 const UINT WINEDDBLTFX_ROTATE270                                = 0x00000020;
1244 /* 90 degrees clockwise rotation */
1245 const UINT WINEDDBLTFX_ROTATE90                                 = 0x00000040;
1246 /* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
1247 const UINT WINEDDBLTFX_ZBUFFERRANGE                             = 0x00000080;
1248 /* add dwZBufferBaseDest to every source z value before compare */
1249 const UINT WINEDDBLTFX_ZBUFFERBASEDEST                          = 0x00000100;
1250
1251 /* dwFlags for Blt* */
1252 const UINT WINEDDBLT_ALPHADEST                                  = 0x00000001;
1253 const UINT WINEDDBLT_ALPHADESTCONSTOVERRIDE                     = 0x00000002;
1254 const UINT WINEDDBLT_ALPHADESTNEG                               = 0x00000004;
1255 const UINT WINEDDBLT_ALPHADESTSURFACEOVERRIDE                   = 0x00000008;
1256 const UINT WINEDDBLT_ALPHAEDGEBLEND                             = 0x00000010;
1257 const UINT WINEDDBLT_ALPHASRC                                   = 0x00000020;
1258 const UINT WINEDDBLT_ALPHASRCCONSTOVERRIDE                      = 0x00000040;
1259 const UINT WINEDDBLT_ALPHASRCNEG                                = 0x00000080;
1260 const UINT WINEDDBLT_ALPHASRCSURFACEOVERRIDE                    = 0x00000100;
1261 const UINT WINEDDBLT_ASYNC                                      = 0x00000200;
1262 const UINT WINEDDBLT_COLORFILL                                  = 0x00000400;
1263 const UINT WINEDDBLT_DDFX                                       = 0x00000800;
1264 const UINT WINEDDBLT_DDROPS                                     = 0x00001000;
1265 const UINT WINEDDBLT_KEYDEST                                    = 0x00002000;
1266 const UINT WINEDDBLT_KEYDESTOVERRIDE                            = 0x00004000;
1267 const UINT WINEDDBLT_KEYSRC                                     = 0x00008000;
1268 const UINT WINEDDBLT_KEYSRCOVERRIDE                             = 0x00010000;
1269 const UINT WINEDDBLT_ROP                                        = 0x00020000;
1270 const UINT WINEDDBLT_ROTATIONANGLE                              = 0x00040000;
1271 const UINT WINEDDBLT_ZBUFFER                                    = 0x00080000;
1272 const UINT WINEDDBLT_ZBUFFERDESTCONSTOVERRIDE                   = 0x00100000;
1273 const UINT WINEDDBLT_ZBUFFERDESTOVERRIDE                        = 0x00200000;
1274 const UINT WINEDDBLT_ZBUFFERSRCCONSTOVERRIDE                    = 0x00400000;
1275 const UINT WINEDDBLT_ZBUFFERSRCOVERRIDE                         = 0x00800000;
1276 const UINT WINEDDBLT_WAIT                                       = 0x01000000;
1277 const UINT WINEDDBLT_DEPTHFILL                                  = 0x02000000;
1278 const UINT WINEDDBLT_DONOTWAIT                                  = 0x08000000;
1279
1280 /* dwTrans for BltFast */
1281 const UINT WINEDDBLTFAST_NOCOLORKEY                             = 0x00000000;
1282 const UINT WINEDDBLTFAST_SRCCOLORKEY                            = 0x00000001;
1283 const UINT WINEDDBLTFAST_DESTCOLORKEY                           = 0x00000002;
1284 const UINT WINEDDBLTFAST_WAIT                                   = 0x00000010;
1285 const UINT WINEDDBLTFAST_DONOTWAIT                              = 0x00000020;
1286
1287 /* DDSURFACEDESC.dwFlags */
1288 const UINT WINEDDSD_CAPS                                        = 0x00000001;
1289 const UINT WINEDDSD_HEIGHT                                      = 0x00000002;
1290 const UINT WINEDDSD_WIDTH                                       = 0x00000004;
1291 const UINT WINEDDSD_PITCH                                       = 0x00000008;
1292 const UINT WINEDDSD_BACKBUFFERCOUNT                             = 0x00000020;
1293 const UINT WINEDDSD_ZBUFFERBITDEPTH                             = 0x00000040;
1294 const UINT WINEDDSD_ALPHABITDEPTH                               = 0x00000080;
1295 const UINT WINEDDSD_LPSURFACE                                   = 0x00000800;
1296 const UINT WINEDDSD_PIXELFORMAT                                 = 0x00001000;
1297 const UINT WINEDDSD_CKDESTOVERLAY                               = 0x00002000;
1298 const UINT WINEDDSD_CKDESTBLT                                   = 0x00004000;
1299 const UINT WINEDDSD_CKSRCOVERLAY                                = 0x00008000;
1300 const UINT WINEDDSD_CKSRCBLT                                    = 0x00010000;
1301 const UINT WINEDDSD_MIPMAPCOUNT                                 = 0x00020000;
1302 const UINT WINEDDSD_REFRESHRATE                                 = 0x00040000;
1303 const UINT WINEDDSD_LINEARSIZE                                  = 0x00080000;
1304 const UINT WINEDDSD_TEXTURESTAGE                                = 0x00100000;
1305 const UINT WINEDDSD_FVF                                         = 0x00200000;
1306 const UINT WINEDDSD_SRCVBHANDLE                                 = 0x00400000;
1307 const UINT WINEDDSD_ALL                                         = 0x007ff9ee;
1308
1309 /* Set/Get Colour Key Flags */
1310 const UINT WINEDDCKEY_COLORSPACE                                = 0x00000001; /* Struct is single colour space */
1311 const UINT WINEDDCKEY_DESTBLT                                   = 0x00000002; /* To be used as dest for blt */
1312 const UINT WINEDDCKEY_DESTOVERLAY                               = 0x00000004; /* To be used as dest for CK overlays */
1313 const UINT WINEDDCKEY_SRCBLT                                    = 0x00000008; /* To be used as src for blt */
1314 const UINT WINEDDCKEY_SRCOVERLAY                                = 0x00000010; /* To be used as src for CK overlays */
1315
1316 /* dwFlags for GetBltStatus */
1317 const UINT WINEDDGBS_CANBLT                                     = 0x00000001;
1318 const UINT WINEDDGBS_ISBLTDONE                                  = 0x00000002;
1319
1320 /* dwFlags for GetFlipStatus */
1321 const UINT WINEDDGFS_CANFLIP                                    = 0x00000001;
1322 const UINT WINEDDGFS_ISFLIPDONE                                 = 0x00000002;
1323
1324 /* dwFlags for Flip */
1325 const UINT WINEDDFLIP_WAIT                                      = 0x00000001;
1326 const UINT WINEDDFLIP_EVEN                                      = 0x00000002; /* only valid for overlay */
1327 const UINT WINEDDFLIP_ODD                                       = 0x00000004; /* only valid for overlay */
1328 const UINT WINEDDFLIP_NOVSYNC                                   = 0x00000008;
1329 const UINT WINEDDFLIP_STEREO                                    = 0x00000010;
1330 const UINT WINEDDFLIP_DONOTWAIT                                 = 0x00000020;
1331 const UINT WINEDDFLIP_INTERVAL2                                 = 0x02000000;
1332 const UINT WINEDDFLIP_INTERVAL3                                 = 0x03000000;
1333 const UINT WINEDDFLIP_INTERVAL4                                 = 0x04000000;
1334
1335 const UINT WINEDDOVER_ALPHADEST                                 = 0x00000001;
1336 const UINT WINEDDOVER_ALPHADESTCONSTOVERRIDE                    = 0x00000002;
1337 const UINT WINEDDOVER_ALPHADESTNEG                              = 0x00000004;
1338 const UINT WINEDDOVER_ALPHADESTSURFACEOVERRIDE                  = 0x00000008;
1339 const UINT WINEDDOVER_ALPHAEDGEBLEND                            = 0x00000010;
1340 const UINT WINEDDOVER_ALPHASRC                                  = 0x00000020;
1341 const UINT WINEDDOVER_ALPHASRCCONSTOVERRIDE                     = 0x00000040;
1342 const UINT WINEDDOVER_ALPHASRCNEG                               = 0x00000080;
1343 const UINT WINEDDOVER_ALPHASRCSURFACEOVERRIDE                   = 0x00000100;
1344 const UINT WINEDDOVER_HIDE                                      = 0x00000200;
1345 const UINT WINEDDOVER_KEYDEST                                   = 0x00000400;
1346 const UINT WINEDDOVER_KEYDESTOVERRIDE                           = 0x00000800;
1347 const UINT WINEDDOVER_KEYSRC                                    = 0x00001000;
1348 const UINT WINEDDOVER_KEYSRCOVERRIDE                            = 0x00002000;
1349 const UINT WINEDDOVER_SHOW                                      = 0x00004000;
1350 const UINT WINEDDOVER_ADDDIRTYRECT                              = 0x00008000;
1351 const UINT WINEDDOVER_REFRESHDIRTYRECTS                         = 0x00010000;
1352 const UINT WINEDDOVER_REFRESHALL                                = 0x00020000;
1353 const UINT WINEDDOVER_DDFX                                      = 0x00080000;
1354 const UINT WINEDDOVER_AUTOFLIP                                  = 0x00100000;
1355 const UINT WINEDDOVER_BOB                                       = 0x00200000;
1356 const UINT WINEDDOVER_OVERRIDEBOBWEAVE                          = 0x00400000;
1357 const UINT WINEDDOVER_INTERLEAVED                               = 0x00800000;
1358
1359 /* DirectDraw Caps */
1360 const UINT WINEDDSCAPS_RESERVED1                                = 0x00000001;
1361 const UINT WINEDDSCAPS_ALPHA                                    = 0x00000002;
1362 const UINT WINEDDSCAPS_BACKBUFFER                               = 0x00000004;
1363 const UINT WINEDDSCAPS_COMPLEX                                  = 0x00000008;
1364 const UINT WINEDDSCAPS_FLIP                                     = 0x00000010;
1365 const UINT WINEDDSCAPS_FRONTBUFFER                              = 0x00000020;
1366 const UINT WINEDDSCAPS_OFFSCREENPLAIN                           = 0x00000040;
1367 const UINT WINEDDSCAPS_OVERLAY                                  = 0x00000080;
1368 const UINT WINEDDSCAPS_PALETTE                                  = 0x00000100;
1369 const UINT WINEDDSCAPS_PRIMARYSURFACE                           = 0x00000200;
1370 const UINT WINEDDSCAPS_PRIMARYSURFACELEFT                       = 0x00000400;
1371 const UINT WINEDDSCAPS_SYSTEMMEMORY                             = 0x00000800;
1372 const UINT WINEDDSCAPS_TEXTURE                                  = 0x00001000;
1373 const UINT WINEDDSCAPS_3DDEVICE                                 = 0x00002000;
1374 const UINT WINEDDSCAPS_VIDEOMEMORY                              = 0x00004000;
1375 const UINT WINEDDSCAPS_VISIBLE                                  = 0x00008000;
1376 const UINT WINEDDSCAPS_WRITEONLY                                = 0x00010000;
1377 const UINT WINEDDSCAPS_ZBUFFER                                  = 0x00020000;
1378 const UINT WINEDDSCAPS_OWNDC                                    = 0x00040000;
1379 const UINT WINEDDSCAPS_LIVEVIDEO                                = 0x00080000;
1380 const UINT WINEDDSCAPS_HWCODEC                                  = 0x00100000;
1381 const UINT WINEDDSCAPS_MODEX                                    = 0x00200000;
1382 const UINT WINEDDSCAPS_MIPMAP                                   = 0x00400000;
1383 const UINT WINEDDSCAPS_RESERVED2                                = 0x00800000;
1384 const UINT WINEDDSCAPS_ALLOCONLOAD                              = 0x04000000;
1385 const UINT WINEDDSCAPS_VIDEOPORT                                = 0x08000000;
1386 const UINT WINEDDSCAPS_LOCALVIDMEM                              = 0x10000000;
1387 const UINT WINEDDSCAPS_NONLOCALVIDMEM                           = 0x20000000;
1388 const UINT WINEDDSCAPS_STANDARDVGAMODE                          = 0x40000000;
1389 const UINT WINEDDSCAPS_OPTIMIZED                                = 0x80000000;
1390
1391 const UINT WINEDDCKEYCAPS_DESTBLT                               = 0x00000001;
1392 const UINT WINEDDCKEYCAPS_DESTBLTCLRSPACE                       = 0x00000002;
1393 const UINT WINEDDCKEYCAPS_DESTBLTCLRSPACEYUV                    = 0x00000004;
1394 const UINT WINEDDCKEYCAPS_DESTBLTYUV                            = 0x00000008;
1395 const UINT WINEDDCKEYCAPS_DESTOVERLAY                           = 0x00000010;
1396 const UINT WINEDDCKEYCAPS_DESTOVERLAYCLRSPACE                   = 0x00000020;
1397 const UINT WINEDDCKEYCAPS_DESTOVERLAYCLRSPACEYUV                = 0x00000040;
1398 const UINT WINEDDCKEYCAPS_DESTOVERLAYONEACTIVE                  = 0x00000080;
1399 const UINT WINEDDCKEYCAPS_DESTOVERLAYYUV                        = 0x00000100;
1400 const UINT WINEDDCKEYCAPS_SRCBLT                                = 0x00000200;
1401 const UINT WINEDDCKEYCAPS_SRCBLTCLRSPACE                        = 0x00000400;
1402 const UINT WINEDDCKEYCAPS_SRCBLTCLRSPACEYUV                     = 0x00000800;
1403 const UINT WINEDDCKEYCAPS_SRCBLTYUV                             = 0x00001000;
1404 const UINT WINEDDCKEYCAPS_SRCOVERLAY                            = 0x00002000;
1405 const UINT WINEDDCKEYCAPS_SRCOVERLAYCLRSPACE                    = 0x00004000;
1406 const UINT WINEDDCKEYCAPS_SRCOVERLAYCLRSPACEYUV                 = 0x00008000;
1407 const UINT WINEDDCKEYCAPS_SRCOVERLAYONEACTIVE                   = 0x00010000;
1408 const UINT WINEDDCKEYCAPS_SRCOVERLAYYUV                         = 0x00020000;
1409 const UINT WINEDDCKEYCAPS_NOCOSTOVERLAY                         = 0x00040000;
1410
1411 const UINT WINEDDFXCAPS_BLTALPHA                                = 0x00000001;
1412 const UINT WINEDDFXCAPS_OVERLAYALPHA                            = 0x00000004;
1413 const UINT WINEDDFXCAPS_BLTARITHSTRETCHYN                       = 0x00000010;
1414 const UINT WINEDDFXCAPS_BLTARITHSTRETCHY                        = 0x00000020;
1415 const UINT WINEDDFXCAPS_BLTMIRRORLEFTRIGHT                      = 0x00000040;
1416 const UINT WINEDDFXCAPS_BLTMIRRORUPDOWN                         = 0x00000080;
1417 const UINT WINEDDFXCAPS_BLTROTATION                             = 0x00000100;
1418 const UINT WINEDDFXCAPS_BLTROTATION90                           = 0x00000200;
1419 const UINT WINEDDFXCAPS_BLTSHRINKX                              = 0x00000400;
1420 const UINT WINEDDFXCAPS_BLTSHRINKXN                             = 0x00000800;
1421 const UINT WINEDDFXCAPS_BLTSHRINKY                              = 0x00001000;
1422 const UINT WINEDDFXCAPS_BLTSHRINKYN                             = 0x00002000;
1423 const UINT WINEDDFXCAPS_BLTSTRETCHX                             = 0x00004000;
1424 const UINT WINEDDFXCAPS_BLTSTRETCHXN                            = 0x00008000;
1425 const UINT WINEDDFXCAPS_BLTSTRETCHY                             = 0x00010000;
1426 const UINT WINEDDFXCAPS_BLTSTRETCHYN                            = 0x00020000;
1427 const UINT WINEDDFXCAPS_OVERLAYARITHSTRETCHY                    = 0x00040000;
1428 const UINT WINEDDFXCAPS_OVERLAYARITHSTRETCHYN                   = 0x00000008;
1429 const UINT WINEDDFXCAPS_OVERLAYSHRINKX                          = 0x00080000;
1430 const UINT WINEDDFXCAPS_OVERLAYSHRINKXN                         = 0x00100000;
1431 const UINT WINEDDFXCAPS_OVERLAYSHRINKY                          = 0x00200000;
1432 const UINT WINEDDFXCAPS_OVERLAYSHRINKYN                         = 0x00400000;
1433 const UINT WINEDDFXCAPS_OVERLAYSTRETCHX                         = 0x00800000;
1434 const UINT WINEDDFXCAPS_OVERLAYSTRETCHXN                        = 0x01000000;
1435 const UINT WINEDDFXCAPS_OVERLAYSTRETCHY                         = 0x02000000;
1436 const UINT WINEDDFXCAPS_OVERLAYSTRETCHYN                        = 0x04000000;
1437 const UINT WINEDDFXCAPS_OVERLAYMIRRORLEFTRIGHT                  = 0x08000000;
1438 const UINT WINEDDFXCAPS_OVERLAYMIRRORUPDOWN                     = 0x10000000;
1439
1440 const UINT WINEDDCAPS_3D                                        = 0x00000001;
1441 const UINT WINEDDCAPS_ALIGNBOUNDARYDEST                         = 0x00000002;
1442 const UINT WINEDDCAPS_ALIGNSIZEDEST                             = 0x00000004;
1443 const UINT WINEDDCAPS_ALIGNBOUNDARYSRC                          = 0x00000008;
1444 const UINT WINEDDCAPS_ALIGNSIZESRC                              = 0x00000010;
1445 const UINT WINEDDCAPS_ALIGNSTRIDE                               = 0x00000020;
1446 const UINT WINEDDCAPS_BLT                                       = 0x00000040;
1447 const UINT WINEDDCAPS_BLTQUEUE                                  = 0x00000080;
1448 const UINT WINEDDCAPS_BLTFOURCC                                 = 0x00000100;
1449 const UINT WINEDDCAPS_BLTSTRETCH                                = 0x00000200;
1450 const UINT WINEDDCAPS_GDI                                       = 0x00000400;
1451 const UINT WINEDDCAPS_OVERLAY                                   = 0x00000800;
1452 const UINT WINEDDCAPS_OVERLAYCANTCLIP                           = 0x00001000;
1453 const UINT WINEDDCAPS_OVERLAYFOURCC                             = 0x00002000;
1454 const UINT WINEDDCAPS_OVERLAYSTRETCH                            = 0x00004000;
1455 const UINT WINEDDCAPS_PALETTE                                   = 0x00008000;
1456 const UINT WINEDDCAPS_PALETTEVSYNC                              = 0x00010000;
1457 const UINT WINEDDCAPS_READSCANLINE                              = 0x00020000;
1458 const UINT WINEDDCAPS_STEREOVIEW                                = 0x00040000;
1459 const UINT WINEDDCAPS_VBI                                       = 0x00080000;
1460 const UINT WINEDDCAPS_ZBLTS                                     = 0x00100000;
1461 const UINT WINEDDCAPS_ZOVERLAYS                                 = 0x00200000;
1462 const UINT WINEDDCAPS_COLORKEY                                  = 0x00400000;
1463 const UINT WINEDDCAPS_ALPHA                                     = 0x00800000;
1464 const UINT WINEDDCAPS_COLORKEYHWASSIST                          = 0x01000000;
1465 const UINT WINEDDCAPS_NOHARDWARE                                = 0x02000000;
1466 const UINT WINEDDCAPS_BLTCOLORFILL                              = 0x04000000;
1467 const UINT WINEDDCAPS_BANKSWITCHED                              = 0x08000000;
1468 const UINT WINEDDCAPS_BLTDEPTHFILL                              = 0x10000000;
1469 const UINT WINEDDCAPS_CANCLIP                                   = 0x20000000;
1470 const UINT WINEDDCAPS_CANCLIPSTRETCHED                          = 0x40000000;
1471 const UINT WINEDDCAPS_CANBLTSYSMEM                              = 0x80000000;
1472
1473 const UINT WINEDDCAPS2_CERTIFIED                                = 0x00000001;
1474 const UINT WINEDDCAPS2_NO2DDURING3DSCENE                        = 0x00000002;
1475 const UINT WINEDDCAPS2_VIDEOPORT                                = 0x00000004;
1476 const UINT WINEDDCAPS2_AUTOFLIPOVERLAY                          = 0x00000008;
1477 const UINT WINEDDCAPS2_CANBOBINTERLEAVED                        = 0x00000010;
1478 const UINT WINEDDCAPS2_CANBOBNONINTERLEAVED                     = 0x00000020;
1479 const UINT WINEDDCAPS2_COLORCONTROLOVERLAY                      = 0x00000040;
1480 const UINT WINEDDCAPS2_COLORCONTROLPRIMARY                      = 0x00000080;
1481 const UINT WINEDDCAPS2_CANDROPZ16BIT                            = 0x00000100;
1482 const UINT WINEDDCAPS2_NONLOCALVIDMEM                           = 0x00000200;
1483 const UINT WINEDDCAPS2_NONLOCALVIDMEMCAPS                       = 0x00000400;
1484 const UINT WINEDDCAPS2_NOPAGELOCKREQUIRED                       = 0x00000800;
1485 const UINT WINEDDCAPS2_WIDESURFACES                             = 0x00001000;
1486 const UINT WINEDDCAPS2_CANFLIPODDEVEN                           = 0x00002000;
1487 const UINT WINEDDCAPS2_CANBOBHARDWARE                           = 0x00004000;
1488 const UINT WINEDDCAPS2_COPYFOURCC                               = 0x00008000;
1489 const UINT WINEDDCAPS2_PRIMARYGAMMA                             = 0x00020000;
1490 const UINT WINEDDCAPS2_CANRENDERWINDOWED                        = 0x00080000;
1491 const UINT WINEDDCAPS2_CANCALIBRATEGAMMA                        = 0x00100000;
1492 const UINT WINEDDCAPS2_FLIPINTERVAL                             = 0x00200000;
1493 const UINT WINEDDCAPS2_FLIPNOVSYNC                              = 0x00400000;
1494 const UINT WINEDDCAPS2_CANMANAGETEXTURE                         = 0x00800000;
1495 const UINT WINEDDCAPS2_TEXMANINNONLOCALVIDMEM                   = 0x01000000;
1496 const UINT WINEDDCAPS2_STEREO                                   = 0x02000000;
1497 const UINT WINEDDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL              = 0x04000000;
1498
1499 /* DDCAPS.d */
1500 const UINT WINEDDPCAPS_4BIT                                     = 0x00000001;
1501 const UINT WINEDDPCAPS_8BITENTRIES                              = 0x00000002;
1502 const UINT WINEDDPCAPS_8BIT                                     = 0x00000004;
1503 const UINT WINEDDPCAPS_INITIALIZE                               = 0x00000008;
1504 const UINT WINEDDPCAPS_PRIMARYSURFACE                           = 0x00000010;
1505 const UINT WINEDDPCAPS_PRIMARYSURFACELEFT                       = 0x00000020;
1506 const UINT WINEDDPCAPS_ALLOW256                                 = 0x00000040;
1507 const UINT WINEDDPCAPS_VSYNC                                    = 0x00000080;
1508 const UINT WINEDDPCAPS_1BIT                                     = 0x00000100;
1509 const UINT WINEDDPCAPS_2BIT                                     = 0x00000200;
1510 const UINT WINEDDPCAPS_ALPHA                                    = 0x00000400;
1511
1512 typedef struct _WINED3DDISPLAYMODE
1513 {
1514     UINT Width;
1515     UINT Height;
1516     UINT RefreshRate;
1517     WINED3DFORMAT Format;
1518 } WINED3DDISPLAYMODE;
1519
1520 typedef struct _WINED3DCOLORVALUE
1521 {
1522     float r;
1523     float g;
1524     float b;
1525     float a;
1526 } WINED3DCOLORVALUE;
1527
1528 typedef struct _WINED3DVECTOR
1529 {
1530     float x;
1531     float y;
1532     float z;
1533 } WINED3DVECTOR;
1534
1535 typedef struct _WINED3DMATRIX
1536 {
1537     union
1538     {
1539         struct
1540         {
1541             float _11, _12, _13, _14;
1542             float _21, _22, _23, _24;
1543             float _31, _32, _33, _34;
1544             float _41, _42, _43, _44;
1545         } DUMMYSTRUCTNAME;
1546         float m[4][4];
1547     } DUMMYUNIONNAME;
1548 } WINED3DMATRIX;
1549
1550 typedef struct _WINED3DRECT
1551 {
1552     LONG x1;
1553     LONG y1;
1554     LONG x2;
1555     LONG y2;
1556 } WINED3DRECT;
1557
1558 typedef struct _WINED3DLIGHT
1559 {
1560     WINED3DLIGHTTYPE Type;
1561     WINED3DCOLORVALUE Diffuse;
1562     WINED3DCOLORVALUE Specular;
1563     WINED3DCOLORVALUE Ambient;
1564     WINED3DVECTOR Position;
1565     WINED3DVECTOR Direction;
1566     float Range;
1567     float Falloff;
1568     float Attenuation0;
1569     float Attenuation1;
1570     float Attenuation2;
1571     float Theta;
1572     float Phi;
1573 } WINED3DLIGHT;
1574
1575 typedef struct _WINED3DMATERIAL
1576 {
1577     WINED3DCOLORVALUE Diffuse;
1578     WINED3DCOLORVALUE Ambient;
1579     WINED3DCOLORVALUE Specular;
1580     WINED3DCOLORVALUE Emissive;
1581     float Power;
1582 } WINED3DMATERIAL;
1583
1584 typedef struct _WINED3DVIEWPORT
1585 {
1586     DWORD X;
1587     DWORD Y;
1588     DWORD Width;
1589     DWORD Height;
1590     float MinZ;
1591     float MaxZ;
1592 } WINED3DVIEWPORT;
1593
1594 typedef struct _WINED3DGAMMARAMP
1595 {
1596     WORD red[256];
1597     WORD green[256];
1598     WORD blue[256];
1599 } WINED3DGAMMARAMP;
1600
1601 typedef struct _WINED3DLINEPATTERN
1602 {
1603     WORD wRepeatFactor;
1604     WORD wLinePattern;
1605 } WINED3DLINEPATTERN;
1606
1607 typedef struct _WINEDD3DRECTPATCH_INFO
1608 {
1609     UINT StartVertexOffsetWidth;
1610     UINT StartVertexOffsetHeight;
1611     UINT Width;
1612     UINT Height;
1613     UINT Stride;
1614     WINED3DBASISTYPE Basis;
1615     WINED3DDEGREETYPE Degree;
1616 } WINED3DRECTPATCH_INFO;
1617
1618 typedef struct _WINED3DTRIPATCH_INFO
1619 {
1620     UINT StartVertexOffset;
1621     UINT NumVertices;
1622     WINED3DBASISTYPE Basis;
1623     WINED3DDEGREETYPE Degree;
1624 } WINED3DTRIPATCH_INFO;
1625
1626 typedef struct _WINED3DADAPTER_IDENTIFIER
1627 {
1628     char *Driver;
1629     char *Description;
1630     char *DeviceName;
1631     LARGE_INTEGER *DriverVersion;
1632     DWORD *VendorId;
1633     DWORD *DeviceId;
1634     DWORD *SubSysId;
1635     DWORD *Revision;
1636     GUID *DeviceIdentifier;
1637     DWORD *WHQLLevel;
1638 } WINED3DADAPTER_IDENTIFIER;
1639
1640 typedef struct _WINED3DPRESENT_PARAMETERS
1641 {
1642     UINT BackBufferWidth;
1643     UINT BackBufferHeight;
1644     WINED3DFORMAT BackBufferFormat;
1645     UINT BackBufferCount;
1646     WINED3DMULTISAMPLE_TYPE MultiSampleType;
1647     DWORD MultiSampleQuality;
1648     WINED3DSWAPEFFECT SwapEffect;
1649     HWND hDeviceWindow;
1650     BOOL Windowed;
1651     BOOL EnableAutoDepthStencil;
1652     WINED3DFORMAT AutoDepthStencilFormat;
1653     DWORD Flags;
1654     UINT FullScreen_RefreshRateInHz;
1655     UINT PresentationInterval;
1656     BOOL AutoRestoreDisplayMode;
1657 } WINED3DPRESENT_PARAMETERS;
1658
1659 typedef struct _WINED3DSURFACE_DESC
1660 {
1661     WINED3DFORMAT *Format;
1662     WINED3DRESOURCETYPE *Type;
1663     DWORD *Usage;
1664     WINED3DPOOL *Pool;
1665     UINT *Size;
1666     WINED3DMULTISAMPLE_TYPE *MultiSampleType;
1667     DWORD *MultiSampleQuality;
1668     UINT *Width;
1669     UINT *Height;
1670 } WINED3DSURFACE_DESC;
1671
1672 typedef struct _WINED3DVOLUME_DESC
1673 {
1674     WINED3DFORMAT *Format;
1675     WINED3DRESOURCETYPE *Type;
1676     DWORD *Usage;
1677     WINED3DPOOL *Pool;
1678     UINT *Size;
1679     UINT *Width;
1680     UINT *Height;
1681     UINT *Depth;
1682 } WINED3DVOLUME_DESC;
1683
1684 typedef struct _WINED3DCLIPSTATUS
1685 {
1686    DWORD ClipUnion;
1687    DWORD ClipIntersection;
1688 } WINED3DCLIPSTATUS;
1689
1690 typedef struct _WINED3DVERTEXELEMENT
1691 {
1692   WORD Stream;
1693   WORD Offset;
1694   BYTE Type;
1695   BYTE Method;
1696   BYTE Usage;
1697   BYTE UsageIndex;
1698   int Reg; /* DirectX 8 */
1699 } WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
1700
1701 typedef struct _WINED3DDEVICE_CREATION_PARAMETERS
1702 {
1703     UINT AdapterOrdinal;
1704     WINED3DDEVTYPE DeviceType;
1705     HWND hFocusWindow;
1706     DWORD BehaviorFlags;
1707 } WINED3DDEVICE_CREATION_PARAMETERS;
1708
1709 typedef struct _WINED3DDEVINFO_BANDWIDTHTIMINGS
1710 {
1711     float MaxBandwidthUtilized;
1712     float FrontEndUploadMemoryUtilizedPercent;
1713     float VertexRateUtilizedPercent;
1714     float TriangleSetupRateUtilizedPercent;
1715     float FillRateUtilizedPercent;
1716 } WINED3DDEVINFO_BANDWIDTHTIMINGS;
1717
1718 typedef struct _WINED3DDEVINFO_CACHEUTILIZATION
1719 {
1720     float TextureCacheHitRate;
1721     float PostTransformVertexCacheHitRate;
1722 } WINED3DDEVINFO_CACHEUTILIZATION;
1723
1724 typedef struct _WINED3DDEVINFO_INTERFACETIMINGS
1725 {
1726     float WaitingForGPUToUseApplicationResourceTimePercent;
1727     float WaitingForGPUToAcceptMoreCommandsTimePercent;
1728     float WaitingForGPUToStayWithinLatencyTimePercent;
1729     float WaitingForGPUExclusiveResourceTimePercent;
1730     float WaitingForGPUOtherTimePercent;
1731 } WINED3DDEVINFO_INTERFACETIMINGS;
1732
1733 typedef struct _WINED3DDEVINFO_PIPELINETIMINGS
1734 {
1735     float VertexProcessingTimePercent;
1736     float PixelProcessingTimePercent;
1737     float OtherGPUProcessingTimePercent;
1738     float GPUIdleTimePercent;
1739 } WINED3DDEVINFO_PIPELINETIMINGS;
1740
1741 typedef struct _WINED3DDEVINFO_STAGETIMINGS
1742 {
1743     float MemoryProcessingPercent;
1744     float ComputationProcessingPercent;
1745 } WINED3DDEVINFO_STAGETIMINGS;
1746
1747 typedef struct _WINED3DRASTER_STATUS
1748 {
1749     BOOL InVBlank;
1750     UINT ScanLine;
1751 } WINED3DRASTER_STATUS;
1752
1753 typedef struct WINED3DRESOURCESTATS
1754 {
1755     BOOL bThrashing;
1756     DWORD ApproxBytesDownloaded;
1757     DWORD NumEvicts;
1758     DWORD NumVidCreates;
1759     DWORD LastPri;
1760     DWORD NumUsed;
1761     DWORD NumUsedInVidMem;
1762     DWORD WorkingSet;
1763     DWORD WorkingSetBytes;
1764     DWORD TotalManaged;
1765     DWORD TotalBytes;
1766 } WINED3DRESOURCESTATS;
1767
1768 typedef struct _WINED3DDEVINFO_RESOURCEMANAGER
1769 {
1770     WINED3DRESOURCESTATS stats[WINED3DRTYPECOUNT];
1771 } WINED3DDEVINFO_RESOURCEMANAGER;
1772
1773 typedef struct _WINED3DDEVINFO_VERTEXSTATS
1774 {
1775     DWORD NumRenderedTriangles;
1776     DWORD NumExtraClippingTriangles;
1777 } WINED3DDEVINFO_VERTEXSTATS;
1778
1779 typedef struct _WINED3DLOCKED_RECT
1780 {
1781     INT Pitch;
1782     void *pBits;
1783 } WINED3DLOCKED_RECT;
1784
1785 typedef struct _WINED3DLOCKED_BOX
1786 {
1787     INT RowPitch;
1788     INT SlicePitch;
1789     void *pBits;
1790 } WINED3DLOCKED_BOX;
1791
1792 typedef struct _WINED3DBOX
1793 {
1794     UINT Left;
1795     UINT Top;
1796     UINT Right;
1797     UINT Bottom;
1798     UINT Front;
1799     UINT Back;
1800 } WINED3DBOX;
1801
1802 /*Vertex cache optimization hints.*/
1803 typedef struct WINED3DDEVINFO_VCACHE
1804 {
1805     DWORD Pattern;      /* Must be a 4 char code FOURCC (e.g. CACH) */
1806     DWORD OptMethod;    /* 0 to get the longest  strips, 1 vertex cache */
1807     DWORD CacheSize;    /* Cache size to use (only valid if OptMethod==1) */
1808     DWORD MagicNumber;  /* Internal for deciding when to restart strips,
1809                            non user modifiable (only valid if OptMethod==1) */
1810 } WINED3DDEVINFO_VCACHE;
1811
1812 typedef struct _WINED3DVERTEXBUFFER_DESC
1813 {
1814     WINED3DFORMAT Format;
1815     WINED3DRESOURCETYPE Type;
1816     DWORD Usage;
1817     WINED3DPOOL Pool;
1818     UINT Size;
1819     DWORD FVF;
1820 } WINED3DVERTEXBUFFER_DESC;
1821
1822 typedef struct _WINED3DINDEXBUFFER_DESC
1823 {
1824     WINED3DFORMAT Format;
1825     WINED3DRESOURCETYPE Type;
1826     DWORD Usage;
1827     WINED3DPOOL Pool;
1828     UINT Size;
1829 } WINED3DINDEXBUFFER_DESC;
1830
1831 typedef struct glDescriptor
1832 {
1833     UINT textureName;
1834     int level;
1835     int /*GLenum*/ target;
1836     int /*GLenum*/ glFormat;
1837     int /*GLenum*/ glFormatInternal;
1838     int /*GLenum*/ glType;
1839 } glDescriptor;
1840
1841 typedef struct WineDirect3DStridedData
1842 {
1843     const BYTE *lpData; /* Pointer to start of data */
1844     DWORD dwStride;     /* Stride between occurrences of this data */
1845     DWORD dwType;       /* Type (as in D3DVSDT_TYPE) */
1846     int VBO;            /* Vertex buffer object this data is in */
1847     UINT streamNo;      /* D3D stream number */
1848 } WineDirect3DStridedData;
1849
1850 typedef struct WineDirect3DVertexStridedData
1851 {
1852     /*
1853      * IMPORTANT:
1854      * This structure can be accessed in two ways: Named access, and array
1855      * access. Please note that named access is only valid with the fixed
1856      * function vertex pipeline, and the arrays are only valid with the
1857      * programmable vertex pipeline(vertex shaders).
1858      */
1859     union
1860     {
1861         struct
1862         {
1863             /* Do not add or reorder fields here,
1864              * so this can be indexed as an array */
1865             WineDirect3DStridedData position;
1866             WineDirect3DStridedData blendWeights;
1867             WineDirect3DStridedData blendMatrixIndices;
1868             WineDirect3DStridedData normal;
1869             WineDirect3DStridedData pSize;
1870             WineDirect3DStridedData diffuse;
1871             WineDirect3DStridedData specular;
1872             WineDirect3DStridedData texCoords[WINED3DDP_MAXTEXCOORD];
1873             WineDirect3DStridedData position2;  /* tween data */
1874             WineDirect3DStridedData normal2;    /* tween data */
1875             WineDirect3DStridedData tangent;
1876             WineDirect3DStridedData binormal;
1877             WineDirect3DStridedData tessFactor;
1878             WineDirect3DStridedData fog;
1879             WineDirect3DStridedData depth;
1880             WineDirect3DStridedData sample;
1881
1882             /* Add fields here */
1883         } s;
1884         WineDirect3DStridedData input[16];  /* Indexed by constants in D3DVSDE_REGISTER */
1885     } u;
1886
1887     BOOL position_transformed;
1888     WORD swizzle_map;       /* MAX_ATTRIBS, 16 */
1889     WORD use_map;           /* MAX_ATTRIBS, 16 */
1890 } WineDirect3DVertexStridedData;
1891
1892 typedef struct _WINED3DVSHADERCAPS2_0
1893 {
1894     DWORD Caps;
1895     INT DynamicFlowControlDepth;
1896     INT NumTemps;
1897     INT StaticFlowControlDepth;
1898 } WINED3DVSHADERCAPS2_0;
1899
1900 typedef struct _WINED3DPSHADERCAPS2_0
1901 {
1902     DWORD Caps;
1903     INT DynamicFlowControlDepth;
1904     INT NumTemps;
1905     INT StaticFlowControlDepth;
1906     INT NumInstructionSlots;
1907 } WINED3DPSHADERCAPS2_0;
1908
1909 typedef struct _WINEDDCAPS
1910 {
1911     DWORD Caps;
1912     DWORD Caps2;
1913     DWORD CKeyCaps;
1914     DWORD FXCaps;
1915     DWORD FXAlphaCaps;
1916     DWORD PalCaps;
1917     DWORD SVCaps;
1918     DWORD SVBCaps;
1919     DWORD SVBCKeyCaps;
1920     DWORD SVBFXCaps;
1921     DWORD VSBCaps;
1922     DWORD VSBCKeyCaps;
1923     DWORD VSBFXCaps;
1924     DWORD SSBCaps;
1925     DWORD SSBCKeyCaps;
1926     DWORD SSBFXCaps;
1927     DWORD ddsCaps;
1928     DWORD StrideAlign;
1929 } WINEDDCAPS;
1930
1931 typedef struct _WINED3DCAPS
1932 {
1933     WINED3DDEVTYPE DeviceType;
1934     UINT AdapterOrdinal;
1935
1936     DWORD Caps;
1937     DWORD Caps2;
1938     DWORD Caps3;
1939     DWORD PresentationIntervals;
1940
1941     DWORD CursorCaps;
1942     DWORD DevCaps;
1943     DWORD PrimitiveMiscCaps;
1944     DWORD RasterCaps;
1945     DWORD ZCmpCaps;
1946     DWORD SrcBlendCaps;
1947     DWORD DestBlendCaps;
1948     DWORD AlphaCmpCaps;
1949     DWORD ShadeCaps;
1950     DWORD TextureCaps;
1951     DWORD TextureFilterCaps;
1952     DWORD CubeTextureFilterCaps;
1953     DWORD VolumeTextureFilterCaps;
1954     DWORD TextureAddressCaps;
1955     DWORD VolumeTextureAddressCaps;
1956     DWORD LineCaps;
1957
1958     DWORD MaxTextureWidth;
1959     DWORD MaxTextureHeight;
1960     DWORD MaxVolumeExtent;
1961     DWORD MaxTextureRepeat;
1962     DWORD MaxTextureAspectRatio;
1963     DWORD MaxAnisotropy;
1964     float MaxVertexW;
1965
1966     float GuardBandLeft;
1967     float GuardBandTop;
1968     float GuardBandRight;
1969     float GuardBandBottom;
1970
1971     float ExtentsAdjust;
1972     DWORD StencilCaps;
1973
1974     DWORD FVFCaps;
1975     DWORD TextureOpCaps;
1976     DWORD MaxTextureBlendStages;
1977     DWORD MaxSimultaneousTextures;
1978
1979     DWORD VertexProcessingCaps;
1980     DWORD MaxActiveLights;
1981     DWORD MaxUserClipPlanes;
1982     DWORD MaxVertexBlendMatrices;
1983     DWORD MaxVertexBlendMatrixIndex;
1984
1985     float MaxPointSize;
1986
1987     DWORD MaxPrimitiveCount;
1988     DWORD MaxVertexIndex;
1989     DWORD MaxStreams;
1990     DWORD MaxStreamStride;
1991
1992     DWORD VertexShaderVersion;
1993     DWORD MaxVertexShaderConst;
1994
1995     DWORD PixelShaderVersion;
1996     float PixelShader1xMaxValue;
1997
1998     /* DX 9 */
1999     DWORD DevCaps2;
2000
2001     float MaxNpatchTessellationLevel;
2002     DWORD Reserved5; /* undocumented */
2003
2004     UINT MasterAdapterOrdinal;
2005     UINT AdapterOrdinalInGroup;
2006     UINT NumberOfAdaptersInGroup;
2007     DWORD DeclTypes;
2008     DWORD NumSimultaneousRTs;
2009     DWORD StretchRectFilterCaps;
2010     WINED3DVSHADERCAPS2_0 VS20Caps;
2011     WINED3DPSHADERCAPS2_0 PS20Caps;
2012     DWORD VertexTextureFilterCaps;
2013     DWORD MaxVShaderInstructionsExecuted;
2014     DWORD MaxPShaderInstructionsExecuted;
2015     DWORD MaxVertexShader30InstructionSlots;
2016     DWORD MaxPixelShader30InstructionSlots;
2017     DWORD Reserved2; /* Not in the microsoft headers but documented */
2018     DWORD Reserved3;
2019
2020     WINEDDCAPS DirectDrawCaps;
2021 } WINED3DCAPS;
2022
2023 /* DirectDraw types */
2024
2025 typedef struct _WINEDDCOLORKEY
2026 {
2027     DWORD dwColorSpaceLowValue;     /* low boundary of color space that is to
2028                                      * be treated as Color Key, inclusive */
2029     DWORD dwColorSpaceHighValue;    /* high boundary of color space that is
2030                                      * to be treated as Color Key, inclusive */
2031 } WINEDDCOLORKEY,*LPWINEDDCOLORKEY;
2032
2033 typedef struct _WINEDDBLTFX
2034 {
2035     DWORD dwSize;                                   /* size of structure */
2036     DWORD dwDDFX;                                   /* FX operations */
2037     DWORD dwROP;                                    /* Win32 raster operations */
2038     DWORD dwDDROP;                                  /* Raster operations new for DirectDraw */
2039     DWORD dwRotationAngle;                          /* Rotation angle for blt */
2040     DWORD dwZBufferOpCode;                          /* ZBuffer compares */
2041     DWORD dwZBufferLow;                             /* Low limit of Z buffer */
2042     DWORD dwZBufferHigh;                            /* High limit of Z buffer */
2043     DWORD dwZBufferBaseDest;                        /* Destination base value */
2044     DWORD dwZDestConstBitDepth;                     /* Bit depth used to specify Z constant for destination */
2045     union
2046     {
2047         DWORD dwZDestConst;                         /* Constant to use as Z buffer for dest */
2048         struct IWineD3DSurface *lpDDSZBufferDest;   /* Surface to use as Z buffer for dest */
2049     } DUMMYUNIONNAME1;
2050     DWORD dwZSrcConstBitDepth;                      /* Bit depth used to specify Z constant for source */
2051     union
2052     {
2053         DWORD dwZSrcConst;                          /* Constant to use as Z buffer for src */
2054         struct IWineD3DSurface *lpDDSZBufferSrc;    /* Surface to use as Z buffer for src */
2055     } DUMMYUNIONNAME2;
2056     DWORD dwAlphaEdgeBlendBitDepth;                 /* Bit depth used to specify constant for alpha edge blend */
2057     DWORD dwAlphaEdgeBlend;                         /* Alpha for edge blending */
2058     DWORD dwReserved;
2059     DWORD dwAlphaDestConstBitDepth;                 /* Bit depth used to specify alpha constant for destination */
2060     union
2061     {
2062         DWORD dwAlphaDestConst;                     /* Constant to use as Alpha Channel */
2063         struct IWineD3DSurface *lpDDSAlphaDest;     /* Surface to use as Alpha Channel */
2064     } DUMMYUNIONNAME3;
2065     DWORD dwAlphaSrcConstBitDepth;                  /* Bit depth used to specify alpha constant for source */
2066     union
2067     {
2068         DWORD dwAlphaSrcConst;                      /* Constant to use as Alpha Channel */
2069         struct IWineD3DSurface *lpDDSAlphaSrc;      /* Surface to use as Alpha Channel */
2070     } DUMMYUNIONNAME4;
2071     union
2072     {
2073         DWORD dwFillColor;                          /* color in RGB or Palettized */
2074         DWORD dwFillDepth;                          /* depth value for z-buffer */
2075         DWORD dwFillPixel;                          /* pixel val for RGBA or RGBZ */
2076         struct IWineD3DSurface *lpDDSPattern;       /* Surface to use as pattern */
2077     } DUMMYUNIONNAME5;
2078     WINEDDCOLORKEY ddckDestColorkey;                /* DestColorkey override */
2079     WINEDDCOLORKEY ddckSrcColorkey;                 /* SrcColorkey override */
2080 } WINEDDBLTFX,*LPWINEDDBLTFX;
2081
2082 typedef struct _WINEDDOVERLAYFX
2083 {
2084     DWORD dwSize;                                   /* size of structure */
2085     DWORD dwAlphaEdgeBlendBitDepth;                 /* Bit depth used to specify constant for alpha edge blend */
2086     DWORD dwAlphaEdgeBlend;                         /* Constant to use as alpha for edge blend */
2087     DWORD dwReserved;
2088     DWORD dwAlphaDestConstBitDepth;                 /* Bit depth used to specify alpha constant for destination */
2089     union
2090     {
2091         DWORD dwAlphaDestConst;                     /* Constant to use as alpha channel for dest */
2092         struct IWineD3DSurface *lpDDSAlphaDest;     /* Surface to use as alpha channel for dest */
2093     } DUMMYUNIONNAME1;
2094     DWORD dwAlphaSrcConstBitDepth;                  /* Bit depth used to specify alpha constant for source */
2095     union
2096     {
2097         DWORD dwAlphaSrcConst;                      /* Constant to use as alpha channel for src */
2098         struct IWineD3DSurface *lpDDSAlphaSrc;      /* Surface to use as alpha channel for src */
2099     } DUMMYUNIONNAME2;
2100     WINEDDCOLORKEY dckDestColorkey;                 /* DestColorkey override */
2101     WINEDDCOLORKEY dckSrcColorkey;                  /* SrcColorkey override */
2102     DWORD dwDDFX;                                   /* Overlay FX */
2103     DWORD dwFlags;                                  /* flags */
2104 } WINEDDOVERLAYFX;
2105
2106 interface IWineD3DResource;
2107 interface IWineD3DSurface;
2108 interface IWineD3DVolume;
2109 interface IWineD3DSwapChain;
2110 interface IWineD3DDevice;
2111
2112 [
2113     object,
2114     local,
2115     uuid(aeb62dfc-bdcb-4f02-9519-1eeea00c15cd)
2116 ]
2117 interface IWineD3DDeviceParent : IUnknown
2118 {
2119     HRESULT CreateSurface(
2120         [in] IUnknown *superior,
2121         [in] UINT width,
2122         [in] UINT height,
2123         [in] WINED3DFORMAT format,
2124         [in] DWORD usage,
2125         [in] WINED3DPOOL pool,
2126         [in] UINT level,
2127         [in] WINED3DCUBEMAP_FACES face,
2128         [out] IWineD3DSurface **surface
2129     );
2130
2131     HRESULT CreateRenderTarget(
2132         [in] IUnknown *superior,
2133         [in] UINT width,
2134         [in] UINT height,
2135         [in] WINED3DFORMAT format,
2136         [in] WINED3DMULTISAMPLE_TYPE multisample_type,
2137         [in] DWORD multisample_quality,
2138         [in] BOOL lockable,
2139         [out] IWineD3DSurface **surface
2140     );
2141
2142     HRESULT CreateDepthStencilSurface(
2143         [in] IUnknown *superior,
2144         [in] UINT width,
2145         [in] UINT height,
2146         [in] WINED3DFORMAT format,
2147         [in] WINED3DMULTISAMPLE_TYPE multisample_type,
2148         [in] DWORD multisample_quality,
2149         [in] BOOL discard,
2150         [out] IWineD3DSurface **surface
2151     );
2152
2153     HRESULT CreateVolume(
2154         [in] IUnknown *superior,
2155         [in] UINT width,
2156         [in] UINT height,
2157         [in] UINT depth,
2158         [in] WINED3DFORMAT format,
2159         [in] WINED3DPOOL pool,
2160         [in] DWORD usage,
2161         [out] IWineD3DVolume **volume
2162     );
2163
2164     HRESULT CreateSwapChain(
2165         [in, out] WINED3DPRESENT_PARAMETERS *present_parameters,
2166         [out] IWineD3DSwapChain **swapchain
2167     );
2168 }
2169 typedef ULONG (*D3DCB_DESTROYSURFACEFN)(IWineD3DSurface *pSurface);
2170 typedef ULONG (*D3DCB_DESTROYVOLUMEFN)(IWineD3DVolume *pVolume);
2171 typedef ULONG (*D3DCB_DESTROYSWAPCHAINFN)(IWineD3DSwapChain *pSwapChain);
2172 typedef HRESULT (*D3DCB_ENUMRESOURCES)(IWineD3DResource *resource, void *pData);
2173
2174 [
2175     object,
2176     local,
2177     uuid(46799311-8e0e-40ce-b2ec-ddb99f18fcb4)
2178 ]
2179 interface IWineD3DBase : IUnknown
2180 {
2181     HRESULT GetParent(
2182         [out] IUnknown **parent
2183     );
2184 }
2185
2186 [
2187     object,
2188     local,
2189     uuid(108f9c44-6f30-11d9-c687-00046142c14f)
2190 ]
2191 interface IWineD3D : IWineD3DBase
2192 {
2193     UINT GetAdapterCount(
2194     );
2195     HRESULT RegisterSoftwareDevice(
2196         [in] void *pInitializeFunction
2197     );
2198     HMONITOR GetAdapterMonitor(
2199         [in] UINT adapter_idx
2200     );
2201     UINT GetAdapterModeCount(
2202         [in] UINT adapter_idx,
2203         [in] WINED3DFORMAT format
2204     );
2205     HRESULT EnumAdapterModes(
2206         [in] UINT adapter_idx,
2207         [in] UINT mode_idx,
2208         [in] WINED3DFORMAT format,
2209         [out] WINED3DDISPLAYMODE *mode
2210     );
2211     HRESULT GetAdapterDisplayMode(
2212         [in] UINT adapter_idx,
2213         [out] WINED3DDISPLAYMODE *mode
2214     );
2215     HRESULT GetAdapterIdentifier(
2216         [in] UINT adapter_idx,
2217         [in] DWORD flags,
2218         [out] WINED3DADAPTER_IDENTIFIER *identifier
2219     );
2220     HRESULT CheckDeviceMultiSampleType(
2221         [in] UINT adapter_idx,
2222         [in] WINED3DDEVTYPE device_type,
2223         [in] WINED3DFORMAT surface_format,
2224         [in] BOOL windowed,
2225         [in] WINED3DMULTISAMPLE_TYPE multisample_type,
2226         [out] DWORD *quality_levels
2227     );
2228     HRESULT CheckDepthStencilMatch(
2229         [in] UINT adapter_idx,
2230         [in] WINED3DDEVTYPE device_type,
2231         [in] WINED3DFORMAT adapter_format,
2232         [in] WINED3DFORMAT render_target_format,
2233         [in] WINED3DFORMAT depth_stencil_format
2234     );
2235     HRESULT CheckDeviceType(
2236         [in] UINT adapter_idx,
2237         [in] WINED3DDEVTYPE device_type,
2238         [in] WINED3DFORMAT display_format,
2239         [in] WINED3DFORMAT backbuffer_format,
2240         [in] BOOL windowed
2241     );
2242     HRESULT CheckDeviceFormat(
2243         [in] UINT adaper_idx,
2244         [in] WINED3DDEVTYPE device_type,
2245         [in] WINED3DFORMAT adapter_format,
2246         [in] DWORD usage,
2247         [in] WINED3DRESOURCETYPE resource_type,
2248         [in] WINED3DFORMAT check_format,
2249         [in] WINED3DSURFTYPE surface_type
2250     );
2251     HRESULT CheckDeviceFormatConversion(
2252         [in] UINT adapter_idx,
2253         [in] WINED3DDEVTYPE device_type,
2254         [in] WINED3DFORMAT source_format,
2255         [in] WINED3DFORMAT target_format
2256     );
2257     HRESULT GetDeviceCaps(
2258         [in] UINT adapter_idx,
2259         [in] WINED3DDEVTYPE device_type,
2260         [out] WINED3DCAPS *caps
2261     );
2262     HRESULT CreateDevice(
2263         [in] UINT adapter_idx,
2264         [in] WINED3DDEVTYPE device_type,
2265         [in] HWND focus_window,
2266         [in] DWORD behaviour_flags,
2267         [in] IUnknown *parent,
2268         [in] IWineD3DDeviceParent *device_parent,
2269         [out] IWineD3DDevice **device
2270     );
2271 }
2272
2273 [
2274     object,
2275     local,
2276     uuid(1f3bfb34-6f30-11d9-c687-00046142c14f)
2277 ]
2278 interface IWineD3DResource : IWineD3DBase
2279 {
2280     HRESULT GetDevice(
2281         [out] IWineD3DDevice **device
2282     );
2283     HRESULT SetPrivateData(
2284         [in] REFGUID guid,
2285         [in] const void *data,
2286         [in] DWORD data_size,
2287         [in] DWORD flags
2288     );
2289     HRESULT GetPrivateData(
2290         [in] REFGUID guid,
2291         [out] void *data,
2292         [in, out] DWORD *data_size
2293     );
2294     HRESULT FreePrivateData(
2295         [in] REFGUID guid
2296     );
2297     DWORD SetPriority(
2298         [in] DWORD new_priority
2299     );
2300     DWORD GetPriority(
2301     );
2302     void PreLoad(
2303     );
2304     void UnLoad(
2305     );
2306     WINED3DRESOURCETYPE GetType(
2307     );
2308 }
2309
2310 [
2311     object,
2312     local,
2313     uuid(217f671e-6f30-11d9-c687-00046142c14f)
2314 ]
2315 interface IWineD3DVertexBuffer : IWineD3DResource
2316 {
2317     HRESULT Lock(
2318         [in] UINT offset,
2319         [in] UINT size,
2320         [out] BYTE **data,
2321         [in] DWORD flags
2322     );
2323     HRESULT Unlock(
2324     );
2325     HRESULT GetDesc(
2326         [out] WINED3DVERTEXBUFFER_DESC *desc
2327     );
2328 }
2329
2330 [
2331     object,
2332     local,
2333     uuid(3a02a54e-6f30-11d9-c687-00046142c14f)
2334 ]
2335 interface IWineD3DIndexBuffer : IWineD3DResource
2336 {
2337     HRESULT Lock(
2338         [in] UINT offset,
2339         [in] UINT size,
2340         [out] BYTE **data,
2341         [in] DWORD flags
2342     );
2343     HRESULT Unlock(
2344     );
2345     HRESULT GetDesc(
2346         [out] WINED3DINDEXBUFFER_DESC *desc
2347     );
2348 }
2349
2350 [
2351     object,
2352     local,
2353     uuid(f756720c-32b9-4439-b5a3-1d6c97037d9e)
2354 ]
2355 interface IWineD3DPalette : IWineD3DBase
2356 {
2357     HRESULT GetEntries(
2358         [in] DWORD flags,
2359         [in] DWORD start,
2360         [in] DWORD count,
2361         [out] PALETTEENTRY *entries
2362     );
2363     HRESULT GetCaps(
2364         [out] DWORD *caps
2365     );
2366     HRESULT SetEntries(
2367         [in] DWORD flags,
2368         [in] DWORD start,
2369         [in] DWORD count,
2370         [in] const PALETTEENTRY *entries
2371     );
2372 }
2373
2374 [
2375     object,
2376     local,
2377     uuid(8f2bceb1-d338-488c-ab7f-0ec980bf5d2d)
2378 ]
2379 interface IWineD3DClipper : IWineD3DBase
2380 {
2381     HRESULT GetClipList(
2382         [in] const RECT *rect,
2383         [out] RGNDATA *clip_list,
2384         [in, out] DWORD *clip_list_size
2385     );
2386     HRESULT GetHWnd(
2387         [out] HWND *hwnd
2388     );
2389     HRESULT IsClipListChanged(
2390         [out] BOOL *changed
2391     );
2392     HRESULT SetClipList(
2393         [in] const RGNDATA *clip_list,
2394         [in] DWORD flags
2395     );
2396     HRESULT SetHWnd(
2397         [in] DWORD flags,
2398         [in] HWND hwnd
2399     );
2400 }
2401
2402 [
2403     object,
2404     local,
2405     uuid(37cd5526-6f30-11d9-c687-00046142c14f)
2406 ]
2407 interface IWineD3DSurface : IWineD3DResource
2408 {
2409     HRESULT GetContainer(
2410         [in] REFIID riid,
2411         [out] void **container
2412     );
2413     HRESULT GetDesc(
2414         [out] WINED3DSURFACE_DESC *desc
2415     );
2416     HRESULT LockRect(
2417         [out] WINED3DLOCKED_RECT *locked_rect,
2418         [in] const RECT *rect,
2419         [in] DWORD flags
2420     );
2421     HRESULT UnlockRect(
2422     );
2423     HRESULT GetDC(
2424         [out] HDC *dc
2425     );
2426     HRESULT ReleaseDC(
2427         [in] HDC dc
2428     );
2429     HRESULT Flip(
2430         [in] IWineD3DSurface *override,
2431         [in] DWORD flags
2432     );
2433     HRESULT Blt(
2434         [in] const RECT *dst_rect,
2435         [in] IWineD3DSurface *src_surface,
2436         [in] const RECT *src_rect,
2437         [in] DWORD flags,
2438         [in] const WINEDDBLTFX *blt_fx,
2439         [in] WINED3DTEXTUREFILTERTYPE filter
2440     );
2441     HRESULT GetBltStatus(
2442         [in] DWORD flags
2443     );
2444     HRESULT GetFlipStatus(
2445         [in] DWORD flags
2446     );
2447     HRESULT IsLost(
2448     );
2449     HRESULT Restore(
2450     );
2451     HRESULT BltFast(
2452         [in] DWORD dst_x,
2453         [in] DWORD dst_y,
2454         [in] IWineD3DSurface *src_surface,
2455         [in] const RECT *src_rect,
2456         [in] DWORD trans
2457     );
2458     HRESULT GetPalette(
2459         [out] IWineD3DPalette **palette
2460     );
2461     HRESULT SetPalette(
2462         [in] IWineD3DPalette *palette
2463     );
2464     HRESULT RealizePalette(
2465     );
2466     HRESULT SetColorKey(
2467         [in] DWORD flags,
2468         [in] const WINEDDCOLORKEY *color_key
2469     );
2470     DWORD GetPitch(
2471     );
2472     HRESULT SetMem(
2473         [in] void *mem
2474     );
2475     HRESULT SetOverlayPosition(
2476         [in] LONG x,
2477         [in] LONG y
2478     );
2479     HRESULT GetOverlayPosition(
2480         [out] LONG *x,
2481         [out] LONG *y
2482     );
2483     HRESULT UpdateOverlayZOrder(
2484         [in] DWORD flags,
2485         [in] IWineD3DSurface *ref
2486     );
2487     HRESULT UpdateOverlay(
2488         [in] const RECT *src_rect,
2489         [in] IWineD3DSurface *dst_surface,
2490         [in] const RECT *dst_rect,
2491         [in] DWORD flags,
2492         [in] const WINEDDOVERLAYFX *fx
2493     );
2494     HRESULT SetClipper(
2495         [in] IWineD3DClipper *clipper
2496     );
2497     HRESULT GetClipper(
2498         [out] IWineD3DClipper **clipper
2499     );
2500     HRESULT LoadTexture(
2501         [in] BOOL srgb_mode
2502     );
2503     void BindTexture(
2504     );
2505     HRESULT SaveSnapshot(
2506         [in] const char *filename
2507     );
2508     HRESULT SetContainer(
2509         [in] IWineD3DBase *container
2510     );
2511     void GetGlDesc(
2512         [out] glDescriptor **desc
2513     );
2514     const void *GetData(
2515     );
2516     HRESULT SetFormat(
2517         [in] WINED3DFORMAT format
2518     );
2519     HRESULT PrivateSetup(
2520     );
2521     void ModifyLocation(
2522         [in] DWORD location,
2523         [in] BOOL persistent
2524     );
2525     HRESULT LoadLocation(
2526         [in] DWORD location,
2527         [in] const RECT *rect
2528     );
2529     WINED3DSURFTYPE GetImplType(
2530     );
2531     HRESULT DrawOverlay(
2532     );
2533 }
2534
2535 [
2536     object,
2537     local,
2538     uuid(24769ed8-6f30-11d9-c687-00046142c14f)
2539 ]
2540 interface IWineD3DVolume : IWineD3DResource
2541 {
2542     HRESULT GetContainer(
2543         [in] REFIID riid,
2544         [out] void **container
2545     );
2546     HRESULT GetDesc(
2547         [out] WINED3DVOLUME_DESC *desc
2548     );
2549     HRESULT LockBox(
2550         [out] WINED3DLOCKED_BOX *locked_box,
2551         [in] const WINED3DBOX *box,
2552         [in] DWORD flags
2553     );
2554     HRESULT UnlockBox(
2555     );
2556     HRESULT LoadTexture(
2557         [in] int gl_level,
2558         [in] BOOL srgb_mode
2559     );
2560     HRESULT SetContainer(
2561         [in] IWineD3DBase *container
2562     );
2563 }
2564
2565 [
2566     object,
2567     local,
2568     uuid(3c2aebf6-6f30-11d9-c687-00046142c14f)
2569 ]
2570 interface IWineD3DBaseTexture : IWineD3DResource
2571 {
2572     DWORD SetLOD(
2573         [in] DWORD new_lod
2574     );
2575     DWORD GetLOD(
2576     );
2577     DWORD GetLevelCount(
2578     );
2579     HRESULT SetAutoGenFilterType(
2580         WINED3DTEXTUREFILTERTYPE filter_type
2581     );
2582     WINED3DTEXTUREFILTERTYPE GetAutoGenFilterType(
2583     );
2584     void GenerateMipSubLevels(
2585     );
2586     BOOL SetDirty(
2587         BOOL dirty
2588     );
2589     BOOL GetDirty(
2590     );
2591     HRESULT BindTexture(
2592     );
2593     UINT GetTextureDimensions(
2594     );
2595     BOOL IsCondNP2(
2596     );
2597     void ApplyStateChanges(
2598         const DWORD texture_states[WINED3D_HIGHEST_TEXTURE_STATE + 1],
2599         const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]
2600     );
2601 }
2602
2603 [
2604     object,
2605     local,
2606     uuid(3e72cc1c-6f30-11d9-c687-00046142c14f)
2607 ]
2608 interface IWineD3DTexture : IWineD3DBaseTexture
2609 {
2610     void Destroy(
2611         [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
2612     );
2613     HRESULT GetLevelDesc(
2614         [in] UINT level,
2615         [out] WINED3DSURFACE_DESC *desc
2616     );
2617     HRESULT GetSurfaceLevel(
2618         [in] UINT level,
2619         [out] IWineD3DSurface **surface
2620     );
2621     HRESULT LockRect(
2622         [in] UINT level,
2623         [out] WINED3DLOCKED_RECT *locked_rect,
2624         [in] const RECT *rect,
2625         [in] DWORD flags
2626     );
2627     HRESULT UnlockRect(
2628         [in] UINT level
2629     );
2630     HRESULT AddDirtyRect(
2631         [in] const RECT *dirty_rect
2632     );
2633 }
2634
2635 [
2636     object,
2637     local,
2638     uuid(41752900-6f30-11d9-c687-00046142c14f)
2639 ]
2640 interface IWineD3DCubeTexture : IWineD3DBaseTexture
2641 {
2642     void Destroy(
2643         [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
2644     );
2645     HRESULT GetLevelDesc(
2646         [in] UINT level,
2647         [out] WINED3DSURFACE_DESC *desc
2648     );
2649     HRESULT GetCubeMapSurface(
2650         [in] WINED3DCUBEMAP_FACES face,
2651         [in] UINT level,
2652         [out] IWineD3DSurface **surface
2653     );
2654     HRESULT LockRect(
2655         [in] WINED3DCUBEMAP_FACES face,
2656         [in] UINT level,
2657         [out] WINED3DLOCKED_RECT *locked_rect,
2658         [in] const RECT *rect,
2659         [in] DWORD flags
2660     );
2661     HRESULT UnlockRect(
2662         [in] WINED3DCUBEMAP_FACES face,
2663         [in] UINT level
2664     );
2665     HRESULT AddDirtyRect(
2666         [in] WINED3DCUBEMAP_FACES face,
2667         [in] const RECT *dirty_rect
2668     );
2669 }
2670
2671 [
2672     object,
2673     local,
2674     uuid(7b39470c-6f30-11d9-c687-00046142c14f)
2675 ]
2676 interface IWineD3DVolumeTexture : IWineD3DBaseTexture
2677 {
2678     void Destroy(
2679         [in] D3DCB_DESTROYVOLUMEFN destroy_volume_callback
2680     );
2681     HRESULT GetLevelDesc(
2682         [in] UINT level,
2683         [out] WINED3DVOLUME_DESC *desc
2684     );
2685     HRESULT GetVolumeLevel(
2686         [in] UINT level,
2687         [out] IWineD3DVolume **volume
2688     );
2689     HRESULT LockBox(
2690         [in] UINT level,
2691         [out] WINED3DLOCKED_BOX *locked_box,
2692         [in] const WINED3DBOX *box,
2693         [in] DWORD flags
2694     );
2695     HRESULT UnlockBox(
2696         [in] UINT level
2697     );
2698     HRESULT AddDirtyBox(
2699         [in] const WINED3DBOX *dirty_box
2700     );
2701 }
2702
2703 [
2704     object,
2705     local,
2706     uuid(7cd55be6-6f30-11d9-c687-00046142c14f)
2707 ]
2708 interface IWineD3DVertexDeclaration : IWineD3DBase
2709 {
2710     HRESULT GetDevice(
2711         [out] IWineD3DDevice **device
2712     );
2713     HRESULT GetDeclaration(
2714         [out] WINED3DVERTEXELEMENT *elements,
2715         [out] UINT *element_count
2716     );
2717     HRESULT SetDeclaration(
2718         [in] const WINED3DVERTEXELEMENT *elements,
2719         [in] UINT element_count
2720     );
2721 }
2722
2723 [
2724     object,
2725     local,
2726     uuid(83b073ce-6f30-11d9-c687-00046142c14f)
2727 ]
2728 interface IWineD3DStateBlock : IWineD3DBase
2729 {
2730     HRESULT GetDevice(
2731         [out] IWineD3DDevice **device
2732     );
2733     HRESULT Capture(
2734     );
2735     HRESULT Apply(
2736     );
2737     HRESULT InitStartupStateBlock(
2738     );
2739 }
2740
2741 [
2742     object,
2743     local,
2744     uuid(905ddbac-6f30-11d9-c687-00046142c14f)
2745 ]
2746 interface IWineD3DQuery : IWineD3DBase
2747 {
2748     HRESULT GetDevice(
2749         [out] IWineD3DDevice **device
2750     );
2751     HRESULT GetData(
2752         [out] void *data,
2753         [in] DWORD data_size,
2754         [in] DWORD flags
2755     );
2756     DWORD GetDataSize(
2757     );
2758     WINED3DQUERYTYPE GetType(
2759     );
2760     HRESULT Issue(
2761         DWORD flags
2762     );
2763 }
2764
2765 [
2766     object,
2767     local,
2768     uuid(34d01b10-6f30-11d9-c687-00046142c14f)
2769 ]
2770 interface IWineD3DSwapChain : IWineD3DBase
2771 {
2772     void Destroy(
2773         [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
2774     );
2775     HRESULT GetDevice(
2776         [out] IWineD3DDevice **device
2777     );
2778     HRESULT Present(
2779         [in] const RECT *src_rect,
2780         [in] const RECT *dst_rect,
2781         [in] HWND dst_window_override,
2782         [in] const RGNDATA *dirty_region,
2783         [in] DWORD flags
2784     );
2785     HRESULT SetDestWindowOverride(
2786         [in] HWND window
2787     );
2788     HRESULT GetFrontBufferData(
2789         [in] IWineD3DSurface *dst_surface
2790     );
2791     HRESULT GetBackBuffer(
2792         [in] UINT backbuffer_idx,
2793         [in] WINED3DBACKBUFFER_TYPE backbuffer_type,
2794         [out] IWineD3DSurface **backbuffer
2795     );
2796     HRESULT GetRasterStatus(
2797         [out] WINED3DRASTER_STATUS *raster_status
2798     );
2799     HRESULT GetDisplayMode(
2800         [out] WINED3DDISPLAYMODE *mode
2801     );
2802     HRESULT GetPresentParameters(
2803         [out] WINED3DPRESENT_PARAMETERS *present_parameters
2804     );
2805     HRESULT SetGammaRamp(
2806         [in] DWORD flags,
2807         [in] const WINED3DGAMMARAMP *ramp
2808     );
2809     HRESULT GetGammaRamp(
2810         [out] WINED3DGAMMARAMP *ramp
2811     );
2812 }
2813
2814 [
2815     object,
2816     local,
2817     uuid(eac93065-a4df-446f-86a1-9ef2bca40a3c)
2818 ]
2819 interface IWineD3DBaseShader : IWineD3DBase
2820 {
2821     HRESULT SetFunction(
2822         [in] const DWORD *function
2823     );
2824 }
2825
2826 [
2827     object,
2828     local,
2829     uuid(7f7a2b60-6f30-11d9-c687-00046142c14f)
2830 ]
2831 interface IWineD3DVertexShader : IWineD3DBaseShader
2832 {
2833     HRESULT GetDevice(
2834         [out] IWineD3DDevice **device
2835     );
2836     HRESULT GetFunction(
2837         [out] void *data,
2838         [in, out] UINT *data_size
2839     );
2840     void FakeSemantics(
2841         [in] IWineD3DVertexDeclaration *vertex_declaration
2842     );
2843     HRESULT SetLocalConstantsF(
2844         [in] UINT start_idx,
2845         [in] const float *src_data,
2846         [in] UINT vector4f_count
2847     );
2848 }
2849
2850 [
2851     object,
2852     local,
2853     uuid(818503da-6f30-11d9-c687-00046142c14f)
2854 ]
2855 interface IWineD3DPixelShader : IWineD3DBaseShader
2856 {
2857     HRESULT GetDevice(
2858         [out] IWineD3DDevice **device
2859     );
2860     HRESULT GetFunction(
2861         [out] void *data,
2862         [in, out] UINT *data_size
2863     );
2864 }
2865
2866 [
2867     object,
2868     local,
2869     uuid(6d10a2ce-09d0-4a53-a427-11388f9f8ca5)
2870 ]
2871 interface IWineD3DDevice : IWineD3DBase
2872 {
2873     HRESULT CreateVertexBuffer(
2874         [in] UINT length,
2875         [in] DWORD usage,
2876         [in] DWORD fvf,
2877         [in] WINED3DPOOL pool,
2878         [out] IWineD3DVertexBuffer **vertex_buffer,
2879         [in] HANDLE *shared_handle,
2880         [in] IUnknown *parent
2881     );
2882     HRESULT CreateIndexBuffer(
2883         [in] UINT length,
2884         [in] DWORD usage,
2885         [in] WINED3DFORMAT format,
2886         [in] WINED3DPOOL pool,
2887         [out] IWineD3DIndexBuffer **index_buffer,
2888         [in] HANDLE *shared_handle,
2889         [in] IUnknown *parent
2890     );
2891     HRESULT CreateStateBlock(
2892         [in] WINED3DSTATEBLOCKTYPE type,
2893         [out] IWineD3DStateBlock **stateblock,
2894         [in] IUnknown *parent
2895     );
2896     HRESULT CreateSurface(
2897         [in] UINT width,
2898         [in] UINT height,
2899         [in] WINED3DFORMAT format,
2900         [in] BOOL lockable,
2901         [in] BOOL discard,
2902         [in] UINT level,
2903         [out] IWineD3DSurface **surface,
2904         [in] WINED3DRESOURCETYPE resource_type,
2905         [in] DWORD usage,
2906         [in] WINED3DPOOL pool,
2907         [in] WINED3DMULTISAMPLE_TYPE multisample_type,
2908         [in] DWORD multisample_quality,
2909         [in] HANDLE *shared_handle,
2910         [in] WINED3DSURFTYPE surface_type,
2911         [in] IUnknown *parent
2912     );
2913     HRESULT CreateTexture(
2914         [in] UINT width,
2915         [in] UINT height,
2916         [in] UINT levels,
2917         [in] DWORD usage,
2918         [in] WINED3DFORMAT format,
2919         [in] WINED3DPOOL pool,
2920         [out] IWineD3DTexture **texture,
2921         [in] HANDLE *shared_handle,
2922         [in] IUnknown *parent
2923     );
2924     HRESULT CreateVolumeTexture(
2925         [in] UINT width,
2926         [in] UINT height,
2927         [in] UINT depth,
2928         [in] UINT levels,
2929         [in] DWORD usage,
2930         [in] WINED3DFORMAT format,
2931         [in] WINED3DPOOL pool,
2932         [out] IWineD3DVolumeTexture **texture,
2933         [in] HANDLE *shared_handle,
2934         [in] IUnknown *parent
2935     );
2936     HRESULT CreateVolume(
2937         [in] UINT width,
2938         [in] UINT height,
2939         [in] UINT depth,
2940         [in] DWORD usage,
2941         [in] WINED3DFORMAT format,
2942         [in] WINED3DPOOL pool,
2943         [out] IWineD3DVolume **volume,
2944         [in] HANDLE *shared_handle,
2945         [in] IUnknown *parent
2946     );
2947     HRESULT CreateCubeTexture(
2948         [in] UINT edge_length,
2949         [in] UINT levels,
2950         [in] DWORD usage,
2951         [in] WINED3DFORMAT format,
2952         [in] WINED3DPOOL pool,
2953         [out] IWineD3DCubeTexture **texture,
2954         [in] HANDLE *shared_handle,
2955         [in] IUnknown *parent
2956     );
2957     HRESULT CreateQuery(
2958         [in] WINED3DQUERYTYPE type,
2959         [out] IWineD3DQuery **query,
2960         [in] IUnknown *parent
2961     );
2962     HRESULT CreateSwapChain(
2963         [in] WINED3DPRESENT_PARAMETERS *present_parameters,
2964         [out] IWineD3DSwapChain **swapchain,
2965         [in] IUnknown *parent,
2966         [in] WINED3DSURFTYPE surface_type
2967     );
2968     HRESULT CreateVertexDeclaration(
2969         [out] IWineD3DVertexDeclaration **declaration,
2970         [in] IUnknown *parent,
2971         [in] const WINED3DVERTEXELEMENT *elements,
2972         [in] UINT element_count
2973     );
2974     HRESULT CreateVertexDeclarationFromFVF(
2975         [out] IWineD3DVertexDeclaration **declaration,
2976         [in] IUnknown *parent,
2977         [in] DWORD fvf
2978     );
2979     HRESULT CreateVertexShader(
2980         [in] IWineD3DVertexDeclaration *declaration,
2981         [in] const DWORD *function,
2982         [out] IWineD3DVertexShader **shader,
2983         [in] IUnknown *parent
2984     );
2985     HRESULT CreatePixelShader(
2986         [in] const DWORD *function,
2987         [out] IWineD3DPixelShader **shader,
2988         [in] IUnknown *parent
2989     );
2990     HRESULT CreatePalette(
2991         [in] DWORD flags,
2992         [in] const PALETTEENTRY *palette_entry,
2993         [out] IWineD3DPalette **palette,
2994         [in] IUnknown *parent
2995     );
2996     HRESULT Init3D(
2997         [in] WINED3DPRESENT_PARAMETERS *present_parameters
2998     );
2999     HRESULT InitGDI(
3000         [in] WINED3DPRESENT_PARAMETERS *present_parameters
3001     );
3002     HRESULT Uninit3D(
3003         [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback,
3004         [in] D3DCB_DESTROYSWAPCHAINFN destroy_swapchain_callback
3005     );
3006     HRESULT UninitGDI(
3007         [in] D3DCB_DESTROYSWAPCHAINFN destroy_swapchain_callback
3008     );
3009     void SetMultithreaded(
3010     );
3011     HRESULT EvictManagedResources(
3012     );
3013     UINT GetAvailableTextureMem(
3014     );
3015     HRESULT GetBackBuffer(
3016         [in] UINT swapchain_idx,
3017         [in] UINT backbuffer_idx,
3018         [in] WINED3DBACKBUFFER_TYPE backbuffer_type,
3019         [out] IWineD3DSurface **backbuffer
3020     );
3021     HRESULT GetCreationParameters(
3022         [out] WINED3DDEVICE_CREATION_PARAMETERS *creation_parameters
3023     );
3024     HRESULT GetDeviceCaps(
3025         [out] WINED3DCAPS *caps
3026     );
3027     HRESULT GetDirect3D(
3028         [out] IWineD3D** d3d
3029     );
3030     HRESULT GetDisplayMode(
3031         [in] UINT swapchain_idx,
3032         [out] WINED3DDISPLAYMODE *mode
3033     );
3034     HRESULT SetDisplayMode(
3035         [in] UINT swapchain_idx,
3036         [in] const WINED3DDISPLAYMODE *mode
3037     );
3038     UINT GetNumberOfSwapChains(
3039     );
3040     HRESULT GetRasterStatus(
3041         [in] UINT swapchain_idx,
3042         [out] WINED3DRASTER_STATUS *raster_status
3043     );
3044     HRESULT GetSwapChain(
3045         [in] UINT swapchain_idx,
3046         [out] IWineD3DSwapChain **swapchain
3047     );
3048     HRESULT Reset(
3049         [in] WINED3DPRESENT_PARAMETERS *present_parameters
3050     );
3051     HRESULT SetDialogBoxMode(
3052         [in] BOOL enable_dialogs
3053     );
3054     HRESULT SetCursorProperties(
3055         [in] UINT x_hotspot,
3056         [in] UINT y_hotspot,
3057         [in] IWineD3DSurface *cursor_surface
3058     );
3059     void SetCursorPosition(
3060         [in] int x_screen_space,
3061         [in] int y_screen_space,
3062         [in] DWORD flags
3063     );
3064     BOOL ShowCursor(
3065         [in] BOOL show
3066     );
3067     HRESULT TestCooperativeLevel(
3068     );
3069     HRESULT SetClipPlane(
3070         [in] DWORD plane_idx,
3071         [in] const float *plane
3072     );
3073     HRESULT GetClipPlane(
3074         [in] DWORD plane_idx,
3075         [out] float *plane
3076     );
3077     HRESULT SetClipStatus(
3078         [in] const WINED3DCLIPSTATUS *clip_status
3079     );
3080     HRESULT GetClipStatus(
3081         [out] WINED3DCLIPSTATUS *clip_status
3082     );
3083     HRESULT SetCurrentTexturePalette(
3084         [in] UINT palette_number
3085     );
3086     HRESULT GetCurrentTexturePalette(
3087         [out] UINT *palette_number
3088     );
3089     HRESULT SetDepthStencilSurface(
3090         [in] IWineD3DSurface *depth_stencil
3091     );
3092     HRESULT GetDepthStencilSurface(
3093         [out] IWineD3DSurface **depth_stencil
3094     );
3095     void SetGammaRamp(
3096         [in] UINT swapchain_idx,
3097         [in] DWORD flags,
3098         [in] const WINED3DGAMMARAMP *ramp
3099     );
3100     void GetGammaRamp(
3101         [in] UINT swapchain_idx,
3102         [out] WINED3DGAMMARAMP *ramp
3103     );
3104     HRESULT SetIndices(
3105         [in] IWineD3DIndexBuffer *index_buffer
3106     );
3107     HRESULT GetIndices(
3108         [out] IWineD3DIndexBuffer **index_buffer
3109     );
3110     HRESULT SetBaseVertexIndex(
3111         [in] INT base_index
3112     );
3113     HRESULT GetBaseVertexIndex(
3114         [out] INT *base_index
3115     );
3116     HRESULT SetLight(
3117         [in] DWORD light_idx,
3118         [in] const WINED3DLIGHT *light
3119     );
3120     HRESULT GetLight(
3121         [in] DWORD light_idx,
3122         [out] WINED3DLIGHT *light
3123     );
3124     HRESULT SetLightEnable(
3125         [in] DWORD light_idx,
3126         [in] BOOL enable
3127     );
3128     HRESULT GetLightEnable(
3129         [in] DWORD light_idx,
3130         [out] BOOL *enable
3131     );
3132     HRESULT SetMaterial(
3133         [in] const WINED3DMATERIAL *material
3134     );
3135     HRESULT GetMaterial(
3136         [out] WINED3DMATERIAL *material
3137     );
3138     HRESULT SetNPatchMode(
3139         [in] float segments
3140     );
3141     float GetNPatchMode(
3142     );
3143     HRESULT SetPaletteEntries(
3144         [in] UINT palette_number,
3145         [in] const PALETTEENTRY *entries
3146     );
3147     HRESULT GetPaletteEntries(
3148         [in] UINT palette_number,
3149         [out] PALETTEENTRY *entries
3150     );
3151     HRESULT SetPixelShader(
3152         [in] IWineD3DPixelShader *shader
3153     );
3154     HRESULT GetPixelShader(
3155         [out] IWineD3DPixelShader **shader
3156     );
3157     HRESULT SetPixelShaderConstantB(
3158         [in] UINT start_register,
3159         [in] const BOOL *constants,
3160         [in] UINT bool_count
3161     );
3162     HRESULT GetPixelShaderConstantB(
3163         [in] UINT start_register,
3164         [out] BOOL *constants,
3165         [in] UINT bool_count
3166     );
3167     HRESULT SetPixelShaderConstantI(
3168         [in] UINT start_register,
3169         [in] const int *constants,
3170         [in] UINT vector4i_count
3171     );
3172     HRESULT GetPixelShaderConstantI(
3173         [in] UINT start_register,
3174         [out] int *constants,
3175         [in] UINT vector4i_count
3176     );
3177     HRESULT SetPixelShaderConstantF(
3178         [in] UINT start_register,
3179         [in] const float *constants,
3180         [in] UINT vector4f_count
3181     );
3182     HRESULT GetPixelShaderConstantF(
3183         [in] UINT start_register,
3184         [out] float *constants,
3185         [in] UINT vector4f_count
3186     );
3187     HRESULT SetRenderState(
3188         [in] WINED3DRENDERSTATETYPE state,
3189         [in] DWORD value
3190     );
3191     HRESULT GetRenderState(
3192         [in] WINED3DRENDERSTATETYPE state,
3193         [out] DWORD *value
3194     );
3195     HRESULT SetRenderTarget(
3196         [in] DWORD render_target_idx,
3197         [in] IWineD3DSurface *render_target
3198     );
3199     HRESULT GetRenderTarget(
3200         [in] DWORD render_target_idx,
3201         [out] IWineD3DSurface **render_target
3202     );
3203     HRESULT SetFrontBackBuffers(
3204         [in] IWineD3DSurface *front,
3205         [in] IWineD3DSurface *back
3206     );
3207     HRESULT SetSamplerState(
3208         [in] DWORD sampler_idx,
3209         [in] WINED3DSAMPLERSTATETYPE state,
3210         [in] DWORD value
3211     );
3212     HRESULT GetSamplerState(
3213         [in] DWORD sampler_idx,
3214         [in] WINED3DSAMPLERSTATETYPE state,
3215         [out] DWORD *value
3216     );
3217     HRESULT SetScissorRect(
3218         [in] const RECT *rect
3219     );
3220     HRESULT GetScissorRect(
3221         [out] RECT *rect
3222     );
3223     HRESULT SetSoftwareVertexProcessing(
3224         [in] BOOL software
3225     );
3226     BOOL GetSoftwareVertexProcessing(
3227     );
3228     HRESULT SetStreamSource(
3229         [in] UINT stream_idx,
3230         [in] IWineD3DVertexBuffer *vertex_buffer,
3231         [in] UINT offset,
3232         [in] UINT stride
3233     );
3234     HRESULT GetStreamSource(
3235         [in] UINT stream_idx,
3236         [out] IWineD3DVertexBuffer **vertex_buffer,
3237         [out] UINT *offset,
3238         [out] UINT *stride
3239     );
3240     HRESULT SetStreamSourceFreq(
3241         [in] UINT stream_idx,
3242         [in] UINT divider
3243     );
3244     HRESULT GetStreamSourceFreq(
3245         [in] UINT stream_idx,
3246         [out] UINT *divider
3247     );
3248     HRESULT SetTexture(
3249         [in] DWORD stage,
3250         [in] IWineD3DBaseTexture *texture
3251     );
3252     HRESULT GetTexture(
3253         [in] DWORD stage,
3254         [out] IWineD3DBaseTexture **texture
3255     );
3256     HRESULT SetTextureStageState(
3257         [in] DWORD stage,
3258         [in] WINED3DTEXTURESTAGESTATETYPE state,
3259         [in] DWORD value
3260     );
3261     HRESULT GetTextureStageState(
3262         [in] DWORD stage,
3263         [in] WINED3DTEXTURESTAGESTATETYPE state,
3264         [out] DWORD *value
3265     );
3266     HRESULT SetTransform(
3267         [in] WINED3DTRANSFORMSTATETYPE state,
3268         [in] const WINED3DMATRIX *matrix
3269     );
3270     HRESULT GetTransform(
3271         [in] WINED3DTRANSFORMSTATETYPE state,
3272         [out] WINED3DMATRIX *matrix
3273     );
3274     HRESULT SetVertexDeclaration(
3275         [in] IWineD3DVertexDeclaration *declaration
3276     );
3277     HRESULT GetVertexDeclaration(
3278         [out] IWineD3DVertexDeclaration **declaration
3279     );
3280     HRESULT SetVertexShader(
3281         [in] IWineD3DVertexShader *shader
3282     );
3283     HRESULT GetVertexShader(
3284         [out] IWineD3DVertexShader **shader
3285     );
3286     HRESULT SetVertexShaderConstantB(
3287         [in] UINT start_register,
3288         [in] const BOOL *constants,
3289         [in] UINT bool_count
3290     );
3291     HRESULT GetVertexShaderConstantB(
3292         [in] UINT start_register,
3293         [out] BOOL *constants,
3294         [in] UINT bool_count
3295     );
3296     HRESULT SetVertexShaderConstantI(
3297         [in] UINT start_register,
3298         [in] const int *constants,
3299         [in] UINT vector4i_count
3300     );
3301     HRESULT GetVertexShaderConstantI(
3302         [in] UINT start_register,
3303         [out] int *constants,
3304         [in] UINT vector4i_count
3305     );
3306     HRESULT SetVertexShaderConstantF(
3307         [in] UINT start_register,
3308         [in] const float *constants,
3309         [in] UINT vector4f_count
3310     );
3311     HRESULT GetVertexShaderConstantF(
3312         [in] UINT start_register,
3313         [out] float *constants,
3314         [in] UINT vector4f_count
3315     );
3316     HRESULT SetViewport(
3317         [in] const WINED3DVIEWPORT *viewport
3318     );
3319     HRESULT GetViewport(
3320         [out] WINED3DVIEWPORT *viewport
3321     );
3322     HRESULT MultiplyTransform(
3323         [in] WINED3DTRANSFORMSTATETYPE state,
3324         [in] const WINED3DMATRIX *matrix
3325     );
3326     HRESULT ValidateDevice(
3327         [out] DWORD *num_passes
3328     );
3329     HRESULT ProcessVertices(
3330         [in] UINT src_start_idx,
3331         [in] UINT dst_idx,
3332         [in] UINT vertex_count,
3333         [in] IWineD3DVertexBuffer *dest_buffer,
3334         [in] IWineD3DVertexDeclaration *declaration,
3335         [in] DWORD flags
3336     );
3337     HRESULT BeginStateBlock(
3338     );
3339     HRESULT EndStateBlock(
3340         [out] IWineD3DStateBlock **stateblock
3341     );
3342     HRESULT BeginScene(
3343     );
3344     HRESULT EndScene(
3345     );
3346     HRESULT Present(
3347         [in] const RECT *src_rect,
3348         [in] const RECT *dst_rect,
3349         [in] HWND dst_window_override,
3350         [in] const RGNDATA *dirty_region
3351     );
3352     HRESULT Clear(
3353         [in] DWORD rect_count,
3354         [in] const WINED3DRECT *rects,
3355         [in] DWORD flags,
3356         [in] WINED3DCOLOR color,
3357         [in] float z,
3358         [in] DWORD stencil
3359     );
3360     HRESULT DrawPrimitive(
3361         [in] WINED3DPRIMITIVETYPE primitive_type,
3362         [in] UINT start_vertex,
3363         [in] UINT primitive_count
3364     );
3365     HRESULT DrawIndexedPrimitive(
3366         [in] WINED3DPRIMITIVETYPE primitive_type,
3367         [in] UINT min_vertex_idx,
3368         [in] UINT vertex_count,
3369         [in] UINT start_idx,
3370         [in] UINT primitive_count
3371     );
3372     HRESULT DrawPrimitiveUP(
3373         [in] WINED3DPRIMITIVETYPE primitive_type,
3374         [in] UINT primitive_count,
3375         [in] const void *stream_data,
3376         [in] UINT stream_stride
3377     );
3378     HRESULT DrawIndexedPrimitiveUP(
3379         [in] WINED3DPRIMITIVETYPE primitive_type,
3380         [in] UINT min_vertex_idx,
3381         [in] UINT vertex_count,
3382         [in] UINT primitive_count,
3383         [in] const void *index_data,
3384         [in] WINED3DFORMAT index_data_format,
3385         [in] const void *stream_data,
3386         [in] UINT stream_stride
3387     );
3388     HRESULT DrawPrimitiveStrided(
3389         [in] WINED3DPRIMITIVETYPE primitive_type,
3390         [in] UINT primitive_count,
3391         [in] const WineDirect3DVertexStridedData *strided_data
3392     );
3393     HRESULT DrawIndexedPrimitiveStrided(
3394         [in] WINED3DPRIMITIVETYPE primitive_type,
3395         [in] UINT primitive_count,
3396         [in] const WineDirect3DVertexStridedData *strided_data,
3397         [in] UINT vertex_count,
3398         [in] const void *index_data,
3399         [in] WINED3DFORMAT index_data_format
3400     );
3401     HRESULT DrawRectPatch(
3402         [in] UINT handle,
3403         [in] const float *num_segs,
3404         [in] const WINED3DRECTPATCH_INFO *rect_patch_info
3405     );
3406     HRESULT DrawTriPatch(
3407         [in] UINT handle,
3408         [in] const float *num_segs,
3409         [in] const WINED3DTRIPATCH_INFO *tri_patch_info
3410     );
3411     HRESULT DeletePatch(
3412         [in] UINT handle
3413     );
3414     HRESULT ColorFill(
3415         [in] IWineD3DSurface *surface,
3416         [in] const WINED3DRECT *rect,
3417         [in] WINED3DCOLOR color
3418     );
3419     HRESULT UpdateTexture(
3420         [in] IWineD3DBaseTexture *src_texture,
3421         [in] IWineD3DBaseTexture *dst_texture
3422     );
3423     HRESULT UpdateSurface(
3424         [in] IWineD3DSurface *src_surface,
3425         [in] const RECT *src_rect,
3426         [in] IWineD3DSurface *dst_surface,
3427         [in] const POINT *dst_point
3428     );
3429     HRESULT GetFrontBufferData(
3430         [in] UINT swapchain_idx,
3431         [in] IWineD3DSurface *dst_surface
3432     );
3433     void ResourceReleased(
3434         [in] IWineD3DResource *resource
3435     );
3436     HRESULT EnumResources(
3437         [in] D3DCB_ENUMRESOURCES callback,
3438         [in] void *data
3439     );
3440 }
3441
3442 IWineD3D *WineDirect3DCreate(UINT dxVersion, IUnknown *parent);
3443 IWineD3DClipper *WineDirect3DCreateClipper(IUnknown *parent);