Server reorganization:
[wine] / include / d3d.h
1 #ifndef __WINE_D3D_H
2 #define __WINE_D3D_H
3
4 #include "ddraw.h"
5
6 /* This is needed for GL_LIGHT */
7 #include "wine_gl.h"
8
9 /*****************************************************************************
10  * Predeclare the interfaces
11  */
12 DEFINE_GUID(IID_IDirect3D,              0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
13 DEFINE_GUID(IID_IDirect3D2,             0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
14
15 DEFINE_GUID(IID_IDirect3DRampDevice,    0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
16 DEFINE_GUID(IID_IDirect3DRGBDevice,     0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
17 DEFINE_GUID(IID_IDirect3DHALDevice,     0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
18 DEFINE_GUID(IID_IDirect3DMMXDevice,     0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
19
20 DEFINE_GUID(IID_IDirect3DDevice,        0x64108800,0x957d,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29 );
21 DEFINE_GUID(IID_IDirect3DDevice2,       0x93281501,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
22 DEFINE_GUID(IID_IDirect3DTexture,       0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56);
23 DEFINE_GUID(IID_IDirect3DTexture2,      0x93281502,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
24 DEFINE_GUID(IID_IDirect3DLight,         0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
25 DEFINE_GUID(IID_IDirect3DMaterial,      0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
26 DEFINE_GUID(IID_IDirect3DMaterial2,     0x93281503,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
27 DEFINE_GUID(IID_IDirect3DExecuteBuffer, 0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
28 DEFINE_GUID(IID_IDirect3DViewport,      0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E);
29 DEFINE_GUID(IID_IDirect3DViewport2,     0x93281500,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
30
31 typedef struct IDirect3D        IDirect3D ,*LPDIRECT3D ;
32 typedef struct IDirect3D2       IDirect3D2,*LPDIRECT3D2;
33 typedef struct IDirect3DLight   IDirect3DLight,*LPDIRECT3DLIGHT;
34 typedef struct IDirect3DDevice        IDirect3DDevice, *LPDIRECT3DDEVICE;
35 typedef struct IDirect3DDevice2       IDirect3DDevice2, *LPDIRECT3DDEVICE2;
36 typedef struct IDirect3DViewport2     IDirect3DViewport, IDirect3DViewport2, *LPDIRECT3DVIEWPORT2, *LPDIRECT3DVIEWPORT;
37 typedef struct IDirect3DMaterial2     IDirect3DMaterial, *LPDIRECT3DMATERIAL, IDirect3DMaterial2, *LPDIRECT3DMATERIAL2;
38 typedef struct IDirect3DTexture2      IDirect3DTexture, *LPDIRECT3DTEXTURE, IDirect3DTexture2,  *LPDIRECT3DTEXTURE2;
39 typedef struct IDirect3DExecuteBuffer IDirect3DExecuteBuffer, *LPDIRECT3DEXECUTEBUFFER;
40
41
42 /* ********************************************************************
43    Error Codes
44    ******************************************************************** */
45 #define D3D_OK                          DD_OK
46 #define D3DERR_BADMAJORVERSION          MAKE_DDHRESULT(700)
47 #define D3DERR_BADMINORVERSION          MAKE_DDHRESULT(701)
48 #define D3DERR_INVALID_DEVICE           MAKE_DDHRESULT(705)
49 #define D3DERR_INITFAILED               MAKE_DDHRESULT(706)
50 #define D3DERR_DEVICEAGGREGATED         MAKE_DDHRESULT(707)
51 #define D3DERR_EXECUTE_CREATE_FAILED    MAKE_DDHRESULT(710)
52 #define D3DERR_EXECUTE_DESTROY_FAILED   MAKE_DDHRESULT(711)
53 #define D3DERR_EXECUTE_LOCK_FAILED      MAKE_DDHRESULT(712)
54 #define D3DERR_EXECUTE_UNLOCK_FAILED    MAKE_DDHRESULT(713)
55 #define D3DERR_EXECUTE_LOCKED           MAKE_DDHRESULT(714)
56 #define D3DERR_EXECUTE_NOT_LOCKED       MAKE_DDHRESULT(715)
57 #define D3DERR_EXECUTE_FAILED           MAKE_DDHRESULT(716)
58 #define D3DERR_EXECUTE_CLIPPED_FAILED   MAKE_DDHRESULT(717)
59 #define D3DERR_TEXTURE_NO_SUPPORT       MAKE_DDHRESULT(720)
60 #define D3DERR_TEXTURE_CREATE_FAILED    MAKE_DDHRESULT(721)
61 #define D3DERR_TEXTURE_DESTROY_FAILED   MAKE_DDHRESULT(722)
62 #define D3DERR_TEXTURE_LOCK_FAILED      MAKE_DDHRESULT(723)
63 #define D3DERR_TEXTURE_UNLOCK_FAILED    MAKE_DDHRESULT(724)
64 #define D3DERR_TEXTURE_LOAD_FAILED      MAKE_DDHRESULT(725)
65 #define D3DERR_TEXTURE_SWAP_FAILED      MAKE_DDHRESULT(726)
66 #define D3DERR_TEXTURE_LOCKED           MAKE_DDHRESULT(727)
67 #define D3DERR_TEXTURE_NOT_LOCKED       MAKE_DDHRESULT(728)
68 #define D3DERR_TEXTURE_GETSURF_FAILED   MAKE_DDHRESULT(729)
69 #define D3DERR_MATRIX_CREATE_FAILED     MAKE_DDHRESULT(730)
70 #define D3DERR_MATRIX_DESTROY_FAILED    MAKE_DDHRESULT(731)
71 #define D3DERR_MATRIX_SETDATA_FAILED    MAKE_DDHRESULT(732)
72 #define D3DERR_MATRIX_GETDATA_FAILED    MAKE_DDHRESULT(733)
73 #define D3DERR_SETVIEWPORTDATA_FAILED   MAKE_DDHRESULT(734)
74 #define D3DERR_INVALIDCURRENTVIEWPORT   MAKE_DDHRESULT(735)
75 #define D3DERR_INVALIDPRIMITIVETYPE     MAKE_DDHRESULT(736)
76 #define D3DERR_INVALIDVERTEXTYPE        MAKE_DDHRESULT(737)
77 #define D3DERR_TEXTURE_BADSIZE          MAKE_DDHRESULT(738)
78 #define D3DERR_INVALIDRAMPTEXTURE       MAKE_DDHRESULT(739)
79 #define D3DERR_MATERIAL_CREATE_FAILED   MAKE_DDHRESULT(740)
80 #define D3DERR_MATERIAL_DESTROY_FAILED  MAKE_DDHRESULT(741)
81 #define D3DERR_MATERIAL_SETDATA_FAILED  MAKE_DDHRESULT(742)
82 #define D3DERR_MATERIAL_GETDATA_FAILED  MAKE_DDHRESULT(743)
83 #define D3DERR_INVALIDPALETTE           MAKE_DDHRESULT(744)
84 #define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
85 #define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  MAKE_DDHRESULT(746)
86 #define D3DERR_SURFACENOTINVIDMEM       MAKE_DDHRESULT(747)
87 #define D3DERR_LIGHT_SET_FAILED         MAKE_DDHRESULT(750)
88 #define D3DERR_LIGHTHASVIEWPORT         MAKE_DDHRESULT(751)
89 #define D3DERR_LIGHTNOTINTHISVIEWPORT   MAKE_DDHRESULT(752)
90 #define D3DERR_SCENE_IN_SCENE           MAKE_DDHRESULT(760)
91 #define D3DERR_SCENE_NOT_IN_SCENE       MAKE_DDHRESULT(761)
92 #define D3DERR_SCENE_BEGIN_FAILED       MAKE_DDHRESULT(762)
93 #define D3DERR_SCENE_END_FAILED         MAKE_DDHRESULT(763)
94 #define D3DERR_INBEGIN                  MAKE_DDHRESULT(770)
95 #define D3DERR_NOTINBEGIN               MAKE_DDHRESULT(771)
96 #define D3DERR_NOVIEWPORTS              MAKE_DDHRESULT(772)
97 #define D3DERR_VIEWPORTDATANOTSET       MAKE_DDHRESULT(773)
98 #define D3DERR_VIEWPORTHASNODEVICE      MAKE_DDHRESULT(774)
99 #define D3DERR_NOCURRENTVIEWPORT        MAKE_DDHRESULT(775)
100
101 /* ********************************************************************
102    Enums
103    ******************************************************************** */
104 #define D3DNEXT_NEXT 0x01l
105 #define D3DNEXT_HEAD 0x02l
106 #define D3DNEXT_TAIL 0x04l
107
108 typedef enum {
109   D3DLIGHT_POINT          = 1,
110   D3DLIGHT_SPOT           = 2,
111   D3DLIGHT_DIRECTIONAL    = 3,
112   D3DLIGHT_PARALLELPOINT  = 4,
113   D3DLIGHT_FORCE_DWORD    = 0x7fffffff
114 } D3DLIGHTTYPE;
115
116 typedef enum {
117   D3DPT_POINTLIST     = 1,
118   D3DPT_LINELIST      = 2,
119   D3DPT_LINESTRIP     = 3,
120   D3DPT_TRIANGLELIST  = 4,
121   D3DPT_TRIANGLESTRIP = 5,
122   D3DPT_TRIANGLEFAN   = 6,
123   D3DPT_FORCE_DWORD   = 0x7fffffff
124 } D3DPRIMITIVETYPE;
125
126 typedef enum { 
127   D3DFILL_POINT         = 1, 
128   D3DFILL_WIREFRAME     = 2, 
129   D3DFILL_SOLID         = 3,
130   D3DFILL_FORCE_DWORD   = 0x7fffffff
131 } D3DFILLMODE; 
132
133 typedef enum { 
134   D3DSHADE_FLAT         = 1, 
135   D3DSHADE_GOURAUD      = 2, 
136   D3DSHADE_PHONG        = 3, 
137   D3DSHADE_FORCE_DWORD  = 0x7fffffff
138 } D3DSHADEMODE;
139
140 typedef enum { 
141   D3DCULL_NONE        = 1, 
142   D3DCULL_CW          = 2, 
143   D3DCULL_CCW         = 3, 
144   D3DCULL_FORCE_DWORD = 0x7fffffff 
145 } D3DCULL; 
146
147 typedef enum { 
148   D3DBLEND_ZERO            = 1, 
149   D3DBLEND_ONE             = 2, 
150   D3DBLEND_SRCCOLOR        = 3, 
151   D3DBLEND_INVSRCCOLOR     = 4, 
152   D3DBLEND_SRCALPHA        = 5, 
153   D3DBLEND_INVSRCALPHA     = 6, 
154   D3DBLEND_DESTALPHA       = 7, 
155   D3DBLEND_INVDESTALPHA    = 8, 
156   D3DBLEND_DESTCOLOR       = 9, 
157   D3DBLEND_INVDESTCOLOR    = 10, 
158   D3DBLEND_SRCALPHASAT     = 11, 
159   D3DBLEND_BOTHSRCALPHA    = 12, 
160   D3DBLEND_BOTHINVSRCALPHA = 13, 
161   D3DBLEND_FORCE_DWORD     = 0x7fffffff
162 } D3DBLEND; 
163
164 typedef enum { 
165   D3DTBLEND_DECAL         = 1, 
166   D3DTBLEND_MODULATE      = 2, 
167   D3DTBLEND_DECALALPHA    = 3, 
168   D3DTBLEND_MODULATEALPHA = 4, 
169   D3DTBLEND_DECALMASK     = 5, 
170   D3DTBLEND_MODULATEMASK  = 6, 
171   D3DTBLEND_COPY          = 7, 
172   D3DTBLEND_ADD           = 8, 
173   D3DTBLEND_FORCE_DWORD   = 0x7fffffff
174 } D3DTEXTUREBLEND;
175
176 typedef enum { 
177   D3DFILTER_NEAREST          = 1, 
178   D3DFILTER_LINEAR           = 2, 
179   D3DFILTER_MIPNEAREST       = 3, 
180   D3DFILTER_MIPLINEAR        = 4, 
181   D3DFILTER_LINEARMIPNEAREST = 5, 
182   D3DFILTER_LINEARMIPLINEAR  = 6, 
183   D3DFILTER_FORCE_DWORD      = 0x7fffffff
184 } D3DTEXTUREFILTER;
185
186 typedef enum {
187   D3DRENDERSTATE_TEXTUREHANDLE      = 1,    /* Texture handle */
188   D3DRENDERSTATE_ANTIALIAS          = 2,    /* D3DANTIALIASMODE */
189   D3DRENDERSTATE_TEXTUREADDRESS     = 3,    /* D3DTEXTUREADDRESS      */
190   D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,    /* TRUE for perspective correction */
191   D3DRENDERSTATE_WRAPU              = 5,    /* TRUE for wrapping in u */
192   D3DRENDERSTATE_WRAPV              = 6,    /* TRUE for wrapping in v */
193   D3DRENDERSTATE_ZENABLE            = 7,    /* TRUE to enable z test */
194   D3DRENDERSTATE_FILLMODE           = 8,    /* D3DFILL_MODE            */
195   D3DRENDERSTATE_SHADEMODE          = 9,    /* D3DSHADEMODE */
196   D3DRENDERSTATE_LINEPATTERN        = 10,   /* D3DLINEPATTERN */
197   D3DRENDERSTATE_MONOENABLE         = 11,   /* TRUE to enable mono rasterization */
198   D3DRENDERSTATE_ROP2               = 12,   /* ROP2 */
199   D3DRENDERSTATE_PLANEMASK          = 13,   /* DWORD physical plane mask */
200   D3DRENDERSTATE_ZWRITEENABLE       = 14,   /* TRUE to enable z writes */
201   D3DRENDERSTATE_ALPHATESTENABLE    = 15,   /* TRUE to enable alpha tests */
202   D3DRENDERSTATE_LASTPIXEL          = 16,   /* TRUE for last-pixel on lines */
203   D3DRENDERSTATE_TEXTUREMAG         = 17,   /* D3DTEXTUREFILTER */
204   D3DRENDERSTATE_TEXTUREMIN         = 18,   /* D3DTEXTUREFILTER */
205   D3DRENDERSTATE_SRCBLEND           = 19,   /* D3DBLEND */
206   D3DRENDERSTATE_DESTBLEND          = 20,   /* D3DBLEND */
207   D3DRENDERSTATE_TEXTUREMAPBLEND    = 21,   /* D3DTEXTUREBLEND */
208   D3DRENDERSTATE_CULLMODE           = 22,   /* D3DCULL */
209   D3DRENDERSTATE_ZFUNC              = 23,   /* D3DCMPFUNC */
210   D3DRENDERSTATE_ALPHAREF           = 24,   /* D3DFIXED */
211   D3DRENDERSTATE_ALPHAFUNC          = 25,   /* D3DCMPFUNC */
212   D3DRENDERSTATE_DITHERENABLE       = 26,   /* TRUE to enable dithering */
213   D3DRENDERSTATE_ALPHABLENDENABLE   = 27,   /* TRUE to enable alpha blending */
214   D3DRENDERSTATE_FOGENABLE          = 28,   /* TRUE to enable fog */
215   D3DRENDERSTATE_SPECULARENABLE     = 29,   /* TRUE to enable specular */
216   D3DRENDERSTATE_ZVISIBLE           = 30,   /* TRUE to enable z checking */
217   D3DRENDERSTATE_SUBPIXEL           = 31,   /* TRUE to enable subpixel correction */
218   D3DRENDERSTATE_SUBPIXELX          = 32,   /* TRUE to enable correction in X only */
219   D3DRENDERSTATE_STIPPLEDALPHA      = 33,   /* TRUE to enable stippled alpha */
220   D3DRENDERSTATE_FOGCOLOR           = 34,   /* D3DCOLOR */
221   D3DRENDERSTATE_FOGTABLEMODE       = 35,   /* D3DFOGMODE */
222   D3DRENDERSTATE_FOGTABLESTART      = 36,   /* Fog table start        */
223   D3DRENDERSTATE_FOGTABLEEND        = 37,   /* Fog table end          */
224   D3DRENDERSTATE_FOGTABLEDENSITY    = 38,   /* Fog table density      */
225   D3DRENDERSTATE_STIPPLEENABLE      = 39,   /* TRUE to enable stippling */
226   D3DRENDERSTATE_EDGEANTIALIAS      = 40,   /* TRUE to enable edge antialiasing */
227   D3DRENDERSTATE_COLORKEYENABLE     = 41,   /* TRUE to enable source colorkeyed textures */
228   D3DRENDERSTATE_BORDERCOLOR        = 43,   /* Border color for texturing w/border */
229   D3DRENDERSTATE_TEXTUREADDRESSU    = 44,   /* Texture addressing mode for U coordinate */
230   D3DRENDERSTATE_TEXTUREADDRESSV    = 45,   /* Texture addressing mode for V coordinate */
231   D3DRENDERSTATE_MIPMAPLODBIAS      = 46,   /* D3DVALUE Mipmap LOD bias */
232   D3DRENDERSTATE_ZBIAS              = 47,   /* LONG Z bias */
233   D3DRENDERSTATE_RANGEFOGENABLE     = 48,   /* Enables range-based fog */
234   D3DRENDERSTATE_ANISOTROPY         = 49,   /* Max. anisotropy. 1 = no anisotropy */
235   D3DRENDERSTATE_FLUSHBATCH         = 50,   /* Explicit flush for DP batching (DX5 Only) */
236   D3DRENDERSTATE_STIPPLEPATTERN00   = 64,   /* Stipple pattern 01...  */
237   D3DRENDERSTATE_STIPPLEPATTERN01   = 65,
238   D3DRENDERSTATE_STIPPLEPATTERN02   = 66,
239   D3DRENDERSTATE_STIPPLEPATTERN03   = 67,
240   D3DRENDERSTATE_STIPPLEPATTERN04   = 68,
241   D3DRENDERSTATE_STIPPLEPATTERN05   = 69,
242   D3DRENDERSTATE_STIPPLEPATTERN06   = 70,
243   D3DRENDERSTATE_STIPPLEPATTERN07   = 71,
244   D3DRENDERSTATE_STIPPLEPATTERN08   = 72,
245   D3DRENDERSTATE_STIPPLEPATTERN09   = 73,
246   D3DRENDERSTATE_STIPPLEPATTERN10   = 74,
247   D3DRENDERSTATE_STIPPLEPATTERN11   = 75,
248   D3DRENDERSTATE_STIPPLEPATTERN12   = 76,
249   D3DRENDERSTATE_STIPPLEPATTERN13   = 77,
250   D3DRENDERSTATE_STIPPLEPATTERN14   = 78,
251   D3DRENDERSTATE_STIPPLEPATTERN15   = 79,
252   D3DRENDERSTATE_STIPPLEPATTERN16   = 80,
253   D3DRENDERSTATE_STIPPLEPATTERN17   = 81,
254   D3DRENDERSTATE_STIPPLEPATTERN18   = 82,
255   D3DRENDERSTATE_STIPPLEPATTERN19   = 83,
256   D3DRENDERSTATE_STIPPLEPATTERN20   = 84,
257   D3DRENDERSTATE_STIPPLEPATTERN21   = 85,
258   D3DRENDERSTATE_STIPPLEPATTERN22   = 86,
259   D3DRENDERSTATE_STIPPLEPATTERN23   = 87,
260   D3DRENDERSTATE_STIPPLEPATTERN24   = 88,
261   D3DRENDERSTATE_STIPPLEPATTERN25   = 89,
262   D3DRENDERSTATE_STIPPLEPATTERN26   = 90,
263   D3DRENDERSTATE_STIPPLEPATTERN27   = 91,
264   D3DRENDERSTATE_STIPPLEPATTERN28   = 92,
265   D3DRENDERSTATE_STIPPLEPATTERN29   = 93,
266   D3DRENDERSTATE_STIPPLEPATTERN30   = 94,
267   D3DRENDERSTATE_STIPPLEPATTERN31   = 95,
268   D3DRENDERSTATE_FORCE_DWORD        = 0x7fffffff /* force 32-bit size enum */
269 } D3DRENDERSTATETYPE;
270
271 typedef enum { 
272   D3DCMP_NEVER        = 1, 
273   D3DCMP_LESS         = 2, 
274   D3DCMP_EQUAL        = 3, 
275   D3DCMP_LESSEQUAL    = 4, 
276   D3DCMP_GREATER      = 5, 
277   D3DCMP_NOTEQUAL     = 6, 
278   D3DCMP_GREATEREQUAL = 7, 
279   D3DCMP_ALWAYS       = 8, 
280   D3DCMP_FORCE_DWORD  = 0x7fffffff
281 } D3DCMPFUNC; 
282
283 typedef enum {
284   D3DLIGHTSTATE_MATERIAL      = 1,
285   D3DLIGHTSTATE_AMBIENT       = 2,
286   D3DLIGHTSTATE_COLORMODEL    = 3,
287   D3DLIGHTSTATE_FOGMODE       = 4,
288   D3DLIGHTSTATE_FOGSTART      = 5,
289   D3DLIGHTSTATE_FOGEND        = 6,
290   D3DLIGHTSTATE_FOGDENSITY    = 7,
291   D3DLIGHTSTATE_FORCE_DWORD   = 0x7fffffff /* force 32-bit size enum */
292 } D3DLIGHTSTATETYPE;
293
294 typedef enum {
295   D3DVT_VERTEX        = 1,
296   D3DVT_LVERTEX       = 2,
297   D3DVT_TLVERTEX      = 3,
298   D3DVT_FORCE_DWORD   = 0x7fffffff /* force 32-bit size enum */
299 } D3DVERTEXTYPE;
300
301 typedef enum {
302   D3DTRANSFORMSTATE_WORLD           = 1,
303   D3DTRANSFORMSTATE_VIEW            = 2,
304   D3DTRANSFORMSTATE_PROJECTION      = 3,
305   D3DTRANSFORMSTATE_FORCE_DWORD     = 0x7fffffff /* force 32-bit size enum */
306 } D3DTRANSFORMSTATETYPE;
307
308 /* ********************************************************************
309    Types and structures
310    ******************************************************************** */
311 typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
312 typedef DWORD D3DTEXTUREHANDLE,  *LPD3DTEXTUREHANDLE;
313 typedef DWORD D3DVIEWPORTHANDLE, *LPD3DVIEWPORTHANDLE;
314 typedef DWORD D3DMATRIXHANDLE,   *LPD3DMATRIXHANDLE;
315
316 typedef DWORD D3DCOLOR, *LPD3DCOLOR;
317
318 typedef struct {
319         DWORD   dwSize;
320         DWORD   dwCaps;
321 } D3DTRANSFORMCAPS,*LPD3DTRANSFORMCAPS;
322
323 #define D3DTRANSFORMCAPS_CLIP   0x00000001
324
325 typedef struct {
326         DWORD   dwSize;
327         DWORD   dwCaps;
328         DWORD   dwLightingModel;
329         DWORD   dwNumLights;
330 } D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
331
332 #define D3DLIGHTINGMODEL_RGB            0x00000001
333 #define D3DLIGHTINGMODEL_MONO           0x00000002
334
335 #define D3DLIGHTCAPS_POINT              0x00000001
336 #define D3DLIGHTCAPS_SPOT               0x00000002
337 #define D3DLIGHTCAPS_DIRECTIONAL        0x00000004
338 #define D3DLIGHTCAPS_PARALLELPOINT      0x00000008
339
340
341 #define D3DCOLOR_MONO   1
342 #define D3DCOLOR_RGB    2
343
344 typedef DWORD D3DCOLORMODEL;
345
346 typedef struct {
347     DWORD dwSize;
348     DWORD dwMiscCaps;                 /* Capability flags */
349     DWORD dwRasterCaps;
350     DWORD dwZCmpCaps;
351     DWORD dwSrcBlendCaps;
352     DWORD dwDestBlendCaps;
353     DWORD dwAlphaCmpCaps;
354     DWORD dwShadeCaps;
355     DWORD dwTextureCaps;
356     DWORD dwTextureFilterCaps;
357     DWORD dwTextureBlendCaps;
358     DWORD dwTextureAddressCaps;
359     DWORD dwStippleWidth;             /* maximum width and height of */
360     DWORD dwStippleHeight;            /* of supported stipple (up to 32x32) */
361 } D3DPRIMCAPS, *LPD3DPRIMCAPS;
362
363 /* D3DPRIMCAPS.dwMiscCaps */
364 #define D3DPMISCCAPS_MASKPLANES         0x00000001
365 #define D3DPMISCCAPS_MASKZ              0x00000002
366 #define D3DPMISCCAPS_LINEPATTERNREP     0x00000004
367 #define D3DPMISCCAPS_CONFORMANT         0x00000008
368 #define D3DPMISCCAPS_CULLNONE           0x00000010
369 #define D3DPMISCCAPS_CULLCW             0x00000020
370 #define D3DPMISCCAPS_CULLCCW            0x00000040
371
372 /* D3DPRIMCAPS.dwRasterCaps */
373 #define D3DPRASTERCAPS_DITHER                   0x00000001
374 #define D3DPRASTERCAPS_ROP2                     0x00000002
375 #define D3DPRASTERCAPS_XOR                      0x00000004
376 #define D3DPRASTERCAPS_PAT                      0x00000008
377 #define D3DPRASTERCAPS_ZTEST                    0x00000010
378 #define D3DPRASTERCAPS_SUBPIXEL                 0x00000020
379 #define D3DPRASTERCAPS_SUBPIXELX                0x00000040
380 #define D3DPRASTERCAPS_FOGVERTEX                0x00000080
381 #define D3DPRASTERCAPS_FOGTABLE                 0x00000100
382 #define D3DPRASTERCAPS_STIPPLE                  0x00000200
383 #define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT   0x00000400
384 #define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800
385 #define D3DPRASTERCAPS_ANTIALIASEDGES           0x00001000
386 #define D3DPRASTERCAPS_MIPMAPLODBIAS            0x00002000
387 #define D3DPRASTERCAPS_ZBIAS                    0x00004000
388 #define D3DPRASTERCAPS_ZBUFFERLESSHSR           0x00008000
389 #define D3DPRASTERCAPS_FOGRANGE                 0x00010000
390 #define D3DPRASTERCAPS_ANISOTROPY               0x00020000
391
392 /* D3DPRIMCAPS.dwZCmpCaps and dwAlphaCmpCaps */
393 #define D3DPCMPCAPS_NEVER               0x00000001
394 #define D3DPCMPCAPS_LESS                0x00000002
395 #define D3DPCMPCAPS_EQUAL               0x00000004
396 #define D3DPCMPCAPS_LESSEQUAL           0x00000008
397 #define D3DPCMPCAPS_GREATER             0x00000010
398 #define D3DPCMPCAPS_NOTEQUAL            0x00000020
399 #define D3DPCMPCAPS_GREATEREQUAL        0x00000040
400 #define D3DPCMPCAPS_ALWAYS              0x00000080
401
402 /* D3DPRIMCAPS.dwSourceBlendCaps, dwDestBlendCaps */
403 #define D3DPBLENDCAPS_ZERO              0x00000001
404 #define D3DPBLENDCAPS_ONE               0x00000002
405 #define D3DPBLENDCAPS_SRCCOLOR          0x00000004
406 #define D3DPBLENDCAPS_INVSRCCOLOR       0x00000008
407 #define D3DPBLENDCAPS_SRCALPHA          0x00000010
408 #define D3DPBLENDCAPS_INVSRCALPHA       0x00000020
409 #define D3DPBLENDCAPS_DESTALPHA         0x00000040
410 #define D3DPBLENDCAPS_INVDESTALPHA      0x00000080
411 #define D3DPBLENDCAPS_DESTCOLOR         0x00000100
412 #define D3DPBLENDCAPS_INVDESTCOLOR      0x00000200
413 #define D3DPBLENDCAPS_SRCALPHASAT       0x00000400
414 #define D3DPBLENDCAPS_BOTHSRCALPHA      0x00000800
415 #define D3DPBLENDCAPS_BOTHINVSRCALPHA   0x00001000
416
417 /* D3DPRIMCAPS.dwShadeCaps */
418 #define D3DPSHADECAPS_COLORFLATMONO     0x00000001
419 #define D3DPSHADECAPS_COLORFLATRGB      0x00000002
420 #define D3DPSHADECAPS_COLORGOURAUDMONO  0x00000004
421 #define D3DPSHADECAPS_COLORGOURAUDRGB   0x00000008
422 #define D3DPSHADECAPS_COLORPHONGMONO    0x00000010
423 #define D3DPSHADECAPS_COLORPHONGRGB     0x00000020
424
425 #define D3DPSHADECAPS_SPECULARFLATMONO  0x00000040
426 #define D3DPSHADECAPS_SPECULARFLATRGB   0x00000080
427 #define D3DPSHADECAPS_SPECULARGOURAUDMONO       0x00000100
428 #define D3DPSHADECAPS_SPECULARGOURAUDRGB        0x00000200
429 #define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400
430 #define D3DPSHADECAPS_SPECULARPHONGRGB  0x00000800
431
432 #define D3DPSHADECAPS_ALPHAFLATBLEND    0x00001000
433 #define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000
434 #define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000
435 #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      0x00008000
436 #define D3DPSHADECAPS_ALPHAPHONGBLEND   0x00010000
437 #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED        0x00020000
438
439 #define D3DPSHADECAPS_FOGFLAT           0x00040000
440 #define D3DPSHADECAPS_FOGGOURAUD        0x00080000
441 #define D3DPSHADECAPS_FOGPHONG          0x00100000
442
443 /* D3DPRIMCAPS.dwTextureCaps */
444 #define D3DPTEXTURECAPS_PERSPECTIVE     0x00000001
445 #define D3DPTEXTURECAPS_POW2            0x00000002
446 #define D3DPTEXTURECAPS_ALPHA           0x00000004
447 #define D3DPTEXTURECAPS_TRANSPARENCY    0x00000008
448 #define D3DPTEXTURECAPS_BORDER          0x00000010
449 #define D3DPTEXTURECAPS_SQUAREONLY      0x00000020
450
451 /* D3DPRIMCAPS.dwTextureFilterCaps */
452 #define D3DPTFILTERCAPS_NEAREST         0x00000001
453 #define D3DPTFILTERCAPS_LINEAR          0x00000002
454 #define D3DPTFILTERCAPS_MIPNEAREST      0x00000004
455 #define D3DPTFILTERCAPS_MIPLINEAR       0x00000008
456 #define D3DPTFILTERCAPS_LINEARMIPNEAREST        0x00000010
457 #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020
458
459 /* D3DPRIMCAPS.dwTextureBlendCaps */
460 #define D3DPTBLENDCAPS_DECAL            0x00000001
461 #define D3DPTBLENDCAPS_MODULATE         0x00000002
462 #define D3DPTBLENDCAPS_DECALALPHA       0x00000004
463 #define D3DPTBLENDCAPS_MODULATEALPHA    0x00000008
464 #define D3DPTBLENDCAPS_DECALMASK        0x00000010
465 #define D3DPTBLENDCAPS_MODULATEMASK     0x00000020
466 #define D3DPTBLENDCAPS_COPY             0x00000040
467 #define D3DPTBLENDCAPS_ADD              0x00000080
468
469 /* D3DPRIMCAPS.dwTextureAddressCaps */
470 #define D3DPTADDRESSCAPS_WRAP           0x00000001
471 #define D3DPTADDRESSCAPS_MIRROR         0x00000002
472 #define D3DPTADDRESSCAPS_CLAMP          0x00000004
473 #define D3DPTADDRESSCAPS_BORDER         0x00000008
474 #define D3DPTADDRESSCAPS_INDEPENDENTUV  0x00000010
475
476
477 /* D3DDEVICEDESC.dwFlags */
478 #define D3DDD_COLORMODEL                0x00000001
479 #define D3DDD_DEVCAPS                   0x00000002
480 #define D3DDD_TRANSFORMCAPS             0x00000004
481 #define D3DDD_LIGHTINGCAPS              0x00000008
482 #define D3DDD_BCLIPPING                 0x00000010
483 #define D3DDD_LINECAPS                  0x00000020
484 #define D3DDD_TRICAPS                   0x00000040
485 #define D3DDD_DEVICERENDERBITDEPTH      0x00000080
486 #define D3DDD_DEVICEZBUFFERBITDEPTH     0x00000100
487 #define D3DDD_MAXBUFFERSIZE             0x00000200
488 #define D3DDD_MAXVERTEXCOUNT            0x00000400
489
490 /* D3DDEVICEDESC.dwDevCaps */
491 #define D3DDEVCAPS_FLOATTLVERTEX        0x00000001
492 #define D3DDEVCAPS_SORTINCREASINGZ      0x00000002
493 #define D3DDEVCAPS_SORTDECREASINGZ      0X00000004
494 #define D3DDEVCAPS_SORTEXACT            0x00000008
495 #define D3DDEVCAPS_EXECUTESYSTEMMEMORY  0x00000010
496 #define D3DDEVCAPS_EXECUTEVIDEOMEMORY   0x00000020
497 #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040
498 #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY  0x00000080
499 #define D3DDEVCAPS_TEXTURESYSTEMMEMORY  0x00000100
500 #define D3DDEVCAPS_TEXTUREVIDEOMEMORY   0x00000200
501 #define D3DDEVCAPS_DRAWPRIMTLVERTEX     0x00000400
502 #define D3DDEVCAPS_CANRENDERAFTERFLIP   0x00000800
503 #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000
504
505 typedef struct _D3DDeviceDesc {
506         DWORD           dwSize;
507         DWORD           dwFlags;
508         D3DCOLORMODEL   dcmColorModel;
509         DWORD           dwDevCaps;
510         D3DTRANSFORMCAPS dtcTransformCaps;
511         BOOL            bClipping;
512         D3DLIGHTINGCAPS dlcLightingCaps;
513         D3DPRIMCAPS     dpcLineCaps;
514         D3DPRIMCAPS     dpcTriCaps;
515         DWORD           dwDeviceRenderBitDepth;
516         DWORD           dwDeviceZBufferBitDepth;
517         DWORD           dwMaxBufferSize;
518         DWORD           dwMaxVertexCount;
519         /* *** New fields for DX5 *** */
520         DWORD           dwMinTextureWidth,dwMinTextureHeight;
521         DWORD           dwMaxTextureWidth,dwMaxTextureHeight;
522         DWORD           dwMinStippleWidth,dwMaxStippleWidth;
523         DWORD           dwMinStippleHeight,dwMaxStippleHeight;
524 } D3DDEVICEDESC,*LPD3DDEVICEDESC;
525  
526 typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid,LPSTR lpDeviceDescription,LPSTR lpDeviceName,LPD3DDEVICEDESC,LPD3DDEVICEDESC,LPVOID);
527 typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
528
529
530 /* dwflags for FindDevice */
531 #define D3DFDS_COLORMODEL               0x00000001
532 #define D3DFDS_GUID                     0x00000002
533 #define D3DFDS_HARDWARE                 0x00000004
534 #define D3DFDS_TRIANGLES                0x00000008
535 #define D3DFDS_LINES                    0x00000010
536 #define D3DFDS_MISCCAPS                 0x00000020
537 #define D3DFDS_RASTERCAPS               0x00000040
538 #define D3DFDS_ZCMPCAPS                 0x00000080
539 #define D3DFDS_ALPHACMPCAPS             0x00000100
540 #define D3DFDS_DSTBLENDCAPS             0x00000400
541 #define D3DFDS_SHADECAPS                0x00000800
542 #define D3DFDS_TEXTURECAPS              0x00001000
543 #define D3DFDS_TEXTUREFILTERCAPS        0x00002000
544 #define D3DFDS_TEXTUREBLENDCAPS         0x00004000
545 #define D3DFDS_TEXTUREADDRESSCAPS       0x00008000
546
547 typedef struct {
548     DWORD               dwSize;
549     DWORD               dwFlags;
550     BOOL                bHardware;
551     D3DCOLORMODEL       dcmColorModel;
552     GUID                guid;
553     DWORD               dwCaps;
554     D3DPRIMCAPS         dpcPrimCaps;
555 } D3DFINDDEVICESEARCH,*LPD3DFINDDEVICESEARCH;
556
557 typedef struct {
558     DWORD               dwSize;
559     GUID                guid;
560     D3DDEVICEDESC       ddHwDesc;
561     D3DDEVICEDESC       ddSwDesc;
562 } D3DFINDDEVICERESULT,*LPD3DFINDDEVICERESULT;
563
564 #define D3DVALP(val, prec)      ((float)(val))
565 #define D3DVAL(val)             ((float)(val))
566 typedef float D3DVALUE,*LPD3DVALUE;
567 #define D3DDivide(a, b)         (float)((double) (a) / (double) (b))
568 #define D3DMultiply(a, b)       ((a) * (b))
569
570 typedef struct {
571   DWORD         dwFlags;        /* Homogeneous clipping flags */
572         union {
573     D3DVALUE    hx;
574     D3DVALUE    dvHX;
575   } x;
576   union {
577     D3DVALUE    hy;
578     D3DVALUE    dvHY;
579   } y;
580   union {
581     D3DVALUE    hz;
582     D3DVALUE    dvHZ;
583   } z;
584 } D3DHVERTEX, *LPD3DHVERTEX;
585 /*
586  * Transformed/lit vertices
587  */
588 typedef struct {
589   union {
590     D3DVALUE    sx;             /* Screen coordinates */
591     D3DVALUE    dvSX;
592   } x;
593   union {
594     D3DVALUE    sy;
595     D3DVALUE    dvSY;
596   } y;
597   union {
598     D3DVALUE    sz;
599     D3DVALUE    dvSZ;
600   } z;
601   union {
602     D3DVALUE    rhw;            /* Reciprocal of homogeneous w */
603     D3DVALUE    dvRHW;
604   } r;
605   union {
606     D3DCOLOR    color;          /* Vertex color */
607     D3DCOLOR    dcColor;
608   } c;
609   union {
610     D3DCOLOR    specular;       /* Specular component of vertex */
611     D3DCOLOR    dcSpecular;
612   } s;
613   union {
614     D3DVALUE    tu;             /* Texture coordinates */
615     D3DVALUE    dvTU;
616   } u;
617   union {
618     D3DVALUE    tv;
619     D3DVALUE    dvTV;
620   } v;
621 } D3DTLVERTEX, *LPD3DTLVERTEX;
622 typedef struct {
623   union {
624     D3DVALUE     x;             /* Homogeneous coordinates */
625                 D3DVALUE dvX;
626         } x;
627         union {
628                 D3DVALUE y;
629                 D3DVALUE dvY;
630         } y;
631         union {
632                 D3DVALUE z;
633                 D3DVALUE dvZ;
634         } z;
635   DWORD            dwReserved;
636   union {
637     D3DCOLOR     color;         /* Vertex color */
638     D3DCOLOR     dcColor;
639   } c;
640   union {
641     D3DCOLOR     specular;      /* Specular component of vertex */
642     D3DCOLOR     dcSpecular;
643   } s;
644   union {
645     D3DVALUE     tu;            /* Texture coordinates */
646     D3DVALUE     dvTU;
647   } u;
648   union {
649     D3DVALUE     tv;
650     D3DVALUE     dvTV;
651   } v;
652 } D3DLVERTEX, *LPD3DLVERTEX;
653 typedef struct {
654   union {
655     D3DVALUE     x;             /* Homogeneous coordinates */
656     D3DVALUE     dvX;
657   } x;
658   union {
659     D3DVALUE     y;
660     D3DVALUE     dvY;
661   } y;
662   union {
663     D3DVALUE     z;
664     D3DVALUE     dvZ;
665   } z;
666   union {
667     D3DVALUE     nx;            /* Normal */
668     D3DVALUE     dvNX;
669   } nx;
670   union {
671     D3DVALUE     ny;
672     D3DVALUE     dvNY;
673   } ny;
674   union {
675     D3DVALUE     nz;
676     D3DVALUE     dvNZ;
677   } nz;
678   union {
679     D3DVALUE     tu;            /* Texture coordinates */
680     D3DVALUE     dvTU;
681   } u;
682   union {
683     D3DVALUE     tv;
684     D3DVALUE     dvTV;
685   } v;
686 } D3DVERTEX, *LPD3DVERTEX;
687
688 typedef struct {
689   union {
690     LONG x1;
691     LONG lX1;
692   } x1;
693   union {
694     LONG y1;
695     LONG lY1;
696   } y1;
697   union {
698     LONG x2;
699     LONG lX2;
700   } x2;
701   union {
702     LONG y2;
703     LONG lY2;
704   } y2;
705 } D3DRECT, *LPD3DRECT;
706
707 typedef struct {
708   union {
709         D3DVALUE        x;
710     D3DVALUE dvX;
711   } x;
712   union {
713         D3DVALUE        y;
714     D3DVALUE dvY;
715   } y;
716   union {
717         D3DVALUE        z;
718     D3DVALUE dvZ;
719   } z;
720   /* the c++ variant has operator overloads etc. too */
721 } D3DVECTOR,*LPD3DVECTOR;
722
723 typedef struct {
724   D3DVALUE        _11, _12, _13, _14;
725   D3DVALUE        _21, _22, _23, _24;
726   D3DVALUE        _31, _32, _33, _34;
727   D3DVALUE        _41, _42, _43, _44;
728 } D3DMATRIX, *LPD3DMATRIX;
729
730 typedef struct _D3DCOLORVALUE {
731         union {
732                 D3DVALUE r;
733                 D3DVALUE dvR;
734         } r;
735         union {
736                 D3DVALUE g;
737                 D3DVALUE dvG;
738         } g;
739         union {
740                 D3DVALUE b;
741                 D3DVALUE dvB;
742         } b;
743         union {
744                 D3DVALUE a;
745                 D3DVALUE dvA;
746         } a;
747 } D3DCOLORVALUE,*LPD3DCOLORVALUE;
748
749 typedef struct {
750     DWORD           dwSize;
751     D3DLIGHTTYPE    dltType;
752     D3DCOLORVALUE   dcvColor;
753     D3DVECTOR       dvPosition;         /* Position in world space */
754     D3DVECTOR       dvDirection;        /* Direction in world space */
755     D3DVALUE        dvRange;            /* Cutoff range */
756     D3DVALUE        dvFalloff;          /* Falloff */
757     D3DVALUE        dvAttenuation0;     /* Constant attenuation */
758     D3DVALUE        dvAttenuation1;     /* Linear attenuation */
759     D3DVALUE        dvAttenuation2;     /* Quadratic attenuation */
760     D3DVALUE        dvTheta;            /* Inner angle of spotlight cone */
761     D3DVALUE        dvPhi;              /* Outer angle of spotlight cone */
762 } D3DLIGHT,*LPD3DLIGHT;
763
764 /* flags bits */
765 #define D3DLIGHT_ACTIVE         0x00000001
766 #define D3DLIGHT_NO_SPECULAR    0x00000002
767
768 /* Textures */
769 typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
770
771
772 /* Statistics structure */
773 typedef struct {
774   DWORD        dwSize;
775   DWORD        dwTrianglesDrawn;
776   DWORD        dwLinesDrawn;
777   DWORD        dwPointsDrawn;
778   DWORD        dwSpansDrawn;
779   DWORD        dwVerticesProcessed;
780 } D3DSTATS, *LPD3DSTATS;
781
782 /* Clipping */
783 typedef struct _D3DCLIPSTATUS {
784   DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */
785   DWORD dwStatus; /* Clip status */
786   float minx, maxx; /* X extents */
787   float miny, maxy; /* Y extents */
788   float minz, maxz; /* Z extents */
789 } D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
790
791 typedef struct {
792   DWORD               dwSize;
793   union {
794     D3DCOLORVALUE   diffuse;        /* Diffuse color RGBA */
795     D3DCOLORVALUE   dcvDiffuse;
796   } a;
797   union {
798     D3DCOLORVALUE   ambient;        /* Ambient color RGB */
799     D3DCOLORVALUE   dcvAmbient;
800   } b;
801   union {
802     D3DCOLORVALUE   specular;       /* Specular 'shininess' */
803     D3DCOLORVALUE   dcvSpecular;
804   } c;
805   union {
806     D3DCOLORVALUE   emissive;       /* Emissive color RGB */
807     D3DCOLORVALUE   dcvEmissive;
808   } d;
809   union {
810     D3DVALUE        power;          /* Sharpness if specular highlight */
811     D3DVALUE        dvPower;
812   } e;
813   D3DTEXTUREHANDLE    hTexture;       /* Handle to texture map */
814   DWORD               dwRampSize;
815 } D3DMATERIAL, *LPD3DMATERIAL;
816
817 typedef struct {
818   D3DVECTOR dvPosition;  /* Lightable point in model space */
819   D3DVECTOR dvNormal;    /* Normalised unit vector */
820 } D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
821
822 typedef struct {
823   DWORD       dwSize;
824   DWORD       dwX;
825   DWORD       dwY;            /* Top left */
826   DWORD       dwWidth;
827   DWORD       dwHeight;       /* Dimensions */
828   D3DVALUE    dvScaleX;       /* Scale homogeneous to screen */
829   D3DVALUE    dvScaleY;       /* Scale homogeneous to screen */
830   D3DVALUE    dvMaxX;         /* Min/max homogeneous x coord */
831   D3DVALUE    dvMaxY;         /* Min/max homogeneous y coord */
832   D3DVALUE    dvMinZ;
833   D3DVALUE    dvMaxZ;         /* Min/max homogeneous z coord */
834 } D3DVIEWPORT, *LPD3DVIEWPORT;
835
836 typedef struct {
837   DWORD       dwSize;
838   DWORD       dwX;
839   DWORD       dwY;            /* Viewport Top left */
840   DWORD       dwWidth;
841   DWORD       dwHeight;       /* Viewport Dimensions */
842   D3DVALUE    dvClipX;        /* Top left of clip volume */
843   D3DVALUE    dvClipY;
844   D3DVALUE    dvClipWidth;    /* Clip Volume Dimensions */
845   D3DVALUE    dvClipHeight;
846   D3DVALUE    dvMinZ;         /* Min/max of clip Volume */
847   D3DVALUE    dvMaxZ;
848 } D3DVIEWPORT2, *LPD3DVIEWPORT2;
849
850 #define D3DTRANSFORM_CLIPPED       0x00000001l
851 #define D3DTRANSFORM_UNCLIPPED     0x00000002l
852
853 typedef struct {
854   DWORD           dwSize;
855   LPVOID          lpIn;           /* Input vertices */
856   DWORD           dwInSize;       /* Stride of input vertices */
857   LPVOID          lpOut;          /* Output vertices */
858   DWORD           dwOutSize;      /* Stride of output vertices */
859   LPD3DHVERTEX    lpHOut;         /* Output homogeneous vertices */
860   DWORD           dwClip;         /* Clipping hint */
861   DWORD           dwClipIntersection;
862   DWORD           dwClipUnion;    /* Union of all clip flags */
863   D3DRECT         drExtent;       /* Extent of transformed vertices */
864 } D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
865
866 /* flags bits */
867 #define D3DLIGHT_ACTIVE         0x00000001
868 #define D3DLIGHT_NO_SPECULAR    0x00000002
869
870 /* maximum valid light range */
871 #define D3DLIGHT_RANGE_MAX              ((float)sqrt(FLT_MAX))
872
873 typedef struct _D3DLIGHT2 {
874   DWORD           dwSize;
875   D3DLIGHTTYPE    dltType;            /* Type of light source */
876   D3DCOLORVALUE   dcvColor;           /* Color of light */
877   D3DVECTOR       dvPosition;         /* Position in world space */
878   D3DVECTOR       dvDirection;        /* Direction in world space */
879   D3DVALUE        dvRange;            /* Cutoff range */
880   D3DVALUE        dvFalloff;          /* Falloff */
881   D3DVALUE        dvAttenuation0;     /* Constant attenuation */
882   D3DVALUE        dvAttenuation1;     /* Linear attenuation */
883   D3DVALUE        dvAttenuation2;     /* Quadratic attenuation */
884   D3DVALUE        dvTheta;            /* Inner angle of spotlight cone */
885   D3DVALUE        dvPhi;              /* Outer angle of spotlight cone */
886   DWORD           dwFlags;
887 } D3DLIGHT2, *LPD3DLIGHT2;
888
889 typedef struct _D3DLIGHTDATA {
890   DWORD                dwSize;
891   LPD3DLIGHTINGELEMENT lpIn;          /* Input positions and normals */
892   DWORD                dwInSize;      /* Stride of input elements */
893   LPD3DTLVERTEX        lpOut;         /* Output colors */
894   DWORD                dwOutSize;     /* Stride of output colors */
895 } D3DLIGHTDATA, *LPD3DLIGHTDATA;
896
897 typedef struct _D3DPICKRECORD {
898   BYTE     bOpcode;
899   BYTE     bPad;
900   DWORD    dwOffset;
901   D3DVALUE dvZ;
902 } D3DPICKRECORD, *LPD3DPICKRECORD;
903
904
905 typedef struct _D3DExecuteBufferDesc { 
906   DWORD  dwSize; 
907   DWORD  dwFlags; 
908   DWORD  dwCaps; 
909   DWORD  dwBufferSize; 
910   LPVOID lpData; 
911 } D3DEXECUTEBUFFERDESC; 
912 typedef D3DEXECUTEBUFFERDESC *LPD3DEXECUTEBUFFERDESC; 
913
914 #define D3DDEB_BUFSIZE          0x00000001l     /* buffer size valid */
915 #define D3DDEB_CAPS             0x00000002l     /* caps valid */
916 #define D3DDEB_LPDATA           0x00000004l     /* lpData valid */
917
918 #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l     /* buffer in system memory */
919 #define D3DDEBCAPS_VIDEOMEMORY  0x00000002l     /* buffer in device memory */
920 #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
921
922 /*
923  * Values for d3d status.
924  */
925 #define D3DSTATUS_CLIPUNIONLEFT                 D3DCLIP_LEFT
926 #define D3DSTATUS_CLIPUNIONRIGHT                D3DCLIP_RIGHT
927 #define D3DSTATUS_CLIPUNIONTOP                  D3DCLIP_TOP
928 #define D3DSTATUS_CLIPUNIONBOTTOM               D3DCLIP_BOTTOM
929 #define D3DSTATUS_CLIPUNIONFRONT                D3DCLIP_FRONT
930 #define D3DSTATUS_CLIPUNIONBACK                 D3DCLIP_BACK
931 #define D3DSTATUS_CLIPUNIONGEN0                 D3DCLIP_GEN0
932 #define D3DSTATUS_CLIPUNIONGEN1                 D3DCLIP_GEN1
933 #define D3DSTATUS_CLIPUNIONGEN2                 D3DCLIP_GEN2
934 #define D3DSTATUS_CLIPUNIONGEN3                 D3DCLIP_GEN3
935 #define D3DSTATUS_CLIPUNIONGEN4                 D3DCLIP_GEN4
936 #define D3DSTATUS_CLIPUNIONGEN5                 D3DCLIP_GEN5
937
938 #define D3DSTATUS_CLIPINTERSECTIONLEFT          0x00001000L
939 #define D3DSTATUS_CLIPINTERSECTIONRIGHT         0x00002000L
940 #define D3DSTATUS_CLIPINTERSECTIONTOP           0x00004000L
941 #define D3DSTATUS_CLIPINTERSECTIONBOTTOM        0x00008000L
942 #define D3DSTATUS_CLIPINTERSECTIONFRONT         0x00010000L
943 #define D3DSTATUS_CLIPINTERSECTIONBACK          0x00020000L
944 #define D3DSTATUS_CLIPINTERSECTIONGEN0          0x00040000L
945 #define D3DSTATUS_CLIPINTERSECTIONGEN1          0x00080000L
946 #define D3DSTATUS_CLIPINTERSECTIONGEN2          0x00100000L
947 #define D3DSTATUS_CLIPINTERSECTIONGEN3          0x00200000L
948 #define D3DSTATUS_CLIPINTERSECTIONGEN4          0x00400000L
949 #define D3DSTATUS_CLIPINTERSECTIONGEN5          0x00800000L
950 #define D3DSTATUS_ZNOTVISIBLE                   0x01000000L
951
952 #define D3DSTATUS_CLIPUNIONALL  (               \
953             D3DSTATUS_CLIPUNIONLEFT     |       \
954             D3DSTATUS_CLIPUNIONRIGHT    |       \
955             D3DSTATUS_CLIPUNIONTOP      |       \
956             D3DSTATUS_CLIPUNIONBOTTOM   |       \
957             D3DSTATUS_CLIPUNIONFRONT    |       \
958             D3DSTATUS_CLIPUNIONBACK     |       \
959             D3DSTATUS_CLIPUNIONGEN0     |       \
960             D3DSTATUS_CLIPUNIONGEN1     |       \
961             D3DSTATUS_CLIPUNIONGEN2     |       \
962             D3DSTATUS_CLIPUNIONGEN3     |       \
963             D3DSTATUS_CLIPUNIONGEN4     |       \
964             D3DSTATUS_CLIPUNIONGEN5             \
965             )
966
967 #define D3DSTATUS_CLIPINTERSECTIONALL   (               \
968             D3DSTATUS_CLIPINTERSECTIONLEFT      |       \
969             D3DSTATUS_CLIPINTERSECTIONRIGHT     |       \
970             D3DSTATUS_CLIPINTERSECTIONTOP       |       \
971             D3DSTATUS_CLIPINTERSECTIONBOTTOM    |       \
972             D3DSTATUS_CLIPINTERSECTIONFRONT     |       \
973             D3DSTATUS_CLIPINTERSECTIONBACK      |       \
974             D3DSTATUS_CLIPINTERSECTIONGEN0      |       \
975             D3DSTATUS_CLIPINTERSECTIONGEN1      |       \
976             D3DSTATUS_CLIPINTERSECTIONGEN2      |       \
977             D3DSTATUS_CLIPINTERSECTIONGEN3      |       \
978             D3DSTATUS_CLIPINTERSECTIONGEN4      |       \
979             D3DSTATUS_CLIPINTERSECTIONGEN5              \
980             )
981
982 #define D3DSTATUS_DEFAULT       (                       \
983             D3DSTATUS_CLIPINTERSECTIONALL       |       \
984             D3DSTATUS_ZNOTVISIBLE)
985
986
987 typedef struct _D3DSTATUS { 
988   DWORD   dwFlags; 
989   DWORD   dwStatus; 
990   D3DRECT drExtent; 
991 } D3DSTATUS, *LPD3DSTATUS; 
992  
993
994 typedef struct _D3DEXECUTEDATA { 
995   DWORD     dwSize; 
996   DWORD     dwVertexOffset; 
997   DWORD     dwVertexCount; 
998   DWORD     dwInstructionOffset; 
999   DWORD     dwInstructionLength; 
1000   DWORD     dwHVertexOffset; 
1001   D3DSTATUS dsStatus; 
1002 } D3DEXECUTEDATA, *LPD3DEXECUTEDATA; 
1003
1004 typedef enum _D3DOPCODE { 
1005   D3DOP_POINT           = 1, 
1006   D3DOP_LINE            = 2, 
1007   D3DOP_TRIANGLE        = 3, 
1008   D3DOP_MATRIXLOAD      = 4, 
1009   D3DOP_MATRIXMULTIPLY  = 5, 
1010   D3DOP_STATETRANSFORM  = 6, 
1011   D3DOP_STATELIGHT      = 7, 
1012   D3DOP_STATERENDER     = 8, 
1013   D3DOP_PROCESSVERTICES = 9, 
1014   D3DOP_TEXTURELOAD     = 10, 
1015   D3DOP_EXIT            = 11, 
1016   D3DOP_BRANCHFORWARD   = 12, 
1017   D3DOP_SPAN            = 13, 
1018   D3DOP_SETSTATUS       = 14, 
1019   
1020   D3DOP_FORCE_DWORD     = 0x7fffffff 
1021 } D3DOPCODE; 
1022
1023 typedef struct _D3DPOINT { 
1024   WORD wCount; 
1025   WORD wFirst; 
1026 } D3DPOINT, *LPD3DPOINT; 
1027
1028 typedef struct _D3DLINE { 
1029   union { 
1030     WORD v1; 
1031     WORD wV1; 
1032   } v1; 
1033   union { 
1034     WORD v2; 
1035     WORD wV2; 
1036   } v2; 
1037 } D3DLINE, *LPD3DLINE; 
1038
1039 #define D3DTRIFLAG_START                        0x00000000L
1040 #define D3DTRIFLAG_STARTFLAT(len) (len)         /* 0 < len < 30 */
1041 #define D3DTRIFLAG_ODD                          0x0000001eL
1042 #define D3DTRIFLAG_EVEN                         0x0000001fL
1043
1044 #define D3DTRIFLAG_EDGEENABLE1                  0x00000100L /* v0-v1 edge */
1045 #define D3DTRIFLAG_EDGEENABLE2                  0x00000200L /* v1-v2 edge */
1046 #define D3DTRIFLAG_EDGEENABLE3                  0x00000400L /* v2-v0 edge */
1047 #define D3DTRIFLAG_EDGEENABLETRIANGLE \
1048         (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
1049
1050 typedef struct _D3DTRIANGLE { 
1051   union { 
1052     WORD v1; 
1053     WORD wV1; 
1054   } v1; 
1055   union { 
1056     WORD v2; 
1057     WORD wV2; 
1058   } v2; 
1059   union { 
1060     WORD v3; 
1061     WORD wV3; 
1062   } v3; 
1063   WORD     wFlags; 
1064 } D3DTRIANGLE, *LPD3DTRIANGLE; 
1065
1066 typedef struct _D3DMATRIXLOAD { 
1067   D3DMATRIXHANDLE hDestMatrix; 
1068   D3DMATRIXHANDLE hSrcMatrix; 
1069 } D3DMATRIXLOAD, *LPD3DMATRIXLOAD; 
1070
1071 typedef struct _D3DMATRIXMULTIPLY { 
1072   D3DMATRIXHANDLE hDestMatrix; 
1073   D3DMATRIXHANDLE hSrcMatrix1; 
1074   D3DMATRIXHANDLE hSrcMatrix2; 
1075 } D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY; 
1076
1077 typedef struct _D3DSTATE { 
1078   union { 
1079     D3DTRANSFORMSTATETYPE dtstTransformStateType; 
1080     D3DLIGHTSTATETYPE     dlstLightStateType; 
1081     D3DRENDERSTATETYPE    drstRenderStateType; 
1082   } t; 
1083   union { 
1084     DWORD                 dwArg[1]; 
1085     D3DVALUE              dvArg[1]; 
1086   } v; 
1087 } D3DSTATE, *LPD3DSTATE; 
1088
1089 #define D3DPROCESSVERTICES_TRANSFORMLIGHT       0x00000000L
1090 #define D3DPROCESSVERTICES_TRANSFORM            0x00000001L
1091 #define D3DPROCESSVERTICES_COPY                 0x00000002L
1092 #define D3DPROCESSVERTICES_OPMASK               0x00000007L
1093
1094 #define D3DPROCESSVERTICES_UPDATEEXTENTS        0x00000008L
1095 #define D3DPROCESSVERTICES_NOCOLOR              0x00000010L
1096
1097 typedef struct _D3DPROCESSVERTICES { 
1098   DWORD dwFlags; 
1099   WORD  wStart; 
1100   WORD  wDest; 
1101   DWORD dwCount; 
1102   DWORD dwReserved; 
1103 } D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES; 
1104
1105 typedef struct _D3DTEXTURELOAD { 
1106   D3DTEXTUREHANDLE hDestTexture; 
1107   D3DTEXTUREHANDLE hSrcTexture; 
1108 } D3DTEXTURELOAD, *LPD3DTEXTURELOAD; 
1109
1110 typedef struct _D3DBRANCH { 
1111   DWORD dwMask; 
1112   DWORD dwValue; 
1113   BOOL  bNegate; 
1114   DWORD dwOffset; 
1115 } D3DBRANCH, *LPD3DBRANCH; 
1116
1117 typedef struct _D3DSPAN { 
1118   WORD wCount; 
1119   WORD wFirst; 
1120 } D3DSPAN, *LPD3DSPAN; 
1121
1122 typedef struct _D3DINSTRUCTION { 
1123   BYTE bOpcode; 
1124   BYTE bSize; 
1125   WORD wCount; 
1126 } D3DINSTRUCTION, *LPD3DINSTRUCTION; 
1127
1128
1129 /*****************************************************************************
1130  * IDirect3D interface
1131  */
1132 #define ICOM_INTERFACE IDirect3D
1133 #define IDirect3D_METHODS \
1134     ICOM_METHOD1(HRESULT,Initialize,     REFIID,riid) \
1135     ICOM_METHOD2(HRESULT,EnumDevices,    LPD3DENUMDEVICESCALLBACK,lpEnumDevicesCallback, LPVOID,lpUserArg) \
1136     ICOM_METHOD2(HRESULT,CreateLight,    LPDIRECT3DLIGHT*,lplpDirect3DLight, IUnknown*,pUnkOuter) \
1137     ICOM_METHOD2(HRESULT,CreateMaterial, LPDIRECT3DMATERIAL*,lplpDirect3DMaterial, IUnknown*,pUnkOuter) \
1138     ICOM_METHOD2(HRESULT,CreateViewport, LPDIRECT3DVIEWPORT*,lplpD3DViewport, IUnknown*,pUnkOuter) \
1139     ICOM_METHOD2(HRESULT,FindDevice,     LPD3DFINDDEVICESEARCH,lpD3DDFS, LPD3DFINDDEVICERESULT,lplpD3DDevice)
1140 #define IDirect3D_IMETHODS \
1141     IUnknown_IMETHODS \
1142     IDirect3D_METHODS
1143 ICOM_DEFINE(IDirect3D,IUnknown)
1144 #undef ICOM_INTERFACE
1145
1146 #ifdef ICOM_CINTERFACE
1147         /*** IUnknown methods ***/
1148 #define IDirect3D_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1149 #define IDirect3D_AddRef(p)             ICOM_CALL (AddRef,p)
1150 #define IDirect3D_Release(p)            ICOM_CALL (Release,p)
1151         /*** IDirect3D methods ***/
1152 #define IDirect3D_Initialize(p,a)       ICOM_CALL2(Initialize,p,a)
1153 #define IDirect3D_EnumDevices(p,a,b)    ICOM_CALL2(EnumDevices,p,a,b)
1154 #define IDirect3D_CreateLight(p,a,b)    ICOM_CALL2(CreateLight,p,a,b)
1155 #define IDirect3D_CreateMaterial(p,a,b) ICOM_CALL2(CreateMaterial,p,a,b)
1156 #define IDirect3D_CreateViewport(p,a,b) ICOM_CALL2(CreateViewport,p,a,b)
1157 #define IDirect3D_FindDevice(p,a,b)     ICOM_CALL2(FindDevice,p,a,b)
1158 #endif
1159
1160
1161 /*****************************************************************************
1162  * IDirect3D2 interface
1163  */
1164 #define ICOM_INTERFACE IDirect3D2
1165 #define IDirect3D2_METHODS \
1166     ICOM_METHOD2(HRESULT,EnumDevices,    LPD3DENUMDEVICESCALLBACK,lpEnumDevicesCallback, LPVOID,lpUserArg) \
1167     ICOM_METHOD2(HRESULT,CreateLight,    LPDIRECT3DLIGHT*,lplpDirect3DLight, IUnknown*,pUnkOuter) \
1168     ICOM_METHOD2(HRESULT,CreateMaterial, LPDIRECT3DMATERIAL2*,lplpDirect3DMaterial2, IUnknown*,pUnkOuter) \
1169     ICOM_METHOD2(HRESULT,CreateViewport, LPDIRECT3DVIEWPORT2*,lplpD3DViewport2, IUnknown*,pUnkOuter) \
1170     ICOM_METHOD2(HRESULT,FindDevice,     LPD3DFINDDEVICESEARCH,lpD3DDFS, LPD3DFINDDEVICERESULT,lpD3DFDR) \
1171     ICOM_METHOD3(HRESULT,CreateDevice,   REFCLSID,rclsid, LPDIRECTDRAWSURFACE,lpDDS, LPDIRECT3DDEVICE2*,lplpD3DDevice2)
1172 #define IDirect3D2_IMETHODS \
1173     IUnknown_IMETHODS \
1174     IDirect3D2_METHODS
1175 ICOM_DEFINE(IDirect3D2,IUnknown)
1176 #undef ICOM_INTERFACE
1177   
1178 #ifdef ICOM_CINTERFACE
1179 /*** IUnknown methods ***/
1180 #define IDirect3D2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1181 #define IDirect3D2_AddRef(p)             ICOM_CALL (AddRef,p)
1182 #define IDirect3D2_Release(p)            ICOM_CALL (Release,p)
1183 /*** IDirect3D2 methods ***/
1184 #define IDirect3D2_EnumDevices(p,a,b)    ICOM_CALL2(EnumDevices,p,a,b)
1185 #define IDirect3D2_CreateLight(p,a,b)    ICOM_CALL2(CreateLight,p,a,b)
1186 #define IDirect3D2_CreateMaterial(p,a,b) ICOM_CALL2(CreateMaterial,p,a,b)
1187 #define IDirect3D2_CreateViewport(p,a,b) ICOM_CALL2(CreateViewport,p,a,b)
1188 #define IDirect3D2_FindDevice(p,a,b)     ICOM_CALL2(FindDevice,p,a,b)
1189 #define IDirect3D2_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
1190 #endif
1191
1192
1193 /*****************************************************************************
1194  * IDirect3DLight interface
1195  */
1196 #define ICOM_INTERFACE IDirect3DLight
1197 #define IDirect3DLight_METHODS \
1198     ICOM_METHOD1(HRESULT,Initialize, LPDIRECT3D,lpDirect3D) \
1199     ICOM_METHOD1(HRESULT,SetLight,   LPD3DLIGHT,lpLight) \
1200     ICOM_METHOD1(HRESULT,GetLight,   LPD3DLIGHT,lpLight)
1201 #define IDirect3DLight_IMETHODS \
1202     IUnknown_IMETHODS \
1203     IDirect3DLight_METHODS
1204 ICOM_DEFINE(IDirect3DLight,IUnknown)
1205 #undef ICOM_INTERFACE
1206   
1207 #ifdef ICOM_CINTERFACE
1208 /*** IUnknown methods ***/
1209 #define IDirect3DLight_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1210 #define IDirect3DLight_AddRef(p)             ICOM_CALL (AddRef,p)
1211 #define IDirect3DLight_Release(p)            ICOM_CALL (Release,p)
1212 /*** IDirect3DLight methods ***/
1213 #define IDirect3DLight_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
1214 #define IDirect3DLight_SetLight(p,a)   ICOM_CALL1(SetLight,p,a)
1215 #define IDirect3DLight_GetLight(p,a)   ICOM_CALL1(GetLight,p,a)
1216 #endif
1217
1218
1219 /*****************************************************************************
1220  * IDirect3DMaterial interface
1221  */
1222 #define ICOM_INTERFACE IDirect3DMaterial
1223 #define IDirect3DMaterial_METHODS \
1224     ICOM_METHOD1(HRESULT,Initialize,  LPDIRECT3D,lpDirect3D) \
1225     ICOM_METHOD1(HRESULT,SetMaterial, LPD3DMATERIAL,lpMat) \
1226     ICOM_METHOD1(HRESULT,GetMaterial, LPD3DMATERIAL,lpMat) \
1227     ICOM_METHOD2(HRESULT,GetHandle,   LPDIRECT3DDEVICE2,lpDirect3DDevice2, LPD3DMATERIALHANDLE,lpHandle) \
1228     ICOM_METHOD (HRESULT,Reserve) \
1229     ICOM_METHOD (HRESULT,Unreserve)
1230 #define IDirect3DMaterial_IMETHODS \
1231     IUnknown_IMETHODS \
1232     IDirect3DMaterial_METHODS
1233 ICOM_DEFINE(IDirect3DMaterial,IUnknown)
1234 #undef ICOM_INTERFACE
1235
1236 #ifdef ICOM_CINTERFACE
1237   /*** IUnknown methods ***/
1238 #define IDirect3DMaterial_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1239 #define IDirect3DMaterial_AddRef(p)             ICOM_CALL (AddRef,p)
1240 #define IDirect3DMaterial_Release(p)            ICOM_CALL (Release,p)
1241 /*** IDirect3DMaterial methods ***/
1242 #define IDirect3DMaterial_Initialize(p,a)  ICOM_CALL1(Initialize,p,a)
1243 #define IDirect3DMaterial_SetMaterial(p,a) ICOM_CALL1(SetMaterial,p,a)
1244 #define IDirect3DMaterial_GetMaterial(p,a) ICOM_CALL1(GetMaterial,p,a)
1245 #define IDirect3DMaterial_GetHandle(p,a,b) ICOM_CALL2(GetHandle,p,a,b)
1246 #define IDirect3DMaterial_Reserve(p)       ICOM_CALL (Reserve,p)
1247 #define IDirect3DMaterial_Unreserve(p)     ICOM_CALL (Unreserve,p)
1248 #endif
1249
1250
1251 /*****************************************************************************
1252  * IDirect3DMaterial2 interface
1253  */
1254 #define ICOM_INTERFACE IDirect3DMaterial2
1255 #define IDirect3DMaterial2_METHODS \
1256     ICOM_METHOD1(HRESULT,SetMaterial, LPD3DMATERIAL,lpMat) \
1257     ICOM_METHOD1(HRESULT,GetMaterial, LPD3DMATERIAL,lpMat) \
1258     ICOM_METHOD2(HRESULT,GetHandle,   LPDIRECT3DDEVICE2,lpDirect3DDevice2, LPD3DMATERIALHANDLE,lpHandle)
1259 #define IDirect3DMaterial2_IMETHODS \
1260     IUnknown_IMETHODS \
1261     IDirect3DMaterial2_METHODS
1262 ICOM_DEFINE(IDirect3DMaterial2,IUnknown)
1263 #undef ICOM_INTERFACE
1264
1265 #ifdef ICOM_CINTERFACE
1266   /*** IUnknown methods ***/
1267 #define IDirect3DMaterial2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1268 #define IDirect3DMaterial2_AddRef(p)             ICOM_CALL (AddRef,p)
1269 #define IDirect3DMaterial2_Release(p)            ICOM_CALL (Release,p)
1270   /*** IDirect3DMaterial2 methods ***/
1271 #define IDirect3DMaterial2_SetMaterial(p,a) ICOM_CALL1(SetMaterial,p,a)
1272 #define IDirect3DMaterial2_GetMaterial(p,a) ICOM_CALL1(GetMaterial,p,a)
1273 #define IDirect3DMaterial2_GetHandle(p,a,b) ICOM_CALL2(GetHandle,p,a,b)
1274 #endif
1275   
1276
1277 /*****************************************************************************
1278  * IDirect3DTexture interface
1279  */
1280 #define ICOM_INTERFACE IDirect3DTexture
1281 #define IDirect3DTexture_METHODS \
1282     ICOM_METHOD2(HRESULT,Initialize,     LPDIRECT3DDEVICE,lpDirect3DDevice, LPDIRECTDRAWSURFACE,) \
1283     ICOM_METHOD2(HRESULT,GetHandle,      LPDIRECT3DDEVICE,lpDirect3DDevice, LPD3DTEXTUREHANDLE,) \
1284     ICOM_METHOD2(HRESULT,PaletteChanged, DWORD,dwStart, DWORD,dwCount) \
1285     ICOM_METHOD1(HRESULT,Load,           LPDIRECT3DTEXTURE,lpD3DTexture) \
1286     ICOM_METHOD (HRESULT,Unload)
1287 #define IDirect3DTexture_IMETHODS \
1288     IUnknown_IMETHODS \
1289     IDirect3DTexture_METHODS
1290 ICOM_DEFINE(IDirect3DTexture,IUnknown)
1291 #undef ICOM_INTERFACE
1292
1293 #ifdef ICOM_CINTERFACE
1294   /*** IUnknown methods ***/
1295 #define IDirect3DTexture_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1296 #define IDirect3DTexture_AddRef(p)             ICOM_CALL (AddRef,p)
1297 #define IDirect3DTexture_Release(p)            ICOM_CALL (Release,p)
1298   /*** IDirect3DTexture methods ***/
1299 #define IDirect3DTexture_Initialize(p,a,b,c) ICOM_CALL(Initialize,p,a,b,c)
1300 #define IDirect3DTexture_GetHandle(p,a,b,c) ICOM_CALL(GetHandle,p,a,b,c)
1301 #define IDirect3DTexture_PaletteChanged(p,a,b,c) ICOM_CALL(PaletteChanged,p,a,b,c)
1302 #define IDirect3DTexture_Load(p,a,b,c) ICOM_CALL(Load,p,a,b,c)
1303 #define IDirect3DTexture_Unload(p,a,b,c) ICOM_CALL(Unload,p,a,b,c)
1304 #endif
1305
1306
1307 /*****************************************************************************
1308  * IDirect3DTexture2 interface
1309  */
1310 #define ICOM_INTERFACE IDirect3DTexture2
1311 #define IDirect3DTexture2_METHODS \
1312     ICOM_METHOD2(HRESULT,GetHandle,      LPDIRECT3DDEVICE2,lpDirect3DDevice2, LPD3DTEXTUREHANDLE,lpHandle) \
1313     ICOM_METHOD2(HRESULT,PaletteChanged, DWORD,dwStart, DWORD,dwCount) \
1314     ICOM_METHOD1(HRESULT,Load,           LPDIRECT3DTEXTURE2,lpD3DTexture2)
1315 #define IDirect3DTexture2_IMETHODS \
1316     IUnknown_IMETHODS \
1317     IDirect3DTexture2_METHODS
1318 ICOM_DEFINE(IDirect3DTexture2,IUnknown)
1319 #undef ICOM_INTERFACE
1320
1321 #ifdef ICOM_CINTERFACE
1322   /*** IUnknown methods ***/
1323 #define IDirect3DTexture2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1324 #define IDirect3DTexture2_AddRef(p)             ICOM_CALL (AddRef,p)
1325 #define IDirect3DTexture2_Release(p)            ICOM_CALL (Release,p)
1326   /*** IDirect3DTexture2 methods ***/
1327 #define IDirect3DTexture2_GetHandle(p,a,b)      ICOM_CALL2(GetHandle,p,a,b)
1328 #define IDirect3DTexture2_PaletteChanged(p,a,b) ICOM_CALL2(PaletteChanged,p,a,b)
1329 #define IDirect3DTexture2_Load(p,a)             ICOM_CALL1(Load,p,a)
1330 #endif  
1331
1332
1333 /*****************************************************************************
1334  * IDirect3DViewport interface
1335  */
1336 #define ICOM_INTERFACE IDirect3DViewport
1337 #define IDirect3DViewport_METHODS \
1338     ICOM_METHOD1(HRESULT,Initialize,         LPDIRECT3D,lpDirect3D) \
1339     ICOM_METHOD1(HRESULT,GetViewport,        LPD3DVIEWPORT,lpData) \
1340     ICOM_METHOD1(HRESULT,SetViewport,        LPD3DVIEWPORT,lpData) \
1341     ICOM_METHOD4(HRESULT,TransformVertices,  DWORD,dwVertexCount, LPD3DTRANSFORMDATA,lpData, DWORD,dwFlags, LPDWORD,lpOffScreen) \
1342     ICOM_METHOD2(HRESULT,LightElements,      DWORD,dwElementCount, LPD3DLIGHTDATA,lpData) \
1343     ICOM_METHOD1(HRESULT,SetBackground,      D3DMATERIALHANDLE,hMat) \
1344     ICOM_METHOD2(HRESULT,GetBackground,      LPD3DMATERIALHANDLE,, LPBOOL,) \
1345     ICOM_METHOD1(HRESULT,SetBackgroundDepth, LPDIRECTDRAWSURFACE,lpDDSurface) \
1346     ICOM_METHOD2(HRESULT,GetBackgroundDepth, LPDIRECTDRAWSURFACE*,lplpDDSurface, LPBOOL,lpValid) \
1347     ICOM_METHOD3(HRESULT,Clear,              DWORD,dwCount, LPD3DRECT,lpRects, DWORD,dwFlags) \
1348     ICOM_METHOD1(HRESULT,AddLight,           LPDIRECT3DLIGHT,lpDirect3DLight) \
1349     ICOM_METHOD1(HRESULT,DeleteLight,        LPDIRECT3DLIGHT,lpDirect3DLight) \
1350     ICOM_METHOD3(HRESULT,NextLight,          LPDIRECT3DLIGHT,lpDirect3DLight, LPDIRECT3DLIGHT*,lplpDirect3DLight, DWORD,dwFlags)
1351 #define IDirect3DViewport_IMETHODS \
1352     IUnknown_IMETHODS \
1353     IDirect3DViewport_METHODS
1354 ICOM_DEFINE(IDirect3DViewport,IUnknown)
1355 #undef ICOM_INTERFACE
1356
1357 #ifdef ICOM_CINTERFACE
1358   /*** IUnknown methods ***/
1359 #define IDirect3DViewport_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1360 #define IDirect3DViewport_AddRef(p)             ICOM_CALL (AddRef,p)
1361 #define IDirect3DViewport_Release(p)            ICOM_CALL (Release,p)
1362   /*** IDirect3DViewport methods ***/
1363 #define IDirect3DViewport_Initialize(p,a)              ICOM_CALL1(Initialize,p,a)
1364 #define IDirect3DViewport_GetViewport(p,a)             ICOM_CALL1(GetViewport,p,a)
1365 #define IDirect3DViewport_SetViewport(p,a)             ICOM_CALL1(SetViewport,p,a)
1366 #define IDirect3DViewport_TransformVertices(p,a,b,c,d) ICOM_CALL4(TransformVertices,p,a,b,c,d)
1367 #define IDirect3DViewport_LightElements(p,a,b)         ICOM_CALL2(LightElements,p,a,b)
1368 #define IDirect3DViewport_SetBackground(p,a)           ICOM_CALL1(SetBackground,p,a)
1369 #define IDirect3DViewport_GetBackground(p,a,b)         ICOM_CALL2(GetBackground,p,a,b)
1370 #define IDirect3DViewport_SetBackgroundDepth(p,a)      ICOM_CALL1(SetBackgroundDepth,p,a)
1371 #define IDirect3DViewport_GetBackgroundDepth(p,a,b)    ICOM_CALL2(GetBackgroundDepth,p,a,b)
1372 #define IDirect3DViewport_Clear(p,a,b,c)               ICOM_CALL3(Clear,p,a,b,c)
1373 #define IDirect3DViewport_AddLight(p,a)                ICOM_CALL1(AddLight,p,a)
1374 #define IDirect3DViewport_DeleteLight(p,a)             ICOM_CALL1(DeleteLight,p,a)
1375 #define IDirect3DViewport_NextLight(p,a,b,c)           ICOM_CALL3(NextLight,p,a,b,c)
1376 #endif
1377
1378
1379 /*****************************************************************************
1380  * IDirect3DViewport2 interface
1381  */
1382 #define ICOM_INTERFACE IDirect3DViewport2
1383 #define IDirect3DViewport2_METHODS \
1384     ICOM_METHOD1(HRESULT,GetViewport2, LPD3DVIEWPORT2,lpData) \
1385     ICOM_METHOD1(HRESULT,SetViewport2, LPD3DVIEWPORT2,lpData)
1386 #define IDirect3DViewport2_IMETHODS \
1387     IDirect3DViewport_IMETHODS \
1388     IDirect3DViewport2_METHODS
1389 ICOM_DEFINE(IDirect3DViewport2,IDirect3DViewport)
1390 #undef ICOM_INTERFACE
1391
1392 #ifdef ICOM_CINTERFACE
1393   /*** IUnknown methods ***/
1394 #define IDirect3DViewport2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1395 #define IDirect3DViewport2_AddRef(p)             ICOM_CALL (AddRef,p)
1396 #define IDirect3DViewport2_Release(p)            ICOM_CALL (Release,p)
1397 /*** IDirect3Viewport methods ***/
1398 #define IDirect3DViewport2_Initialize(p,a)              ICOM_CALL1(Initialize,p,a)
1399 #define IDirect3DViewport2_GetViewport(p,a)             ICOM_CALL1(GetViewport,p,a)
1400 #define IDirect3DViewport2_SetViewport(p,a)             ICOM_CALL1(SetViewport,p,a)
1401 #define IDirect3DViewport2_TransformVertices(p,a,b,c,d) ICOM_CALL4(TransformVertices,p,a,b,c,d)
1402 #define IDirect3DViewport2_LightElements(p,a,b)         ICOM_CALL2(LightElements,p,a,b)
1403 #define IDirect3DViewport2_SetBackground(p,a)           ICOM_CALL1(SetBackground,p,a)
1404 #define IDirect3DViewport2_GetBackground(p,a,b)         ICOM_CALL2(GetBackground,p,a,b)
1405 #define IDirect3DViewport2_SetBackgroundDepth(p,a)      ICOM_CALL1(SetBackgroundDepth,p,a)
1406 #define IDirect3DViewport2_GetBackgroundDepth(p,a,b)    ICOM_CALL2(GetBackgroundDepth,p,a,b)
1407 #define IDirect3DViewport2_Clear(p,a,b,c)               ICOM_CALL3(Clear,p,a,b,c)
1408 #define IDirect3DViewport2_AddLight(p,a)                ICOM_CALL1(AddLight,p,a)
1409 #define IDirect3DViewport2_DeleteLight(p,a)             ICOM_CALL1(DeleteLight,p,a)
1410 #define IDirect3DViewport2_NextLight(p,a,b,c)           ICOM_CALL3(NextLight,p,a,b,c)
1411   /*** IDirect3DViewport2 methods ***/
1412 #define IDirect3DViewport2_GetViewport2(p,a) ICOM_CALL1(GetViewport2,p,a)
1413 #define IDirect3DViewport2_SetViewport2(p,a) ICOM_CALL1(SetViewport2,p,a)
1414 #endif
1415
1416
1417 /*****************************************************************************
1418  * IDirect3DExecuteBuffer interface
1419  */
1420 #define ICOM_INTERFACE IDirect3DExecuteBuffer
1421 #define IDirect3DExecuteBuffer_METHODS \
1422     ICOM_METHOD2(HRESULT,Initialize,     LPDIRECT3DDEVICE,lpDirect3DDevice, LPD3DEXECUTEBUFFERDESC,lpDesc) \
1423     ICOM_METHOD1(HRESULT,Lock,           LPD3DEXECUTEBUFFERDESC,lpDesc) \
1424     ICOM_METHOD (HRESULT,Unlock) \
1425     ICOM_METHOD1(HRESULT,SetExecuteData, LPD3DEXECUTEDATA,lpData) \
1426     ICOM_METHOD1(HRESULT,GetExecuteData, LPD3DEXECUTEDATA,lpData) \
1427     ICOM_METHOD4(HRESULT,Validate,       LPDWORD,lpdwOffset, LPD3DVALIDATECALLBACK,lpFunc, LPVOID,lpUserArg, DWORD,dwReserved) \
1428     ICOM_METHOD1(HRESULT,Optimize,       DWORD,)
1429 #define IDirect3DExecuteBuffer_IMETHODS \
1430     IUnknown_IMETHODS \
1431     IDirect3DExecuteBuffer_METHODS
1432 ICOM_DEFINE(IDirect3DExecuteBuffer,IUnknown)
1433 #undef ICOM_INTERFACE
1434
1435 #ifdef ICOM_CINTERFACE
1436   /*** IUnknown methods ***/
1437 #define IDirect3DExecuteBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1438 #define IDirect3DExecuteBuffer_AddRef(p)             ICOM_CALL (AddRef,p)
1439 #define IDirect3DExecuteBuffer_Release(p)            ICOM_CALL (Release,p)
1440   /*** IDirect3DExecuteBuffer methods ***/
1441 #define IDirect3DExecuteBuffer_Initialize(p,a,b)   ICOM_CALL2(Initialize,p,a,b)
1442 #define IDirect3DExecuteBuffer_Lock(p,a)           ICOM_CALL1(Lock,p,a)
1443 #define IDirect3DExecuteBuffer_Unlock(p)           ICOM_CALL (Unlock,p)
1444 #define IDirect3DExecuteBuffer_SetExecuteData(p,a) ICOM_CALL1(SetExecuteData,p,a)
1445 #define IDirect3DExecuteBuffer_GetExecuteData(p,a) ICOM_CALL1(GetExecuteData,p,a)
1446 #define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) ICOM_CALL4(Validate,p,a,b,c,d)
1447 #define IDirect3DExecuteBuffer_Optimize(p,a)       ICOM_CALL1(Optimize,p,a)
1448 #endif
1449
1450
1451 /*****************************************************************************
1452  * IDirect3DDevice interface
1453  */
1454 #define ICOM_INTERFACE IDirect3DDevice
1455 #define IDirect3DDevice_METHODS \
1456     ICOM_METHOD3(HRESULT,Initialize,          LPDIRECT3D,lpDirect3D, LPGUID,lpGUID, LPD3DDEVICEDESC,lpD3DDVDesc) \
1457     ICOM_METHOD2(HRESULT,GetCaps,             LPD3DDEVICEDESC,lpD3DHWDevDesc, LPD3DDEVICEDESC,lpD3DHELDevDesc) \
1458     ICOM_METHOD2(HRESULT,SwapTextureHandles,  LPDIRECT3DTEXTURE,lpD3Dtex1, LPDIRECT3DTEXTURE,lpD3DTex2) \
1459     ICOM_METHOD3(HRESULT,CreateExecuteBuffer, LPD3DEXECUTEBUFFERDESC,lpDesc, LPDIRECT3DEXECUTEBUFFER*,lplpDirect3DExecuteBuffer, IUnknown*,pUnkOuter) \
1460     ICOM_METHOD1(HRESULT,GetStats,            LPD3DSTATS,lpD3DStats) \
1461     ICOM_METHOD3(HRESULT,Execute,             LPDIRECT3DEXECUTEBUFFER,lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT,lpDirect3DViewport, DWORD,dwFlags) \
1462     ICOM_METHOD1(HRESULT,AddViewport,         LPDIRECT3DVIEWPORT,lpDirect3DViewport) \
1463     ICOM_METHOD1(HRESULT,DeleteViewport,      LPDIRECT3DVIEWPORT,lpDirect3DViewport) \
1464     ICOM_METHOD3(HRESULT,NextViewport,        LPDIRECT3DVIEWPORT,lpDirect3DViewport, LPDIRECT3DVIEWPORT*,lplpDirect3DViewport, DWORD,dwFlags) \
1465     ICOM_METHOD4(HRESULT,Pick,                LPDIRECT3DEXECUTEBUFFER,lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT,lpDirect3DViewport, DWORD,dwFlags, LPD3DRECT,lpRect) \
1466     ICOM_METHOD2(HRESULT,GetPickRecords,      LPDWORD,lpCount, LPD3DPICKRECORD,lpD3DPickRec) \
1467     ICOM_METHOD2(HRESULT,EnumTextureFormats,  LPD3DENUMTEXTUREFORMATSCALLBACK,lpD3DEnumTextureProc, LPVOID,lpArg) \
1468     ICOM_METHOD1(HRESULT,CreateMatrix,        LPD3DMATRIXHANDLE,lpD3DMatHandle) \
1469     ICOM_METHOD2(HRESULT,SetMatrix,           D3DMATRIXHANDLE,D3DMatHandle, LPD3DMATRIX,lpD3DMatrix) \
1470     ICOM_METHOD2(HRESULT,GetMatrix,           D3DMATRIXHANDLE,D3DMatHandle, LPD3DMATRIX,lpD3DMatrix) \
1471     ICOM_METHOD1(HRESULT,DeleteMatrix,        D3DMATRIXHANDLE,D3DMatHandle) \
1472     ICOM_METHOD (HRESULT,BeginScene) \
1473     ICOM_METHOD (HRESULT,EndScene) \
1474     ICOM_METHOD1(HRESULT,GetDirect3D,         LPDIRECT3D*,lplpDirect3D)
1475 #define IDirect3DDevice_IMETHODS \
1476     IUnknown_IMETHODS \
1477     IDirect3DDevice_METHODS
1478 ICOM_DEFINE(IDirect3DDevice,IUnknown)
1479 #undef ICOM_INTERFACE
1480
1481 #ifdef ICOM_CINTERFACE
1482   /*** IUnknown methods ***/
1483 #define IDirect3DDevice_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1484 #define IDirect3DDevice_AddRef(p)             ICOM_CALL (AddRef,p)
1485 #define IDirect3DDevice_Release(p)            ICOM_CALL (Release,p)
1486   /*** IDirect3DDevice methods ***/
1487 #define IDirect3DDevice_Initialize(p,a,b,c)          ICOM_CALL3(Initialize,p,a,b,c)
1488 #define IDirect3DDevice_GetCaps(p,a,b)               ICOM_CALL2(GetCaps,p,a,b)
1489 #define IDirect3DDevice_SwapTextureHandles(p,a,b)    ICOM_CALL2(SwapTextureHandles,p,a,b)
1490 #define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) ICOM_CALL3(CreateExecuteBuffer,p,a,b,c)
1491 #define IDirect3DDevice_GetStats(p,a)                ICOM_CALL1(GetStats,p,a)
1492 #define IDirect3DDevice_Execute(p,a,b,c)             ICOM_CALL3(Execute,p,a,b,c)
1493 #define IDirect3DDevice_AddViewport(p,a)             ICOM_CALL1(AddViewport,p,a)
1494 #define IDirect3DDevice_DeleteViewport(p,a)          ICOM_CALL1(DeleteViewport,p,a)
1495 #define IDirect3DDevice_NextViewport(p,a,b,c)        ICOM_CALL3(NextViewport,p,a,b,c)
1496 #define IDirect3DDevice_Pick(p,a,b,c,d)              ICOM_CALL4(Pick,p,a,b,c,d)
1497 #define IDirect3DDevice_GetPickRecords(p,a,b)        ICOM_CALL2(GetPickRecords,p,a,b)
1498 #define IDirect3DDevice_EnumTextureFormats(p,a,b)    ICOM_CALL2(EnumTextureFormats,p,a,b)
1499 #define IDirect3DDevice_CreateMatrix(p,a)            ICOM_CALL1(CreateMatrix,p,a)
1500 #define IDirect3DDevice_SetMatrix(p,a,b)             ICOM_CALL2(SetMatrix,p,a,b)
1501 #define IDirect3DDevice_GetMatrix(p,a,b)             ICOM_CALL2(GetMatrix,p,a,b)
1502 #define IDirect3DDevice_DeleteMatrix(p,a)            ICOM_CALL1(DeleteMatrix,p,a)
1503 #define IDirect3DDevice_BeginScene(p)                ICOM_CALL (BeginScene,p)
1504 #define IDirect3DDevice_EndScene(p)                  ICOM_CALL (EndScene,p)
1505 #define IDirect3DDevice_GetDirect3D(p,a)             ICOM_CALL1(GetDirect3D,p,a)
1506 #endif
1507
1508
1509 /*****************************************************************************
1510  * IDirect3DDevice2 interface
1511  */
1512 #define ICOM_INTERFACE IDirect3DDevice2
1513 #define IDirect3DDevice2_METHODS \
1514     ICOM_METHOD2(HRESULT,GetCaps,              LPD3DDEVICEDESC,lpD3DHWDevDesc, LPD3DDEVICEDESC,lpD3DHELDevDesc) \
1515     ICOM_METHOD2(HRESULT,SwapTextureHandles,   LPDIRECT3DTEXTURE2,lpD3DTex1, LPDIRECT3DTEXTURE2,lpD3DTex2) \
1516     ICOM_METHOD1(HRESULT,GetStats,             LPD3DSTATS,lpD3DStats) \
1517     ICOM_METHOD1(HRESULT,AddViewport,          LPDIRECT3DVIEWPORT2,lpDirect3DViewport2) \
1518     ICOM_METHOD1(HRESULT,DeleteViewport,       LPDIRECT3DVIEWPORT2,lpDirect3DViewport2) \
1519     ICOM_METHOD3(HRESULT,NextViewport,         LPDIRECT3DVIEWPORT2,lpDirect3DViewport2, LPDIRECT3DVIEWPORT2*,lplpDirect3DViewport2, DWORD,dwFlags) \
1520     ICOM_METHOD2(HRESULT,EnumTextureFormats,   LPD3DENUMTEXTUREFORMATSCALLBACK,lpD3DEnumTextureProc, LPVOID,lpArg) \
1521     ICOM_METHOD (HRESULT,BeginScene) \
1522     ICOM_METHOD (HRESULT,EndScene) \
1523     ICOM_METHOD1(HRESULT,GetDirect3D,          LPDIRECT3D2*,lplpDirect3D2) \
1524     /*** DrawPrimitive API ***/ \
1525     ICOM_METHOD1(HRESULT,SetCurrentViewport,   LPDIRECT3DVIEWPORT2,lpDirect3DViewport2) \
1526     ICOM_METHOD1(HRESULT,GetCurrentViewport,   LPDIRECT3DVIEWPORT2*,lplpDirect3DViewport2) \
1527     ICOM_METHOD2(HRESULT,SetRenderTarget,      LPDIRECTDRAWSURFACE,lpNewRenderTarget, DWORD,dwFlags) \
1528     ICOM_METHOD1(HRESULT,GetRenderTarget,      LPDIRECTDRAWSURFACE*,lplpRenderTarget) \
1529     ICOM_METHOD3(HRESULT,Begin,                D3DPRIMITIVETYPE,, D3DVERTEXTYPE,, DWORD,) \
1530     ICOM_METHOD5(HRESULT,BeginIndexed,         D3DPRIMITIVETYPE,d3dptPrimitiveType, D3DVERTEXTYPE,d3dvtVertexType, LPVOID,lpvVertices, DWORD,dwNumVertices, DWORD,dwFlags) \
1531     ICOM_METHOD1(HRESULT,Vertex,               LPVOID,lpVertexType) \
1532     ICOM_METHOD1(HRESULT,Index,                WORD,wVertexIndex) \
1533     ICOM_METHOD1(HRESULT,End,                  DWORD,dwFlags) \
1534     ICOM_METHOD2(HRESULT,GetRenderState,       D3DRENDERSTATETYPE,dwRenderStateType, LPDWORD,lpdwRenderState) \
1535     ICOM_METHOD2(HRESULT,SetRenderState,       D3DRENDERSTATETYPE,dwRenderStateType, DWORD,dwRenderState) \
1536     ICOM_METHOD2(HRESULT,GetLightState,        D3DLIGHTSTATETYPE,dwLightStateType, LPDWORD,lpdwLightState) \
1537     ICOM_METHOD2(HRESULT,SetLightState,        D3DLIGHTSTATETYPE,dwLightStateType, DWORD,dwLightState) \
1538     ICOM_METHOD2(HRESULT,SetTransform,         D3DTRANSFORMSTATETYPE,dtstTransformStateType, LPD3DMATRIX,lpD3DMatrix) \
1539     ICOM_METHOD2(HRESULT,GetTransform,         D3DTRANSFORMSTATETYPE,dtstTransformStateType, LPD3DMATRIX,lpD3DMatrix) \
1540     ICOM_METHOD2(HRESULT,MultiplyTransform,    D3DTRANSFORMSTATETYPE,dtstTransformStateType, LPD3DMATRIX,lpD3DMatrix) \
1541     ICOM_METHOD5(HRESULT,DrawPrimitive,        D3DPRIMITIVETYPE,d3dptPrimitiveType, D3DVERTEXTYPE,d3dvtVertexType, LPVOID,lpvVertices, DWORD,dwVertexCount, DWORD,dwFlags) \
1542     ICOM_METHOD7(HRESULT,DrawIndexedPrimitive, D3DPRIMITIVETYPE,d3dptPrimitiveType, D3DVERTEXTYPE,d3dvtVertexType, LPVOID,lpvVertices, DWORD,dwVertexCount, LPWORD,dwIndices, DWORD,dwIndexCount, DWORD,dwFlags) \
1543     ICOM_METHOD1(HRESULT,SetClipStatus,        LPD3DCLIPSTATUS,lpD3DClipStatus) \
1544     ICOM_METHOD1(HRESULT,GetClipStatus,        LPD3DCLIPSTATUS,lpD3DClipStatus)
1545 #define IDirect3DDevice2_IMETHODS \
1546     IUnknown_IMETHODS \
1547     IDirect3DDevice2_METHODS
1548 ICOM_DEFINE(IDirect3DDevice2,IUnknown)
1549 #undef ICOM_INTERFACE
1550
1551 #ifdef ICOM_CINTERFACE
1552   /*** IUnknown methods ***/
1553 #define IDirect3DDevice2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1554 #define IDirect3DDevice2_AddRef(p)             ICOM_CALL (AddRef,p)
1555 #define IDirect3DDevice2_Release(p)            ICOM_CALL (Release,p)
1556   /*** IDirect3DDevice2 methods ***/
1557 #define IDirect3DDevice2_GetCaps(p,a,b)                        ICOM_CALL2(GetCaps,p,a,b)
1558 #define IDirect3DDevice2_SwapTextureHandles(p,a,b)             ICOM_CALL2(SwapTextureHandles,p,a,b)
1559 #define IDirect3DDevice2_GetStats(p,a)                         ICOM_CALL1(GetStats,p,a)
1560 #define IDirect3DDevice2_AddViewport(p,a)                      ICOM_CALL1(AddViewport,p,a)
1561 #define IDirect3DDevice2_DeleteViewport(p,a)                   ICOM_CALL1(DeleteViewport,p,a)
1562 #define IDirect3DDevice2_NextViewport(p,a,b,c)                 ICOM_CALL3(NextViewport,p,a,b,c)
1563 #define IDirect3DDevice2_EnumTextureFormats(p,a,b)             ICOM_CALL2(EnumTextureFormats,p,a,b)
1564 #define IDirect3DDevice2_BeginScene(p)                         ICOM_CALL (BeginScene,p)
1565 #define IDirect3DDevice2_EndScene(p)                           ICOM_CALL (EndScene,p)
1566 #define IDirect3DDevice2_GetDirect3D(p,a)                      ICOM_CALL1(GetDirect3D,p,a)
1567 #define IDirect3DDevice2_SetCurrentViewport(p,a)               ICOM_CALL1(SetCurrentViewport,p,a)
1568 #define IDirect3DDevice2_GetCurrentViewport(p,a)               ICOM_CALL1(GetCurrentViewport,p,a)
1569 #define IDirect3DDevice2_SetRenderTarget(p,a,b)                ICOM_CALL2(SetRenderTarget,p,a,b)
1570 #define IDirect3DDevice2_GetRenderTarget(p,a)                  ICOM_CALL1(GetRenderTarget,p,a)
1571 #define IDirect3DDevice2_Begin(p,a,b,c)                        ICOM_CALL3(Begin,p,a,b,c)
1572 #define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e)             ICOM_CALL5(BeginIndexed,p,a,b,c,d,e)
1573 #define IDirect3DDevice2_Vertex(p,a)                           ICOM_CALL1(Vertex,p,a)
1574 #define IDirect3DDevice2_Index(p,a)                            ICOM_CALL1(Index,p,a)
1575 #define IDirect3DDevice2_End(p,a)                              ICOM_CALL1(End,p,a)
1576 #define IDirect3DDevice2_GetRenderState(p,a,b)                 ICOM_CALL2(GetRenderState,p,a,b)
1577 #define IDirect3DDevice2_SetRenderState(p,a,b)                 ICOM_CALL2(SetRenderState,p,a,b)
1578 #define IDirect3DDevice2_GetLightState(p,a,b)                  ICOM_CALL2(GetLightState,p,a,b)
1579 #define IDirect3DDevice2_SetLightState(p,a,b)                  ICOM_CALL2(SetLightState,p,a,b)
1580 #define IDirect3DDevice2_SetTransform(p,a,b)                   ICOM_CALL2(SetTransform,p,a,b)
1581 #define IDirect3DDevice2_GetTransform(p,a,b)                   ICOM_CALL2(GetTransform,p,a,b)
1582 #define IDirect3DDevice2_MultiplyTransform(p,a,b)              ICOM_CALL2(MultiplyTransform,p,a,b)
1583 #define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e)            ICOM_CALL5(DrawPrimitive,p,a,b,c,d,e)
1584 #define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) ICOM_CALL7(DrawIndexedPrimitive,p,a,b,c,d,e,f,g)
1585 #define IDirect3DDevice2_SetClipStatus(p,a)                    ICOM_CALL1(SetClipStatus,p,a)
1586 #define IDirect3DDevice2_GetClipStatus(p,a)                    ICOM_CALL1(GetClipStatus,p,a)
1587 #endif
1588
1589
1590 #endif /* __WINE_D3D_H */