server: Only call gettimeofday once per poll loop.
[wine] / include / wine / wined3d_interface.h
1 /*
2  * Direct3D wine internal public interface file
3  *
4  * Copyright 2002-2003 The wine-d3d team
5  * Copyright 2002-2003 Raphael Junqueira
6  * Copyright 2005 Oliver Stieber
7  * Copyright 2006 Stefan Dösinger for CodeWeavers
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23
24 #ifndef __WINE_WINED3D_INTERFACE_H
25 #define __WINE_WINED3D_INTERFACE_H
26
27 #if !defined( __WINE_CONFIG_H )
28 # error You must include config.h to use this header
29 #endif
30
31 #if !defined( __WINE_D3D_H ) && !defined( __WINE_D3D8_H ) && !defined( __WINE_D3D9_H )
32 # error You must include d3d.h, d3d8.h or d3d9.h header to use this header
33 #endif
34
35 #if !defined( __WINE_DDRAW_H)
36 #error You must include ddraw.h to use this header
37 #endif
38
39 #include "wined3d_types.h"
40 /*****************************************************************
41  * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES 
42  * PLEASE USE wine/wined3d_gl.h INSTEAD
43  */
44
45 /*****************************************************************************
46  * #defines and error codes
47  */
48 #define _FACWINED3D  0x876
49 #define MAKE_WINED3DHRESULT( code )                 MAKE_HRESULT( 1, _FACWINED3D, code )
50 #define MAKE_WINED3DSTATUS( code )                  MAKE_HRESULT( 0, _FACWINED3D, code )
51
52 /*****************************************************************************
53  * Direct3D Errors
54  */
55 #define WINED3D_OK                                  S_OK
56 #define WINED3DERR_WRONGTEXTUREFORMAT               MAKE_WINED3DHRESULT(2072)
57 #define WINED3DERR_UNSUPPORTEDCOLOROPERATION        MAKE_WINED3DHRESULT(2073)
58 #define WINED3DERR_UNSUPPORTEDCOLORARG              MAKE_WINED3DHRESULT(2074)
59 #define WINED3DERR_UNSUPPORTEDALPHAOPERATION        MAKE_WINED3DHRESULT(2075)
60 #define WINED3DERR_UNSUPPORTEDALPHAARG              MAKE_WINED3DHRESULT(2076)
61 #define WINED3DERR_TOOMANYOPERATIONS                MAKE_WINED3DHRESULT(2077)
62 #define WINED3DERR_CONFLICTINGTEXTUREFILTER         MAKE_WINED3DHRESULT(2078)
63 #define WINED3DERR_UNSUPPORTEDFACTORVALUE           MAKE_WINED3DHRESULT(2079)
64 #define WINED3DERR_CONFLICTINGRENDERSTATE           MAKE_WINED3DHRESULT(2081)
65 #define WINED3DERR_UNSUPPORTEDTEXTUREFILTER         MAKE_WINED3DHRESULT(2082)
66 #define WINED3DERR_CONFLICTINGTEXTUREPALETTE        MAKE_WINED3DHRESULT(2086)
67 #define WINED3DERR_DRIVERINTERNALERROR              MAKE_WINED3DHRESULT(2087)
68 #define WINED3DERR_NOTFOUND                         MAKE_WINED3DHRESULT(2150)
69 #define WINED3DERR_MOREDATA                         MAKE_WINED3DHRESULT(2151)
70 #define WINED3DERR_DEVICELOST                       MAKE_WINED3DHRESULT(2152)
71 #define WINED3DERR_DEVICENOTRESET                   MAKE_WINED3DHRESULT(2153)
72 #define WINED3DERR_NOTAVAILABLE                     MAKE_WINED3DHRESULT(2154)
73 #define WINED3DERR_OUTOFVIDEOMEMORY                 MAKE_WINED3DHRESULT(380)
74 #define WINED3DERR_INVALIDDEVICE                    MAKE_WINED3DHRESULT(2155)
75 #define WINED3DERR_INVALIDCALL                      MAKE_WINED3DHRESULT(2156)
76 #define WINED3DERR_DRIVERINVALIDCALL                MAKE_WINED3DHRESULT(2157)
77 #define WINED3DERR_WASSTILLDRAWING                  MAKE_WINED3DHRESULT(540)
78 #define WINED3DOK_NOAUTOGEN                         MAKE_WINED3DSTATUS(2159)
79
80  /*****************************************************************************
81  * Predeclare the interfaces
82  */
83
84 struct IWineD3D;
85 struct IWineD3DBase;
86 struct IWineD3DDevice;
87 struct IWineD3DPalette;
88 struct IWineD3DResource;
89 struct IWineD3DVertexBuffer;
90 struct IWineD3DIndexBuffer;
91 struct IWineD3DBaseTexture;
92 struct IWineD3DTexture;
93 struct IWineD3DCubeTexture;
94 struct IWineD3DVolumeTexture;
95 struct IWineD3DStateBlock;
96 struct IWineD3DSurface;
97 struct IWineD3DVolume;
98 struct IWineD3DVertexDeclaration;
99 struct IWineD3DBaseShader;
100 struct IWineD3DVertexShader;
101 struct IWineD3DPixelShader;
102 struct IWineD3DQuery;
103 struct IWineD3DSwapChain;
104
105
106 /* {108F9C44-6F30-11d9-C687-00046142C14F} */
107 DEFINE_GUID(IID_IWineD3D, 
108 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
109
110 DEFINE_GUID(IID_IWineD3DBase,
111 0x46799311, 0x8e0e, 0x40ce, 0xb2, 0xec, 0xdd, 0xb9, 0x9f, 0x18, 0xfc, 0xb4);
112
113 /* {108F9C44-6F30-11d9-C687-00046142C14F} */
114 DEFINE_GUID(IID_IWineD3DDevice, 
115 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
116
117 /* {f756720c-32b9-4439-b5a3-1d6c97037d9e} */
118 DEFINE_GUID(IID_IWineD3DPalette,
119 0xf756720c, 0x32b9, 0x4439, 0xb5, 0xa3, 0x1d, 0x6c, 0x97, 0x03, 0x7d, 0x9e);
120
121 /* {1F3BFB34-6F30-11d9-C687-00046142C14F} */
122 DEFINE_GUID(IID_IWineD3DResource, 
123 0x1f3bfb34, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
124
125 /* {217F671E-6F30-11d9-C687-00046142C14F} */
126 DEFINE_GUID(IID_IWineD3DVertexBuffer, 
127 0x217f671e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
128
129 /* {24769ED8-6F30-11d9-C687-00046142C14F} */
130 DEFINE_GUID(IID_IWineD3DVolume, 
131 0x24769ed8, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
132
133
134 /* {34D01B10-6F30-11d9-C687-00046142C14F} */
135 DEFINE_GUID(IID_IWineD3DSwapChain, 
136 0x34d01b10, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
137
138 /* {37CD5526-6F30-11d9-C687-00046142C14F} */
139 DEFINE_GUID(IID_IWineD3DSurface, 
140 0x37cd5526, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
141
142
143 /* {3A02A54E-6F30-11d9-C687-00046142C14F} */
144 DEFINE_GUID(IID_IWineD3DIndexBuffer, 
145 0x3a02a54e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
146
147 /* {3C2AEBF6-6F30-11d9-C687-00046142C14F} */
148 DEFINE_GUID(IID_IWineD3DBaseTexture, 
149 0x3c2aebf6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
150
151 /* {3E72CC1C-6F30-11d9-C687-00046142C14F} */
152 DEFINE_GUID(IID_IWineD3DTexture, 
153 0x3e72cc1c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
154
155 /* {41752900-6F30-11d9-C687-00046142C14F} */
156 DEFINE_GUID(IID_IWineD3DCubeTexture, 
157 0x41752900, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
158
159 /* {7B39470C-6F30-11d9-C687-00046142C14F} */
160 DEFINE_GUID(IID_IWineD3DVolumeTexture, 
161 0x7b39470c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
162
163 /* {7CD55BE6-6F30-11d9-C687-00046142C14F} */
164 DEFINE_GUID(IID_IWineD3DVertexDeclaration, 
165 0x7cd55be6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
166
167 /* {EAC93065-A4DF-446F-86A1-9EF2BCA40A3C} */
168 DEFINE_GUID(IID_IWineD3DBaseShader,
169 0xeac93065, 0xa4df, 0x446f, 0x86, 0xa1, 0x9e, 0xf2, 0xbc, 0xa4, 0x0a, 0x3c);
170
171 /* {7F7A2B60-6F30-11d9-C687-00046142C14F} */
172 DEFINE_GUID(IID_IWineD3DVertexShader, 
173 0x7f7a2b60, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
174
175 /* {818503DA-6F30-11d9-C687-00046142C14F} */
176 DEFINE_GUID(IID_IWineD3DPixelShader, 
177 0x818503da, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
178
179 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
180 DEFINE_GUID(IID_IWineD3DStateBlock, 
181 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
182
183 /* {905DDBAC-6F30-11d9-C687-00046142C14F} */
184 DEFINE_GUID(IID_IWineD3DQuery, 
185 0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
186
187
188 /* The following have differing names, but actually are the same layout. */
189 /* Also, D3DCAPS8 is a subset of D3DCAPS9 so can be typecase as long as
190      none of the 9 fields are accessed when the device is d3d8           */
191 /* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */
192 #if defined( __WINE_D3D9_H )
193  /* Identical: */ 
194 # define WINED3DLIGHT           D3DLIGHT9
195 # define WINED3DMATERIAL        D3DMATERIAL9
196 # define WINED3DVIEWPORT        D3DVIEWPORT9
197 # define WINED3DGAMMARAMP       D3DGAMMARAMP
198
199 #elif defined( __WINE_D3D8_H )
200  /* Identical: */ 
201 # define WINED3DLIGHT           D3DLIGHT8
202 # define WINED3DMATERIAL        D3DMATERIAL8
203 # define WINED3DVIEWPORT        D3DVIEWPORT8
204 # define WINED3DGAMMARAMP       D3DGAMMARAMP
205
206 #else /* defined (__WINE_D3D_H ) */
207  /* Identical: */
208 # define WINED3DLIGHT           D3DLIGHT7
209 # define WINED3DMATERIAL        D3DMATERIAL7
210 # define WINED3DVIEWPORT        D3DVIEWPORT7
211 # define WINED3DGAMMARAMP       DDGAMMARAMP
212
213 #endif
214
215 /*****************************************************************************
216  * Callback functions required for predefining surfaces / stencils
217  */
218 typedef HRESULT WINAPI (*D3DCB_CREATERENDERTARGETFN) (IUnknown *pDevice,
219                                                UINT       Width, 
220                                                UINT       Height, 
221                                                WINED3DFORMAT  Format, 
222                                                WINED3DMULTISAMPLE_TYPE MultiSample, 
223                                                DWORD      MultisampleQuality, 
224                                                BOOL       Lockable, 
225                                                struct IWineD3DSurface **ppSurface,
226                                                HANDLE    *pSharedHandle);
227
228 typedef HRESULT WINAPI (*D3DCB_CREATESURFACEFN) (IUnknown *pDevice,
229                                                UINT       Width, 
230                                                UINT       Height,
231                                                WINED3DFORMAT Format,
232                                                DWORD      Usage,
233                                                WINED3DPOOL Pool,            
234                                                UINT       Level,
235                                                struct IWineD3DSurface **ppSurface,
236                                                HANDLE    *pSharedHandle);
237
238 typedef HRESULT WINAPI (*D3DCB_CREATEDEPTHSTENCILSURFACEFN) (IUnknown *pDevice,
239                                                UINT       Width, 
240                                                UINT       Height, 
241                                                WINED3DFORMAT  Format, 
242                                                WINED3DMULTISAMPLE_TYPE MultiSample, 
243                                                DWORD      MultisampleQuality, 
244                                                BOOL       Discard, 
245                                                struct IWineD3DSurface **ppSurface,
246                                                HANDLE    *pSharedHandle);
247
248
249 typedef HRESULT WINAPI (*D3DCB_CREATEVOLUMEFN) (IUnknown *pDevice,
250                                                UINT       Width, 
251                                                UINT       Height, 
252                                                UINT       Depth, 
253                                                WINED3DFORMAT  Format, 
254                                                WINED3DPOOL Pool,
255                                                DWORD      Usage,
256                                                struct IWineD3DVolume **ppVolume,
257                                                HANDLE    *pSharedHandle);
258
259 typedef HRESULT WINAPI (*D3DCB_CREATEADDITIONALSWAPCHAIN) (IUnknown *pDevice,
260                                                WINED3DPRESENT_PARAMETERS *pPresentationParameters,
261                                                struct IWineD3DSwapChain **pSwapChain
262                                                );
263
264 typedef HRESULT WINAPI (*D3DCB_ENUMDISPLAYMODESCALLBACK) (IUnknown *pDevice,
265                                                           UINT Width,
266                                                           UINT Height,
267                                                           WINED3DFORMAT Pixelformat,
268                                                           FLOAT Refresh,
269                                                           LPVOID context);
270
271 /*****************************************************************************
272  * IWineD3DBase interface
273  */
274
275 #define INTERFACE IWineD3DBase
276 DECLARE_INTERFACE_(IWineD3DBase, IUnknown)
277 {
278     /*** IUnknown methods ***/
279     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
280     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
281     STDMETHOD_(ULONG,Release)(THIS) PURE;
282     /*** IWineD3DBase methods ***/
283     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
284 };
285 #undef INTERFACE
286
287 #if !defined(__cplusplus) || defined(CINTERFACE)
288 /*** IUnknown methods ***/
289 #define IWineD3DBase_QueryInterface(p,a,b)                    (p)->lpVtbl->QueryInterface(p,a,b)
290 #define IWineD3DBase_AddRef(p)                                (p)->lpVtbl->AddRef(p)
291 #define IWineD3DBase_Release(p)                               (p)->lpVtbl->Release(p)
292 /*** IWineD3DBase methods ***/
293 #define IWineD3DBase_GetParent(p,a)                           (p)->lpVtbl->GetParent(p,a)
294 #endif
295
296 /*****************************************************************************
297  * IWineD3D interface 
298  */
299
300 #define INTERFACE IWineD3D
301 DECLARE_INTERFACE_(IWineD3D, IWineD3DBase)
302 {
303     /*** IUnknown methods ***/
304     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
305     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
306     STDMETHOD_(ULONG,Release)(THIS) PURE;
307     /*** IWineD3DBase methods ***/
308     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
309     /*** IWineD3D methods ***/
310     STDMETHOD_(UINT,GetAdapterCount)(THIS) PURE;
311     STDMETHOD(RegisterSoftwareDevice)(THIS_ void * pInitializeFunction) PURE;
312     STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
313     STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT Adapter, WINED3DFORMAT Format) PURE;
314     STDMETHOD(EnumAdapterModes)(THIS_ UINT  Adapter, UINT  Mode, WINED3DFORMAT Format, WINED3DDISPLAYMODE * pMode) PURE;
315     STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT  Adapter, WINED3DDISPLAYMODE *pMode) PURE;
316     STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, WINED3DADAPTER_IDENTIFIER* pIdentifier) PURE;
317     STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT  Adapter, WINED3DDEVTYPE  DeviceType, WINED3DFORMAT  SurfaceFormat, BOOL  Windowed, WINED3DMULTISAMPLE_TYPE  MultiSampleType, DWORD *pQuality) PURE;
318     STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT  Adapter, WINED3DDEVTYPE  DeviceType, WINED3DFORMAT  AdapterFormat, WINED3DFORMAT  RenderTargetFormat, WINED3DFORMAT  DepthStencilFormat) PURE;
319     STDMETHOD(CheckDeviceType)(THIS_ UINT  Adapter, WINED3DDEVTYPE  CheckType, WINED3DFORMAT  DisplayFormat, WINED3DFORMAT  BackBufferFormat, BOOL  Windowed) PURE;
320     STDMETHOD(CheckDeviceFormat)(THIS_ UINT  Adapter, WINED3DDEVTYPE  DeviceType, WINED3DFORMAT  AdapterFormat, DWORD  Usage, WINED3DRESOURCETYPE  RType, WINED3DFORMAT  CheckFormat) PURE;
321     STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT SourceFormat, WINED3DFORMAT TargetFormat) PURE;
322     STDMETHOD(GetDeviceCaps)(THIS_ UINT  Adapter, WINED3DDEVTYPE  DeviceType, WINED3DCAPS *pCaps) PURE;
323     STDMETHOD(CreateDevice)(THIS_ UINT  Adapter, WINED3DDEVTYPE  DeviceType,HWND  hFocusWindow, DWORD  BehaviorFlags, struct IWineD3DDevice **ppReturnedDeviceInterface, IUnknown *parent) PURE;
324
325 };
326 #undef INTERFACE
327
328 #if !defined(__cplusplus) || defined(CINTERFACE)
329 /*** IUnknown methods ***/
330 #define IWineD3D_QueryInterface(p,a,b)                    (p)->lpVtbl->QueryInterface(p,a,b)
331 #define IWineD3D_AddRef(p)                                (p)->lpVtbl->AddRef(p)
332 #define IWineD3D_Release(p)                               (p)->lpVtbl->Release(p)
333 /*** IWineD3DBase methods ***/
334 #define IWineD3D_GetParent(p,a)                           (p)->lpVtbl->GetParent(p,a)
335 /*** IWineD3D methods ***/
336 #define IWineD3D_GetAdapterCount(p)                       (p)->lpVtbl->GetAdapterCount(p)
337 #define IWineD3D_RegisterSoftwareDevice(p,a)              (p)->lpVtbl->RegisterSoftwareDevice(p,a)
338 #define IWineD3D_GetAdapterMonitor(p,a)                   (p)->lpVtbl->GetAdapterMonitor(p,a)
339 #define IWineD3D_GetAdapterModeCount(p,a,b)               (p)->lpVtbl->GetAdapterModeCount(p,a,b)
340 #define IWineD3D_EnumAdapterModes(p,a,b,c,d)              (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
341 #define IWineD3D_GetAdapterDisplayMode(p,a,b)             (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
342 #define IWineD3D_GetAdapterIdentifier(p,a,b,c)            (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
343 #define IWineD3D_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
344 #define IWineD3D_CheckDepthStencilMatch(p,a,b,c,d,e)      (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
345 #define IWineD3D_CheckDeviceType(p,a,b,c,d,e)             (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
346 #define IWineD3D_CheckDeviceFormat(p,a,b,c,d,e,f)         (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
347 #define IWineD3D_CheckDeviceFormatConversion(p,a,b,c,d)   (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
348 #define IWineD3D_GetDeviceCaps(p,a,b,c)                   (p)->lpVtbl->GetDeviceCaps(p,a,b,c)
349 #define IWineD3D_CreateDevice(p,a,b,c,d,e,f)              (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
350 #endif
351
352 /* Define the main WineD3D entrypoint */
353 IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent);
354
355 /*****************************************************************************
356  * IWineD3DDevice interface 
357  */
358 #define INTERFACE IWineD3DDevice
359 DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) 
360
361     /*** IUnknown methods ***/
362     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
363     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
364     STDMETHOD_(ULONG,Release)(THIS) PURE;
365     /*** IWineD3DBase methods ***/
366     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
367     /*** IWineD3DDevice methods ***/
368     STDMETHOD(CreateVertexBuffer)(THIS_ UINT  Length,DWORD  Usage,DWORD  FVF,WINED3DPOOL  Pool,struct IWineD3DVertexBuffer **ppVertexBuffer, HANDLE *sharedHandle, IUnknown *parent) PURE;
369     STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DIndexBuffer** ppIndexBuffer, HANDLE* pSharedHandle, IUnknown *parent) PURE;
370     STDMETHOD(CreateStateBlock)(THIS_ WINED3DSTATEBLOCKTYPE Type, struct IWineD3DStateBlock **ppStateBlock, IUnknown *parent) PURE;
371     STDMETHOD(CreateSurface)(THIS_ UINT Width, UINT Height, WINED3DFORMAT Format,  BOOL Lockable, BOOL Discard, UINT Level,  struct IWineD3DSurface** ppSurface, WINED3DRESOURCETYPE Type, DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample ,DWORD MultisampleQuality,  HANDLE* pSharedHandle, WINED3DSURFTYPE Impl, IUnknown *parent) PURE;    
372     STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DTexture** ppTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE;
373     STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DVolumeTexture** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATEVOLUMEFN pFn) PURE;
374     STDMETHOD(CreateVolume)(THIS_ UINT Width, UINT Height, UINT Depth, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DVolume** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent) PURE;
375     STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DCubeTexture** ppCubeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE;
376     STDMETHOD(CreateQuery)(THIS_ WINED3DQUERYTYPE Type, struct IWineD3DQuery **ppQuery, IUnknown *pParent);
377     STDMETHOD(CreateAdditionalSwapChain)(THIS_ WINED3DPRESENT_PARAMETERS *pPresentationParameters, struct IWineD3DSwapChain **pSwapChain, IUnknown *pParent, D3DCB_CREATERENDERTARGETFN pFn, D3DCB_CREATEDEPTHSTENCILSURFACEFN pFn2);
378     STDMETHOD(CreateVertexDeclaration)(THIS_ CONST VOID* pDeclaration, struct IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent) PURE;
379     STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD *pDeclaration, CONST DWORD* pFunction, struct IWineD3DVertexShader** ppShader, IUnknown *pParent) PURE;
380     STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, struct IWineD3DPixelShader** ppShader, IUnknown *pParent) PURE;
381     STDMETHOD_(HRESULT,CreatePalette)(THIS_ DWORD Flags, PALETTEENTRY *PalEnt, struct IWineD3DPalette **Palette, IUnknown *Parent);
382     STDMETHOD(Init3D)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain);
383     STDMETHOD(Uninit3D)(THIS);
384     STDMETHOD(EnumDisplayModes)(THIS_ DWORD Flags, UINT Width, UINT Height, WINED3DFORMAT Format, void *context, D3DCB_ENUMDISPLAYMODESCALLBACK cb) PURE;
385     STDMETHOD(EvictManagedResources)(THIS) PURE;
386     STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
387     STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT BackBuffer, WINED3DBACKBUFFER_TYPE, struct IWineD3DSurface** ppBackBuffer) PURE;
388     STDMETHOD(GetCreationParameters)(THIS_ WINED3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
389     STDMETHOD(GetDeviceCaps)(THIS_ WINED3DCAPS* pCaps) PURE;
390     STDMETHOD(GetDirect3D)(THIS_ IWineD3D** ppD3D) PURE;
391     STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, WINED3DDISPLAYMODE* pMode) PURE;
392     STDMETHOD(SetDisplayMode)(THIS_ UINT iSwapChain, WINED3DDISPLAYMODE* pMode) PURE;
393     STDMETHOD(GetHWND)(THIS_ HWND *hwnd) PURE;
394     STDMETHOD(SetHWND)(THIS_ HWND hwnd) PURE;
395     STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
396     STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, WINED3DRASTER_STATUS* pRasterStatus) PURE;
397     STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, struct IWineD3DSwapChain **pSwapChain) PURE;
398     STDMETHOD(Reset)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
399     STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
400     STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, struct IWineD3DSurface* pCursorBitmap) PURE;
401     STDMETHOD_(void, SetCursorPosition)(THIS_ int XScreenSpace, int YScreenSpace, DWORD Flags) PURE;
402     STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
403     STDMETHOD(TestCooperativeLevel)(THIS) PURE;
404     STDMETHOD(SetClipPlane)(THIS_ DWORD  Index,CONST float * pPlane) PURE;
405     STDMETHOD(GetClipPlane)(THIS_ DWORD  Index,float * pPlane) PURE;
406     STDMETHOD(SetClipStatus)(THIS_ CONST WINED3DCLIPSTATUS * pClipStatus) PURE;
407     STDMETHOD(GetClipStatus)(THIS_ WINED3DCLIPSTATUS * pClipStatus) PURE;
408     STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
409     STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
410     STDMETHOD(SetDepthStencilSurface)(THIS_ struct IWineD3DSurface* pNewZStencil) PURE;
411     STDMETHOD(GetDepthStencilSurface)(THIS_ struct IWineD3DSurface** ppZStencilSurface) PURE;
412     STDMETHOD(SetFVF)(THIS_ DWORD  fvf) PURE;
413     STDMETHOD(GetFVF)(THIS_ DWORD * pfvf) PURE;
414     STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST WINED3DGAMMARAMP* pRamp) PURE;
415     STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, WINED3DGAMMARAMP* pRamp) PURE;
416     STDMETHOD(SetIndices)(THIS_ struct IWineD3DIndexBuffer * pIndexData,UINT  BaseVertexIndex) PURE;
417     STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData,UINT * pBaseVertexIndex) PURE;
418     STDMETHOD(SetLight)(THIS_ DWORD  Index,CONST WINED3DLIGHT * pLight) PURE;
419     STDMETHOD(GetLight)(THIS_ DWORD  Index,WINED3DLIGHT * pLight) PURE;
420     STDMETHOD(SetLightEnable)(THIS_ DWORD  Index,BOOL  Enable) PURE;
421     STDMETHOD(GetLightEnable)(THIS_ DWORD  Index,BOOL * pEnable) PURE;
422     STDMETHOD(SetMaterial)(THIS_ CONST WINED3DMATERIAL * pMaterial) PURE;
423     STDMETHOD(GetMaterial)(THIS_ WINED3DMATERIAL *pMaterial) PURE;
424     STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
425     STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
426     STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE;
427     STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
428     STDMETHOD(SetPixelShader)(THIS_ struct IWineD3DPixelShader  *pShader) PURE;
429     STDMETHOD(GetPixelShader)(THIS_ struct IWineD3DPixelShader **ppShader) PURE;
430     STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount) PURE;
431     STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
432     STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
433     STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
434     STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
435     STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
436     STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD  Value) PURE;
437     STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD * pValue) PURE;
438     STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface* pRenderTarget) PURE;
439     STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface** ppRenderTarget) PURE;
440     STDMETHOD(SetFrontBackBuffers)(THIS_ struct IWineD3DSurface *Front, struct IWineD3DSurface *Back) PURE;
441     STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
442     STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD* Value) PURE;
443     STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
444     STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
445     STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
446     STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
447     STDMETHOD(SetStreamSource)(THIS_ UINT  StreamNumber,struct IWineD3DVertexBuffer * pStreamData,UINT Offset,UINT  Stride) PURE;
448     STDMETHOD(GetStreamSource)(THIS_ UINT  StreamNumber,struct IWineD3DVertexBuffer ** ppStreamData,UINT *pOffset, UINT * pStride) PURE;
449     STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE;
450     STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE;
451     STDMETHOD(SetTexture)(THIS_ DWORD Stage, struct IWineD3DBaseTexture* pTexture) PURE;
452     STDMETHOD(GetTexture)(THIS_ DWORD Stage, struct IWineD3DBaseTexture** ppTexture) PURE;
453     STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, WINED3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
454     STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, WINED3DTEXTURESTAGESTATETYPE Type,DWORD *pValue) PURE;
455     STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE  State,CONST D3DMATRIX * pMatrix) PURE;
456     STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE  State,D3DMATRIX * pMatrix) PURE;
457     STDMETHOD(SetVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration* pDecl) PURE;
458     STDMETHOD(GetVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration** ppDecl) PURE;
459     STDMETHOD(SetVertexShader)(THIS_ struct IWineD3DVertexShader* pShader) PURE;
460     STDMETHOD(GetVertexShader)(THIS_ struct IWineD3DVertexShader** ppShader) PURE;
461     STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL*  pConstantData, UINT BoolCount) PURE;
462     STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL*        pConstantData, UINT BoolCount) PURE;
463     STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int*   pConstantData, UINT Vector4iCount) PURE;
464     STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int*         pConstantData, UINT Vector4iCount) PURE;
465     STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
466     STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float*       pConstantData, UINT Vector4fCount) PURE;
467     STDMETHOD(SetViewport)(THIS_ CONST WINED3DVIEWPORT * pViewport) PURE;
468     STDMETHOD(GetViewport)(THIS_ WINED3DVIEWPORT * pViewport) PURE;
469     STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE  State, CONST D3DMATRIX * pMatrix) PURE;
470     STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
471     STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, struct IWineD3DVertexBuffer* pDestBuffer, struct IWineD3DVertexBuffer* pVertexDecl, DWORD Flags) PURE;
472     STDMETHOD(BeginStateBlock)(THIS) PURE;
473     STDMETHOD(EndStateBlock)(THIS_ struct IWineD3DStateBlock** ppStateBlock) PURE;
474     STDMETHOD(BeginScene)(THIS) PURE;
475     STDMETHOD(EndScene)(THIS) PURE;
476     STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND  hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
477     STDMETHOD(Clear)(THIS_ DWORD  Count,CONST D3DRECT * pRects,DWORD  Flags,D3DCOLOR  Color,float  Z,DWORD  Stencil) PURE;
478     STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  StartVertex,UINT  PrimitiveCount) PURE;
479     STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,INT baseVIdx, UINT  minIndex,UINT  NumVertices,UINT  startIndex,UINT  primCount) PURE;
480     STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  PrimitiveCount,CONST void * pVertexStreamZeroData,UINT  VertexStreamZeroStride) PURE;
481     STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  MinVertexIndex,UINT  NumVertexIndices,UINT  PrimitiveCount,CONST void * pIndexData,WINED3DFORMAT  IndexDataFormat,CONST void * pVertexStreamZeroData,UINT  VertexStreamZeroStride) PURE;
482     STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) PURE;
483     STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DRECTPATCH_INFO* pRectPatchInfo) PURE;
484     STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DTRIPATCH_INFO* pTriPatchInfo) PURE;
485     STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
486     STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST D3DRECT* pRect, D3DCOLOR color) PURE;
487     STDMETHOD(UpdateTexture)(THIS_ struct IWineD3DBaseTexture *pSourceTexture, struct IWineD3DBaseTexture *pDestinationTexture) PURE;
488     STDMETHOD(UpdateSurface)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPoint) PURE;
489     STDMETHOD(CopyRects)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPointsArray);
490     STDMETHOD(StretchRect)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) PURE;
491     STDMETHOD(GetRenderTargetData)(THIS_ struct IWineD3DSurface* pRenderTarget, struct IWineD3DSurface* pSurface) PURE;
492     STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,struct IWineD3DSurface* pSurface) PURE;
493     /*** Internal use IWineD3Device methods ***/
494     STDMETHOD_(void, SetupTextureStates)(THIS_ DWORD Stage, DWORD texture_idx, DWORD Flags);
495     /*** object tracking ***/
496     STDMETHOD_(void, ResourceReleased)(THIS_ struct IWineD3DResource *resource);
497 };
498 #undef INTERFACE
499
500 #if !defined(__cplusplus) || defined(CINTERFACE)
501 /*** IUnknown methods ***/
502 #define IWineD3DDevice_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
503 #define IWineD3DDevice_AddRef(p)                         (p)->lpVtbl->AddRef(p)
504 #define IWineD3DDevice_Release(p)                        (p)->lpVtbl->Release(p)
505 /*** IWineD3DBase methods ***/
506 #define IWineD3DDevice_GetParent(p,a)                           (p)->lpVtbl->GetParent(p,a)
507 /*** IWineD3DDevice methods ***/
508 #define IWineD3DDevice_CreateVertexBuffer(p,a,b,c,d,e,f,g)      (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f,g)
509 #define IWineD3DDevice_CreateIndexBuffer(p,a,b,c,d,e,f,g)       (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f,g)
510 #define IWineD3DDevice_CreateStateBlock(p,a,b,c)                (p)->lpVtbl->CreateStateBlock(p,a,b,c)
511 #define IWineD3DDevice_CreateSurface(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)      (p)->lpVtbl->CreateSurface(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
512 #define IWineD3DDevice_CreateTexture(p,a,b,c,d,e,f,g,h,i,j)     (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h,i,j)
513 #define IWineD3DDevice_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i,j,k)    (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i,j,k)
514 #define IWineD3DDevice_CreateVolume(p,a,b,c,d,e,f,g,h,i)        (p)->lpVtbl->CreateVolume(p,a,b,c,d,e,f,g,h,i)
515 #define IWineD3DDevice_CreateCubeTexture(p,a,b,c,d,e,f,g,h,i)   (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g,h,i)
516 #define IWineD3DDevice_CreateQuery(p,a,b,c)                     (p)->lpVtbl->CreateQuery(p,a,b,c)
517 #define IWineD3DDevice_CreateAdditionalSwapChain(p,a,b,c,d,e)   (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b,c,d,e)
518 #define IWineD3DDevice_CreateVertexDeclaration(p,b,c,d)         (p)->lpVtbl->CreateVertexDeclaration(p,b,c,d)
519 #define IWineD3DDevice_CreateVertexShader(p,a,b,c,d)            (p)->lpVtbl->CreateVertexShader(p,a,b,c,d)
520 #define IWineD3DDevice_CreatePixelShader(p,a,b,c)               (p)->lpVtbl->CreatePixelShader(p,a,b,c)
521 #define IWineD3DDevice_CreatePalette(p, a, b, c, d)             (p)->lpVtbl->CreatePalette(p, a, b, c, d)
522 #define IWineD3DDevice_Init3D(p, a, b)                          (p)->lpVtbl->Init3D(p, a, b)
523 #define IWineD3DDevice_Uninit3D(p)                              (p)->lpVtbl->Uninit3D(p)
524 #define IWineD3DDevice_EnumDisplayModes(p,a,b,c,d,e,f)          (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d,e,f)
525 #define IWineD3DDevice_EvictManagedResources(p)                 (p)->lpVtbl->EvictManagedResources(p)
526 #define IWineD3DDevice_GetAvailableTextureMem(p)                (p)->lpVtbl->GetAvailableTextureMem(p)
527 #define IWineD3DDevice_GetBackBuffer(p,a,b,c,d)                 (p)->lpVtbl->GetBackBuffer(p,a,b,c,d)
528 #define IWineD3DDevice_GetCreationParameters(p,a)               (p)->lpVtbl->GetCreationParameters(p,a)
529 #define IWineD3DDevice_GetDeviceCaps(p,a)                       (p)->lpVtbl->GetDeviceCaps(p,a)
530 #define IWineD3DDevice_GetDirect3D(p,a)                         (p)->lpVtbl->GetDirect3D(p,a)
531 #define IWineD3DDevice_GetDisplayMode(p,a,b)                    (p)->lpVtbl->GetDisplayMode(p,a,b)
532 #define IWineD3DDevice_SetDisplayMode(p,a,b)                    (p)->lpVtbl->SetDisplayMode(p,a,b)
533 #define IWineD3DDevice_GetHWND(p, a)                            (p)->lpVtbl->GetHWND(p, a)
534 #define IWineD3DDevice_SetHWND(p, a)                            (p)->lpVtbl->SetHWND(p, a)
535 #define IWineD3DDevice_GetNumberOfSwapChains(p)                 (p)->lpVtbl->GetNumberOfSwapChains(p)
536 #define IWineD3DDevice_Reset(p,a)                               (p)->lpVtbl->Reset(p,a)
537 #define IWineD3DDevice_SetDialogBoxMode(p,a)                    (p)->lpVtbl->SetDialogBoxMode(p,a)
538 #define IWineD3DDevice_SetCursorProperties(p,a,b,c)             (p)->lpVtbl->SetCursorProperties(p,a,b,c)
539 #define IWineD3DDevice_SetCursorPosition(p,a,b,c)               (p)->lpVtbl->SetCursorPosition(p,a,b,c)
540 #define IWineD3DDevice_ShowCursor(p,a)                          (p)->lpVtbl->ShowCursor(p,a)
541 #define IWineD3DDevice_TestCooperativeLevel(p)                  (p)->lpVtbl->TestCooperativeLevel(p)
542 #define IWineD3DDevice_SetFVF(p,a)                              (p)->lpVtbl->SetFVF(p,a)
543 #define IWineD3DDevice_GetFVF(p,a)                              (p)->lpVtbl->GetFVF(p,a)
544 #define IWineD3DDevice_SetClipPlane(p,a,b)                      (p)->lpVtbl->SetClipPlane(p,a,b)
545 #define IWineD3DDevice_GetClipPlane(p,a,b)                      (p)->lpVtbl->GetClipPlane(p,a,b)
546 #define IWineD3DDevice_SetClipStatus(p,a)                       (p)->lpVtbl->SetClipStatus(p,a)
547 #define IWineD3DDevice_GetClipStatus(p,a)                       (p)->lpVtbl->GetClipStatus(p,a)
548 #define IWineD3DDevice_SetCurrentTexturePalette(p,a)            (p)->lpVtbl->SetCurrentTexturePalette(p,a)
549 #define IWineD3DDevice_GetCurrentTexturePalette(p,a)            (p)->lpVtbl->GetCurrentTexturePalette(p,a)
550 #define IWineD3DDevice_SetDepthStencilSurface(p,a)              (p)->lpVtbl->SetDepthStencilSurface(p,a)
551 #define IWineD3DDevice_GetDepthStencilSurface(p,a)              (p)->lpVtbl->GetDepthStencilSurface(p,a)
552 #define IWineD3DDevice_SetGammaRamp(p,a,b,c)                    (p)->lpVtbl->SetGammaRamp(p,a,b,c)
553 #define IWineD3DDevice_GetGammaRamp(p,a,b)                      (p)->lpVtbl->GetGammaRamp(p,a,b)
554 #define IWineD3DDevice_SetIndices(p,a,b)                        (p)->lpVtbl->SetIndices(p,a,b)
555 #define IWineD3DDevice_GetIndices(p,a,b)                        (p)->lpVtbl->GetIndices(p,a,b)
556 #define IWineD3DDevice_SetLight(p,a,b)                          (p)->lpVtbl->SetLight(p,a,b)
557 #define IWineD3DDevice_GetLight(p,a,b)                          (p)->lpVtbl->GetLight(p,a,b)
558 #define IWineD3DDevice_SetLightEnable(p,a,b)                    (p)->lpVtbl->SetLightEnable(p,a,b)
559 #define IWineD3DDevice_GetLightEnable(p,a,b)                    (p)->lpVtbl->GetLightEnable(p,a,b)
560 #define IWineD3DDevice_SetMaterial(p,a)                         (p)->lpVtbl->SetMaterial(p,a)
561 #define IWineD3DDevice_GetMaterial(p,a)                         (p)->lpVtbl->GetMaterial(p,a)
562 #define IWineD3DDevice_SetNPatchMode(p,a)                       (p)->lpVtbl->SetNPatchMode(p,a)
563 #define IWineD3DDevice_GetNPatchMode(p)                         (p)->lpVtbl->GetNPatchMode(p)
564 #define IWineD3DDevice_SetPaletteEntries(p,a,b)                 (p)->lpVtbl->SetPaletteEntries(p,a,b)
565 #define IWineD3DDevice_GetPaletteEntries(p,a,b)                 (p)->lpVtbl->GetPaletteEntries(p,a,b)
566 #define IWineD3DDevice_SetPixelShader(p,a)                      (p)->lpVtbl->SetPixelShader(p,a)
567 #define IWineD3DDevice_GetPixelShader(p,a)                      (p)->lpVtbl->GetPixelShader(p,a)
568 #define IWineD3DDevice_SetPixelShaderConstantB(p,a,b,c)         (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c)
569 #define IWineD3DDevice_GetPixelShaderConstantB(p,a,b,c)         (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c)
570 #define IWineD3DDevice_SetPixelShaderConstantI(p,a,b,c)         (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c)
571 #define IWineD3DDevice_GetPixelShaderConstantI(p,a,b,c)         (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c)
572 #define IWineD3DDevice_SetPixelShaderConstantF(p,a,b,c)         (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c)
573 #define IWineD3DDevice_GetPixelShaderConstantF(p,a,b,c)         (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c)
574 #define IWineD3DDevice_GetRasterStatus(p,a,b)                   (p)->lpVtbl->GetRasterStatus(p,a,b)
575 #define IWineD3DDevice_SetRenderState(p,a,b)                    (p)->lpVtbl->SetRenderState(p,a,b)
576 #define IWineD3DDevice_GetRenderState(p,a,b)                    (p)->lpVtbl->GetRenderState(p,a,b)
577 #define IWineD3DDevice_SetRenderTarget(p,a,b)                   (p)->lpVtbl->SetRenderTarget(p,a,b)
578 #define IWineD3DDevice_GetRenderTarget(p,a,b)                   (p)->lpVtbl->GetRenderTarget(p,a,b)
579 #define IWineD3DDevice_SetFrontBackBuffers(p, a, b)             (p)->lpVtbl->SetFrontBackBuffers(p,a,b);
580 #define IWineD3DDevice_SetSamplerState(p,a,b,c)                 (p)->lpVtbl->SetSamplerState(p,a,b,c)
581 #define IWineD3DDevice_GetSamplerState(p,a,b,c)                 (p)->lpVtbl->GetSamplerState(p,a,b,c)
582 #define IWineD3DDevice_SetScissorRect(p,a)                      (p)->lpVtbl->SetScissorRect(p,a)
583 #define IWineD3DDevice_GetScissorRect(p,a)                      (p)->lpVtbl->GetScissorRect(p,a)
584 #define IWineD3DDevice_SetSoftwareVertexProcessing(p,a)         (p)->lpVtbl->SetSoftwareVertexProcessing(p,a)
585 #define IWineD3DDevice_GetSoftwareVertexProcessing(p)           (p)->lpVtbl->GetSoftwareVertexProcessing(p)
586 #define IWineD3DDevice_SetStreamSource(p,a,b,c,d)               (p)->lpVtbl->SetStreamSource(p,a,b,c,d)
587 #define IWineD3DDevice_GetStreamSource(p,a,b,c,d)               (p)->lpVtbl->GetStreamSource(p,a,b,c,d)
588 #define IWineD3DDevice_SetStreamSourceFreq(p,a,b)               (p)->lpVtbl->SetStreamSourceFreq(p,a,b)
589 #define IWineD3DDevice_GetStreamSourceFreq(p,a,b)               (p)->lpVtbl->GetStreamSourceFreq(p,a,b)
590 #define IWineD3DDevice_GetSwapChain(p,a,b)                      (p)->lpVtbl->GetSwapChain(p,a,b)
591 #define IWineD3DDevice_SetTextureStageState(p,a,b,c)            (p)->lpVtbl->SetTextureStageState(p,a,b,c)
592 #define IWineD3DDevice_GetTextureStageState(p,a,b,c)            (p)->lpVtbl->GetTextureStageState(p,a,b,c)
593 #define IWineD3DDevice_SetTexture(p,a,b)                        (p)->lpVtbl->SetTexture(p,a,b)
594 #define IWineD3DDevice_GetTexture(p,a,b)                        (p)->lpVtbl->GetTexture(p,a,b)
595 #define IWineD3DDevice_SetTransform(p,a,b)                      (p)->lpVtbl->SetTransform(p,a,b)
596 #define IWineD3DDevice_GetTransform(p,a,b)                      (p)->lpVtbl->GetTransform(p,a,b)
597 #define IWineD3DDevice_SetVertexDeclaration(p,a)                (p)->lpVtbl->SetVertexDeclaration(p,a)
598 #define IWineD3DDevice_GetVertexDeclaration(p,a)                (p)->lpVtbl->GetVertexDeclaration(p,a)
599 #define IWineD3DDevice_SetVertexShader(p,a)                     (p)->lpVtbl->SetVertexShader(p,a)
600 #define IWineD3DDevice_GetVertexShader(p,a)                     (p)->lpVtbl->GetVertexShader(p,a)
601 #define IWineD3DDevice_SetVertexShaderConstantB(p,a,b,c)        (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c)
602 #define IWineD3DDevice_GetVertexShaderConstantB(p,a,b,c)        (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c)
603 #define IWineD3DDevice_SetVertexShaderConstantI(p,a,b,c)        (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c)
604 #define IWineD3DDevice_GetVertexShaderConstantI(p,a,b,c)        (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c)
605 #define IWineD3DDevice_SetVertexShaderConstantF(p,a,b,c)        (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c)
606 #define IWineD3DDevice_GetVertexShaderConstantF(p,a,b,c)        (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c)
607 #define IWineD3DDevice_SetViewport(p,a)                         (p)->lpVtbl->SetViewport(p,a)
608 #define IWineD3DDevice_GetViewport(p,a)                         (p)->lpVtbl->GetViewport(p,a)
609 #define IWineD3DDevice_MultiplyTransform(p,a,b)                 (p)->lpVtbl->MultiplyTransform(p,a,b)
610 #define IWineD3DDevice_ValidateDevice(p,a)                      (p)->lpVtbl->ValidateDevice(p,a)
611 #define IWineD3DDevice_ProcessVertices(p,a,b,c,d,e,f)           (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f)
612 #define IWineD3DDevice_BeginStateBlock(p)                       (p)->lpVtbl->BeginStateBlock(p)
613 #define IWineD3DDevice_EndStateBlock(p,a)                       (p)->lpVtbl->EndStateBlock(p,a)
614 #define IWineD3DDevice_BeginScene(p)                            (p)->lpVtbl->BeginScene(p)
615 #define IWineD3DDevice_EndScene(p)                              (p)->lpVtbl->EndScene(p)
616 #define IWineD3DDevice_Present(p,a,b,c,d)                       (p)->lpVtbl->Present(p,a,b,c,d)
617 #define IWineD3DDevice_Clear(p,a,b,c,d,e,f)                     (p)->lpVtbl->Clear(p,a,b,c,d,e,f)
618 #define IWineD3DDevice_DrawPrimitive(p,a,b,c)                   (p)->lpVtbl->DrawPrimitive(p,a,b,c)
619 #define IWineD3DDevice_DrawIndexedPrimitive(p,a,b,c,d,e,f)      (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f)
620 #define IWineD3DDevice_DrawPrimitiveUP(p,a,b,c,d)               (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d)
621 #define IWineD3DDevice_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)
622 #define IWineD3DDevice_DrawPrimitiveStrided(p,a,b,c)            (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c)
623 #define IWineD3DDevice_DrawRectPatch(p,a,b,c)                   (p)->lpVtbl->DrawRectPatch(p,a,b,c)
624 #define IWineD3DDevice_DrawTriPatch(p,a,b,c)                    (p)->lpVtbl->DrawTriPatch(p,a,b,c)
625 #define IWineD3DDevice_DeletePatch(p,a)                         (p)->lpVtbl->DeletePatch(p,a)
626 #define IWineD3DDevice_ColorFill(p,a,b,c)                       (p)->lpVtbl->ColorFill(p,a,b,c)
627 #define IWineD3DDevice_UpdateTexture(p,a,b)                     (p)->lpVtbl->UpdateTexture(p,a,b)
628 #define IWineD3DDevice_UpdateSurface(p,a,b,c,d)                 (p)->lpVtbl->UpdateSurface(p,a,b,c,d)
629 #define IWineD3DDevice_CopyRects(p,a,b,c,d,e)                   (p)->lpVtbl->CopyRects(p,a,b,c,d,e)
630 #define IWineD3DDevice_StretchRect(p,a,b,c,d,e)                 (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
631 #define IWineD3DDevice_GetRenderTargetData(p,a,b)               (p)->lpVtbl->GetRenderTargetData(p,a,b)
632 #define IWineD3DDevice_GetFrontBufferData(p,a,b)                (p)->lpVtbl->GetFrontBufferData(p,a,b)
633 #define IWineD3DDevice_SetupTextureStates(p,a,b,c)              (p)->lpVtbl->SetupTextureStates(p,a,b,c)
634 #define IWineD3DDevice_ResourceReleased(p,a)                    (p)->lpVtbl->ResourceReleased(p,a)
635 #endif
636
637 /*****************************************************************************
638  * WineD3DResource interface 
639  */
640 #define INTERFACE IWineD3DResource
641 DECLARE_INTERFACE_(IWineD3DResource,IWineD3DBase)
642 {
643     /*** IUnknown methods ***/
644     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
645     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
646     STDMETHOD_(ULONG,Release)(THIS) PURE;
647     /*** IWineD3DBase methods ***/
648     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
649     /*** IWineD3DResource methods ***/
650     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
651     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
652     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
653     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
654     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
655     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
656     STDMETHOD_(void,PreLoad)(THIS) PURE;
657     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
658 };
659 #undef INTERFACE
660
661 #if !defined(__cplusplus) || defined(CINTERFACE)
662 /*** IUnknown methods ***/
663 #define IWineD3DResource_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
664 #define IWineD3DResource_AddRef(p)                    (p)->lpVtbl->AddRef(p)
665 #define IWineD3DResource_Release(p)                   (p)->lpVtbl->Release(p)
666 /*** IWineD3DBase methods ***/
667 #define IWineD3DResource_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
668 /*** IWineD3DResource methods ***/
669 #define IWineD3DResource_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
670 #define IWineD3DResource_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
671 #define IWineD3DResource_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
672 #define IWineD3DResource_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
673 #define IWineD3DResource_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
674 #define IWineD3DResource_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
675 #define IWineD3DResource_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
676 #define IWineD3DResource_GetType(p)                   (p)->lpVtbl->GetType(p)
677 #endif
678
679 /*****************************************************************************
680  * WineD3DVertexBuffer interface 
681  */
682 #define INTERFACE IWineD3DVertexBuffer
683 DECLARE_INTERFACE_(IWineD3DVertexBuffer,IWineD3DResource)
684 {
685     /*** IUnknown methods ***/
686     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
687     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
688     STDMETHOD_(ULONG,Release)(THIS) PURE;
689     /*** IWineD3DBase methods ***/
690     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
691     /*** IWineD3DResource methods ***/
692     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
693     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
694     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
695     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
696     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
697     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
698     STDMETHOD_(void,PreLoad)(THIS) PURE;
699     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
700     /*** IWineD3DVertexBuffer methods ***/
701     STDMETHOD(Lock)(THIS_ UINT  OffsetToLock, UINT  SizeToLock, BYTE ** ppbData, DWORD  Flags) PURE;
702     STDMETHOD(Unlock)(THIS) PURE;
703     STDMETHOD(GetDesc)(THIS_ WINED3DVERTEXBUFFER_DESC  * pDesc) PURE;
704 };
705 #undef INTERFACE
706
707 #if !defined(__cplusplus) || defined(CINTERFACE)
708 /*** IUnknown methods ***/
709 #define IWineD3DVertexBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
710 #define IWineD3DVertexBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
711 #define IWineD3DVertexBuffer_Release(p)                   (p)->lpVtbl->Release(p)
712 /*** IWineD3DBase methods ***/
713 #define IWineD3DVertexBuffer_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
714 /*** IWineD3DResource methods ***/
715 #define IWineD3DVertexBuffer_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
716 #define IWineD3DVertexBuffer_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
717 #define IWineD3DVertexBuffer_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
718 #define IWineD3DVertexBuffer_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
719 #define IWineD3DVertexBuffer_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
720 #define IWineD3DVertexBuffer_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
721 #define IWineD3DVertexBuffer_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
722 #define IWineD3DVertexBuffer_GetType(p)                   (p)->lpVtbl->GetType(p)
723 /*** IWineD3DVertexBuffer methods ***/
724 #define IWineD3DVertexBuffer_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
725 #define IWineD3DVertexBuffer_Unlock(p)                    (p)->lpVtbl->Unlock(p)
726 #define IWineD3DVertexBuffer_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
727 #endif
728
729 /*****************************************************************************
730  * WineD3DIndexBuffer interface 
731  */
732 #define INTERFACE IWineD3DIndexBuffer
733 DECLARE_INTERFACE_(IWineD3DIndexBuffer,IWineD3DResource)
734 {
735     /*** IUnknown methods ***/
736     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
737     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
738     STDMETHOD_(ULONG,Release)(THIS) PURE;
739     /*** IWineD3DBase methods ***/
740     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
741     /*** IWineD3DResource methods ***/
742     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
743     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
744     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
745     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
746     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
747     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
748     STDMETHOD_(void,PreLoad)(THIS) PURE;
749     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
750     /*** IWineD3DIndexBuffer methods ***/
751     STDMETHOD(Lock)(THIS_ UINT  OffsetToLock, UINT  SizeToLock, BYTE ** ppbData, DWORD  Flags) PURE;
752     STDMETHOD(Unlock)(THIS) PURE;
753     STDMETHOD(GetDesc)(THIS_ WINED3DINDEXBUFFER_DESC  * pDesc) PURE;
754 };
755 #undef INTERFACE
756
757 #if !defined(__cplusplus) || defined(CINTERFACE)
758 /*** IUnknown methods ***/
759 #define IWineD3DIndexBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
760 #define IWineD3DIndexBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
761 #define IWineD3DIndexBuffer_Release(p)                   (p)->lpVtbl->Release(p)
762 /*** IWineD3DBase methods ***/
763 #define IWineD3DIndexBuffer_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
764 /*** IWineD3DResource methods ***/
765 #define IWineD3DIndexBuffer_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
766 #define IWineD3DIndexBuffer_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
767 #define IWineD3DIndexBuffer_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
768 #define IWineD3DIndexBuffer_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
769 #define IWineD3DIndexBuffer_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
770 #define IWineD3DIndexBuffer_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
771 #define IWineD3DIndexBuffer_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
772 #define IWineD3DIndexBuffer_GetType(p)                   (p)->lpVtbl->GetType(p)
773 /*** IWineD3DIndexBuffer methods ***/
774 #define IWineD3DIndexBuffer_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
775 #define IWineD3DIndexBuffer_Unlock(p)                    (p)->lpVtbl->Unlock(p)
776 #define IWineD3DIndexBuffer_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
777 #endif
778
779 /*****************************************************************************
780  * IWineD3DBaseTexture interface
781  *   Note at d3d8 this does NOT extend Resource, but at d3d9 it does
782  *     since most functions are common anyway, it makes sense to extend it
783  */
784 #define INTERFACE IWineD3DBaseTexture
785 DECLARE_INTERFACE_(IWineD3DBaseTexture,IWineD3DResource)
786 {
787     /*** IUnknown methods ***/
788     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
789     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
790     STDMETHOD_(ULONG,Release)(THIS) PURE;
791     /*** IWineD3DBase methods ***/
792     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
793     /*** IWineD3DResource methods ***/
794     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
795     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
796     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
797     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
798     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
799     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
800     STDMETHOD_(void,PreLoad)(THIS) PURE;
801     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
802     /*** IWineD3DBaseTexture methods ***/
803     STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
804     STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
805     STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
806     STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE;
807     STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
808     STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
809     STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE;
810     STDMETHOD_(BOOL, GetDirty)(THIS) PURE;
811     STDMETHOD(BindTexture)(THIS) PURE;
812     STDMETHOD(UnBindTexture)(THIS) PURE;
813     STDMETHOD_(UINT, GetTextureDimensions)(THIS) PURE;
814     STDMETHOD_(void, ApplyStateChanges)(THIS_ const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) PURE;
815
816 };
817 #undef INTERFACE
818
819 #if !defined(__cplusplus) || defined(CINTERFACE)
820 /*** IUnknown methods ***/
821 #define IWineD3DBaseTexture_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
822 #define IWineD3DBaseTexture_AddRef(p)                  (p)->lpVtbl->AddRef(p)
823 #define IWineD3DBaseTexture_Release(p)                 (p)->lpVtbl->Release(p)
824 /*** IWineD3DBase methods ***/
825 #define IWineD3DBaseTexture_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
826 /*** IWineD3DBaseTexture methods: IWineD3DResource ***/
827 #define IWineD3DBaseTexture_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
828 #define IWineD3DBaseTexture_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
829 #define IWineD3DBaseTexture_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
830 #define IWineD3DBaseTexture_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
831 #define IWineD3DBaseTexture_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
832 #define IWineD3DBaseTexture_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
833 #define IWineD3DBaseTexture_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
834 #define IWineD3DBaseTexture_GetType(p)                 (p)->lpVtbl->GetType(p)
835 /*** IWineD3DBaseTexture methods ***/
836 #define IWineD3DBaseTexture_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
837 #define IWineD3DBaseTexture_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
838 #define IWineD3DBaseTexture_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
839 #define IWineD3DBaseTexture_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
840 #define IWineD3DBaseTexture_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
841 #define IWineD3DBaseTexture_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
842 #define IWineD3DBaseTexture_SetDirty(p,a)              (p)->lpVtbl->SetDirty(p,a)
843 #define IWineD3DBaseTexture_GetDirty(p)                (p)->lpVtbl->GetDirty(p)
844 /*** internal methods ***/
845 #define IWineD3DBaseTexture_BindTexture(p)             (p)->lpVtbl->BindTexture(p)
846 #define IWineD3DBaseTexture_UnBindTexture(p)           (p)->lpVtbl->UnBindTexture(p)
847 #define IWineD3DBaseTexture_GetTextureDimensions(p)    (p)->lpVtbl->GetTextureDimensions(p)
848 #define IWineD3DBaseTexture_ApplyStateChanges(p,a,b)   (p)->lpVtbl->ApplyStateChanges(p,a,b)
849 #endif
850
851 /*****************************************************************************
852  * IWineD3DTexture interface
853  */
854 #define INTERFACE IWineD3DTexture
855 DECLARE_INTERFACE_(IWineD3DTexture,IWineD3DBaseTexture)
856 {
857     /*** IUnknown methods ***/
858     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
859     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
860     STDMETHOD_(ULONG,Release)(THIS) PURE;
861     /*** IWineD3DBase methods ***/
862     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
863     /*** IWineD3DResource methods ***/
864     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
865     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
866     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
867     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
868     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
869     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
870     STDMETHOD_(void,PreLoad)(THIS) PURE;
871     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
872     /*** IWineD3DBaseTexture methods ***/
873     STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
874     STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
875     STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
876     STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE;
877     STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
878     STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
879     STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE;
880     STDMETHOD_(BOOL, GetDirty)(THIS) PURE;
881     STDMETHOD(BindTexture)(THIS) PURE;
882     STDMETHOD(UnBindTexture)(THIS) PURE;
883     STDMETHOD_(UINT, GetTextureDimensions)(THIS) PURE;
884     STDMETHOD_(void, ApplyStateChanges)(THIS_ const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) PURE;
885     /*** IWineD3DTexture methods ***/
886     STDMETHOD(GetLevelDesc)(THIS_ UINT Level, WINED3DSURFACE_DESC* pDesc) PURE;
887     STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level, struct IWineD3DSurface** ppSurfaceLevel) PURE;
888     STDMETHOD(LockRect)(THIS_ UINT Level, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE;
889     STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE;
890     STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE;
891 };
892 #undef INTERFACE
893
894 #if !defined(__cplusplus) || defined(CINTERFACE)
895 /*** IUnknown methods ***/
896 #define IWineD3DTexture_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
897 #define IWineD3DTexture_AddRef(p)                  (p)->lpVtbl->AddRef(p)
898 #define IWineD3DTexture_Release(p)                 (p)->lpVtbl->Release(p)
899 /*** IWineD3DBase methods ***/
900 #define IWineD3DTexture_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
901 /*** IWineD3DTexture methods: IWineD3DResource ***/
902 #define IWineD3DTexture_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
903 #define IWineD3DTexture_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
904 #define IWineD3DTexture_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
905 #define IWineD3DTexture_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
906 #define IWineD3DTexture_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
907 #define IWineD3DTexture_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
908 #define IWineD3DTexture_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
909 #define IWineD3DTexture_GetType(p)                 (p)->lpVtbl->GetType(p)
910 /*** IWineD3DTexture methods: IWineD3DBaseTexture ***/
911 #define IWineD3DTexture_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
912 #define IWineD3DTexture_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
913 #define IWineD3DTexture_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
914 #define IWineD3DTexture_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
915 #define IWineD3DTexture_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
916 #define IWineD3DTexture_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
917 #define IWineD3DTexture_SetDirty(p,a)              (p)->lpVtbl->SetDirty(p,a)
918 #define IWineD3DTexture_GetDirty(p)                (p)->lpVtbl->GetDirty(p)
919 #define IWineD3DTexture_BindTexture(p)             (p)->lpVtbl->BindTexture(p)
920 #define IWineD3DTexture_UnBindTexture(p)           (p)->lpVtbl->UnBindTexture(p)
921 #define IWineD3DTexture_GetTextureDimensions(p)    (p)->lpVtbl->GetTextureDimensions(p)
922 #define IWineD3DTexture_ApplyStateChanges(p,a,b)   (p)->lpVtbl->ApplyStateChanges(p,a,b)
923 /*** IWineD3DTexture methods ***/
924 #define IWineD3DTexture_GetLevelDesc(p,a,b)        (p)->lpVtbl->GetLevelDesc(p,a,b)
925 #define IWineD3DTexture_GetSurfaceLevel(p,a,b)     (p)->lpVtbl->GetSurfaceLevel(p,a,b)
926 #define IWineD3DTexture_LockRect(p,a,b,c,d)        (p)->lpVtbl->LockRect(p,a,b,c,d)
927 #define IWineD3DTexture_UnlockRect(p,a)            (p)->lpVtbl->UnlockRect(p,a)
928 #define IWineD3DTexture_AddDirtyRect(p,a)          (p)->lpVtbl->AddDirtyRect(p,a)
929 #endif
930
931 /*****************************************************************************
932  * IWineD3DCubeTexture interface
933  */
934 #define INTERFACE IWineD3DCubeTexture
935 DECLARE_INTERFACE_(IWineD3DCubeTexture,IWineD3DBaseTexture)
936 {
937     /*** IUnknown methods ***/
938     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
939     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
940     STDMETHOD_(ULONG,Release)(THIS) PURE;
941     /*** IWineD3DBase methods ***/
942     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
943     /*** IWineD3DResource methods ***/
944     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
945     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
946     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
947     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
948     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
949     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
950     STDMETHOD_(void,PreLoad)(THIS) PURE;
951     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
952     /*** IWineD3DBaseTexture methods ***/
953     STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
954     STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
955     STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
956     STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE;
957     STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
958     STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
959     STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE;
960     STDMETHOD_(BOOL, GetDirty)(THIS) PURE;
961     STDMETHOD(BindTexture)(THIS) PURE;
962     STDMETHOD(UnBindTexture)(THIS) PURE;
963     STDMETHOD_(UINT, GetTextureDimensions)(THIS) PURE;
964     STDMETHOD_(void, ApplyStateChanges)(THIS_ DWORD const textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) PURE;
965     /*** IWineD3DCubeTexture methods ***/
966     STDMETHOD(GetLevelDesc)(THIS_ UINT Level,WINED3DSURFACE_DESC* pDesc) PURE;
967     STDMETHOD(GetCubeMapSurface)(THIS_ WINED3DCUBEMAP_FACES FaceType, UINT Level, struct IWineD3DSurface** ppCubeMapSurface) PURE;
968     STDMETHOD(LockRect)(THIS_ WINED3DCUBEMAP_FACES FaceType, UINT Level, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE;
969     STDMETHOD(UnlockRect)(THIS_ WINED3DCUBEMAP_FACES FaceType, UINT Level) PURE;
970     STDMETHOD(AddDirtyRect)(THIS_ WINED3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) PURE;
971 };
972 #undef INTERFACE
973
974 #if !defined(__cplusplus) || defined(CINTERFACE)
975 /*** IUnknown methods ***/
976 #define IWineD3DCubeTexture_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
977 #define IWineD3DCubeTexture_AddRef(p)                  (p)->lpVtbl->AddRef(p)
978 #define IWineD3DCubeTexture_Release(p)                 (p)->lpVtbl->Release(p)
979 /*** IWineD3DBase methods ***/
980 #define IWineD3DCubeTexture_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
981 /*** IWineD3DCubeTexture methods: IWineD3DResource ***/
982 #define IWineD3DCubeTexture_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
983 #define IWineD3DCubeTexture_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
984 #define IWineD3DCubeTexture_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
985 #define IWineD3DCubeTexture_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
986 #define IWineD3DCubeTexture_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
987 #define IWineD3DCubeTexture_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
988 #define IWineD3DCubeTexture_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
989 #define IWineD3DCubeTexture_GetType(p)                 (p)->lpVtbl->GetType(p)
990 /*** IWineD3DCubeTexture methods: IWineD3DBaseTexture ***/
991 #define IWineD3DCubeTexture_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
992 #define IWineD3DCubeTexture_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
993 #define IWineD3DCubeTexture_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
994 #define IWineD3DCubeTexture_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
995 #define IWineD3DCubeTexture_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
996 #define IWineD3DCubeTexture_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
997 #define IWineD3DCubeTexture_SetDirty(p,a)              (p)->lpVtbl->SetDirty(p,a)
998 #define IWineD3DCubeTexture_GetDirty(p)                (p)->lpVtbl->GetDirty(p)
999 #define IWineD3DCubeTexture_BindTexture(p)              (p)->lpVtbl->BindTexture(p)
1000 #define IWineD3DCubeTexture_UnBindTexture(p)            (p)->lpVtbl->UnBindTexture(p)
1001 #define IWineD3DCubeTexture_GetTextureDimensions(p)     (p)->lpVtbl->GetTextureDimensions(p)
1002 #define IWineD3DCubeTexture_ApplyStateChanges(p,a,b)   (p)->lpVtbl->ApplyStateChanges(p,a,b)
1003 /*** IWineD3DCubeTexture methods ***/
1004 #define IWineD3DCubeTexture_GetLevelDesc(p,a,b)        (p)->lpVtbl->GetLevelDesc(p,a,b)
1005 #define IWineD3DCubeTexture_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c)
1006 #define IWineD3DCubeTexture_LockRect(p,a,b,c,d,e)      (p)->lpVtbl->LockRect(p,a,b,c,d,e)
1007 #define IWineD3DCubeTexture_UnlockRect(p,a,b)          (p)->lpVtbl->UnlockRect(p,a,b)
1008 #define IWineD3DCubeTexture_AddDirtyRect(p,a,b)        (p)->lpVtbl->AddDirtyRect(p,a,b)
1009 #endif
1010
1011
1012 /*****************************************************************************
1013  * IWineD3DVolumeTexture interface
1014  */
1015 #define INTERFACE IWineD3DVolumeTexture
1016 DECLARE_INTERFACE_(IWineD3DVolumeTexture,IWineD3DBaseTexture)
1017 {
1018     /*** IUnknown methods ***/
1019     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1020     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1021     STDMETHOD_(ULONG,Release)(THIS) PURE;
1022     /*** IWineD3DBase methods ***/
1023     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1024     /*** IWineD3DResource methods ***/
1025     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
1026     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
1027     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
1028     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
1029     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
1030     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
1031     STDMETHOD_(void,PreLoad)(THIS) PURE;
1032     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
1033     /*** IWineD3DBaseTexture methods ***/
1034     STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
1035     STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
1036     STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
1037     STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE;
1038     STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
1039     STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
1040     STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE;
1041     STDMETHOD_(BOOL, GetDirty)(THIS) PURE;
1042     STDMETHOD(BindTexture)(THIS) PURE;
1043     STDMETHOD(UnBindTexture)(THIS) PURE;
1044     STDMETHOD_(UINT, GetTextureDimensions)(THIS) PURE;
1045     STDMETHOD_(void, ApplyStateChanges)(THIS_ const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) PURE;
1046     /*** IWineD3DVolumeTexture methods ***/
1047     STDMETHOD(GetLevelDesc)(THIS_ UINT Level, WINED3DVOLUME_DESC *pDesc) PURE;
1048     STDMETHOD(GetVolumeLevel)(THIS_ UINT Level, struct IWineD3DVolume** ppVolumeLevel) PURE;
1049     STDMETHOD(LockBox)(THIS_ UINT Level, WINED3DLOCKED_BOX* pLockedVolume, CONST WINED3DBOX* pBox, DWORD Flags) PURE;
1050     STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE;
1051     STDMETHOD(AddDirtyBox)(THIS_ CONST WINED3DBOX* pDirtyBox) PURE;
1052 };
1053 #undef INTERFACE
1054
1055 #if !defined(__cplusplus) || defined(CINTERFACE)
1056 /*** IUnknown methods ***/
1057 #define IWineD3DVolumeTexture_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
1058 #define IWineD3DVolumeTexture_AddRef(p)                  (p)->lpVtbl->AddRef(p)
1059 #define IWineD3DVolumeTexture_Release(p)                 (p)->lpVtbl->Release(p)
1060 /*** IWineD3DBase methods ***/
1061 #define IWineD3DVolumeTexture_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
1062 /*** IWineD3DVolumeTexture methods: IWineD3DResource ***/
1063 #define IWineD3DVolumeTexture_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
1064 #define IWineD3DVolumeTexture_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
1065 #define IWineD3DVolumeTexture_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
1066 #define IWineD3DVolumeTexture_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
1067 #define IWineD3DVolumeTexture_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
1068 #define IWineD3DVolumeTexture_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
1069 #define IWineD3DVolumeTexture_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
1070 #define IWineD3DVolumeTexture_GetType(p)                 (p)->lpVtbl->GetType(p)
1071 /*** IWineD3DVolumeTexture methods: IWineD3DBaseTexture ***/
1072 #define IWineD3DVolumeTexture_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
1073 #define IWineD3DVolumeTexture_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
1074 #define IWineD3DVolumeTexture_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
1075 #define IWineD3DVolumeTexture_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
1076 #define IWineD3DVolumeTexture_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
1077 #define IWineD3DVolumeTexture_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
1078 #define IWineD3DVolumeTexture_SetDirty(p,a)              (p)->lpVtbl->SetDirty(p,a)
1079 #define IWineD3DVolumeTexture_GetDirty(p)                (p)->lpVtbl->GetDirty(p)
1080 #define IWineD3DVolumeTexture_BindTexture(p)              (p)->lpVtbl->BindTexture(p)
1081 #define IWineD3DVolumeTexture_UnBindTexture(p)            (p)->lpVtbl->UnBindTexture(p)
1082 #define IWineD3DVolumeTexture_GetTextureDimensions(p)     (p)->lpVtbl->GetTextureDimensions(p)
1083 #define IWineD3DVolumeTexture_ApplyStateChanges(p,a,b)   (p)->lpVtbl->ApplyStateChanges(p,a,b)
1084 /*** IWineD3DVolumeTexture methods ***/
1085 #define IWineD3DVolumeTexture_GetLevelDesc(p,a,b)        (p)->lpVtbl->GetLevelDesc(p,a,b)
1086 #define IWineD3DVolumeTexture_GetVolumeLevel(p,a,b)      (p)->lpVtbl->GetVolumeLevel(p,a,b)
1087 #define IWineD3DVolumeTexture_LockBox(p,a,b,c,d)         (p)->lpVtbl->LockBox(p,a,b,c,d)
1088 #define IWineD3DVolumeTexture_UnlockBox(p,a)             (p)->lpVtbl->UnlockBox(p,a)
1089 #define IWineD3DVolumeTexture_AddDirtyBox(p,a)           (p)->lpVtbl->AddDirtyBox(p,a)
1090 #endif
1091
1092 /*****************************************************************************
1093  * IWineD3DSurface interface
1094  */
1095 #define INTERFACE IWineD3DSurface
1096 DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource)
1097 {
1098     /*** IUnknown methods ***/
1099     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1100     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1101     STDMETHOD_(ULONG,Release)(THIS) PURE;
1102     /*** IWineD3DBase methods ***/
1103     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1104     /*** IWineD3DResource methods ***/
1105     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
1106     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
1107     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
1108     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
1109     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
1110     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
1111     STDMETHOD_(void,PreLoad)(THIS) PURE;
1112     STDMETHOD_(WINED3DRESOURCETYPE,GetType)(THIS) PURE;
1113     /*** IWineD3DSurface methods ***/
1114     STDMETHOD(GetContainerParent)(THIS_ IUnknown **ppContainerParent) PURE;
1115     STDMETHOD(GetContainer)(THIS_ REFIID  riid, void ** ppContainer) PURE;
1116     STDMETHOD(GetDesc)(THIS_ WINED3DSURFACE_DESC * pDesc) PURE;
1117     STDMETHOD(LockRect)(THIS_ WINED3DLOCKED_RECT * pLockedRect, CONST RECT * pRect,DWORD  Flags) PURE;
1118     STDMETHOD(UnlockRect)(THIS) PURE;
1119     STDMETHOD(GetDC)(THIS_ HDC *pHdc) PURE;
1120     STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE;
1121     STDMETHOD(Flip)(THIS_ IWineD3DSurface *Override, DWORD FLAGS) PURE;
1122     STDMETHOD(Blt)(THIS_ RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx) PURE;
1123     STDMETHOD(GetBltStatus)(THIS_ DWORD Flags) PURE;
1124     STDMETHOD(GetFlipStatus)(THIS_ DWORD Flags) PURE;
1125     STDMETHOD(IsLost)(THIS) PURE;
1126     STDMETHOD(Restore)(THIS) PURE;
1127     STDMETHOD(BltFast)(THIS_ DWORD dstx, DWORD dsty, IWineD3DSurface *src, RECT *rsrc, DWORD trans) PURE;
1128     STDMETHOD(GetPalette)(THIS_ struct IWineD3DPalette **Palette) PURE;
1129     STDMETHOD(SetPalette)(THIS_ struct IWineD3DPalette *Palette) PURE;
1130     STDMETHOD(RealizePalette)(THIS) PURE;
1131     STDMETHOD(SetColorKey)(THIS_ DWORD Flags, DDCOLORKEY *CKey) PURE;
1132     STDMETHOD_(DWORD,GetPitch)(THIS) PURE;
1133     STDMETHOD(SetMem)(THIS_ void *mem) PURE;
1134     /* Internally used methods */
1135     STDMETHOD(CleanDirtyRect)(THIS) PURE;
1136     STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pRect) PURE;
1137     STDMETHOD(LoadTexture)(THIS) PURE;
1138     STDMETHOD(SaveSnapshot)(THIS_ const char *filename) PURE;
1139     STDMETHOD(SetContainer)(THIS_ IWineD3DBase *container) PURE;
1140     STDMETHOD(SetPBufferState)(THIS_ BOOL inPBuffer, BOOL  inTexture) PURE;
1141     STDMETHOD_(void,SetGlTextureDesc)(THIS_ UINT textureName, int target) PURE;
1142     STDMETHOD_(void,GetGlDesc)(THIS_ glDescriptor **glDescription) PURE;
1143     STDMETHOD_(CONST void *, GetData)(THIS) PURE;
1144     STDMETHOD(SetFormat)(THIS_ WINED3DFORMAT format) PURE;
1145     STDMETHOD(PrivateSetup)(THIS) PURE;
1146 };
1147 #undef INTERFACE
1148
1149 #if !defined(__cplusplus) || defined(CINTERFACE)
1150 /*** IUnknown methods ***/
1151 #define IWineD3DSurface_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1152 #define IWineD3DSurface_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1153 #define IWineD3DSurface_Release(p)                   (p)->lpVtbl->Release(p)
1154 /*** IWineD3DBase methods ***/
1155 #define IWineD3DSurface_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
1156 /*** IWineD3DResource methods ***/
1157 #define IWineD3DSurface_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
1158 #define IWineD3DSurface_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
1159 #define IWineD3DSurface_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
1160 #define IWineD3DSurface_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
1161 #define IWineD3DSurface_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
1162 #define IWineD3DSurface_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
1163 #define IWineD3DSurface_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
1164 #define IWineD3DSurface_GetType(p)                   (p)->lpVtbl->GetType(p)
1165 /*** IWineD3DSurface methods ***/
1166 #define IWineD3DSurface_GetContainerParent(p,a)      (p)->lpVtbl->GetContainerParent(p,a)
1167 #define IWineD3DSurface_GetContainer(p,a,b)          (p)->lpVtbl->GetContainer(p,a,b)
1168 #define IWineD3DSurface_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
1169 #define IWineD3DSurface_LockRect(p,a,b,c)            (p)->lpVtbl->LockRect(p,a,b,c)
1170 #define IWineD3DSurface_UnlockRect(p)                (p)->lpVtbl->UnlockRect(p)
1171 #define IWineD3DSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
1172 #define IWineD3DSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
1173 #define IWineD3DSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
1174 #define IWineD3DSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
1175 #define IWineD3DSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
1176 #define IWineD3DSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
1177 #define IWineD3DSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
1178 #define IWineD3DSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
1179 #define IWineD3DSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
1180 #define IWineD3DSurface_GetPalette(p, a)             (p)->lpVtbl->GetPalette(p, a)
1181 #define IWineD3DSurface_SetPalette(p, a)             (p)->lpVtbl->SetPalette(p, a)
1182 #define IWineD3DSurface_RealizePalette(p)            (p)->lpVtbl->RealizePalette(p)
1183 #define IWineD3DSurface_SetColorKey(p, a, b)         (p)->lpVtbl->SetColorKey(p, a, b)
1184 #define IWineD3DSurface_GetPitch(p)                  (p)->lpVtbl->GetPitch(p)
1185 #define IWineD3DSurface_SetMem(p, a)                 (p)->lpVtbl->SetMem(p, a)
1186 /*** IWineD3DSurface (Internal, no d3d mapping) methods ***/
1187 #define IWineD3DSurface_CleanDirtyRect(p)            (p)->lpVtbl->CleanDirtyRect(p)
1188 #define IWineD3DSurface_AddDirtyRect(p,a)            (p)->lpVtbl->AddDirtyRect(p,a)
1189 #define IWineD3DSurface_LoadTexture(p)               (p)->lpVtbl->LoadTexture(p)
1190 #define IWineD3DSurface_SaveSnapshot(p,a)            (p)->lpVtbl->SaveSnapshot(p,a)
1191 #define IWineD3DSurface_SetContainer(p,a)            (p)->lpVtbl->SetContainer(p,a)
1192 #define IWineD3DSurface_SetPBufferState(p,a,b)       (p)->lpVtbl->SetPBufferState(p,a,b)
1193 #define IWineD3DSurface_SetGlTextureDesc(p,a,b)      (p)->lpVtbl->SetGlTextureDesc(p,a,b)
1194 #define IWineD3DSurface_GetGlDesc(p,a)               (p)->lpVtbl->GetGlDesc(p,a)
1195 #define IWineD3DSurface_GetData(p)                   (p)->lpVtbl->GetData(p)
1196 #define IWineD3DSurface_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
1197 #define IWineD3DSurface_PrivateSetup(p)              (p)->lpVtbl->PrivateSetup(p)
1198 #endif
1199
1200 /*****************************************************************************
1201  * IWineD3DVolume interface
1202  */
1203 #define INTERFACE IWineD3DVolume
1204 DECLARE_INTERFACE_(IWineD3DVolume,IWineD3DResource)
1205 {
1206     /*** IUnknown methods ***/
1207     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1208     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1209     STDMETHOD_(ULONG,Release)(THIS) PURE;
1210     /*** IWineD3DBase methods ***/
1211     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1212     /*** IWineD3DResource methods ***/    
1213     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE;
1214     STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
1215     STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
1216     STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
1217     STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
1218     STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
1219     STDMETHOD_(void,PreLoad)(THIS) PURE;
1220     STDMETHOD_(WINED3DRESOURCETYPE, GetType)(THIS) PURE;    
1221     /*** IWineD3DVolume methods ***/    
1222     STDMETHOD(GetContainerParent)(THIS_ IUnknown **ppContainerParent) PURE;
1223     STDMETHOD(GetContainer)(THIS_ REFIID  riid, void ** ppContainer) PURE;
1224     STDMETHOD(GetDesc)(THIS_ WINED3DVOLUME_DESC * pDesc) PURE;
1225     STDMETHOD(LockBox)(THIS_ WINED3DLOCKED_BOX* pLockedVolume, CONST WINED3DBOX* pBox, DWORD Flags) PURE;
1226     STDMETHOD(UnlockBox)(THIS) PURE;
1227     STDMETHOD(AddDirtyBox)(THIS_ CONST WINED3DBOX* pDirtyBox) PURE;
1228     STDMETHOD(CleanDirtyBox)(THIS) PURE;
1229     STDMETHOD(LoadTexture)(THIS_ UINT gl_level) PURE;
1230     STDMETHOD(SetContainer)(THIS_ IWineD3DBase *container) PURE;
1231 };
1232 #undef INTERFACE
1233
1234 #if !defined(__cplusplus) || defined(CINTERFACE)
1235 /*** IUnknown methods ***/
1236 #define IWineD3DVolume_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
1237 #define IWineD3DVolume_AddRef(p)                  (p)->lpVtbl->AddRef(p)
1238 #define IWineD3DVolume_Release(p)                 (p)->lpVtbl->Release(p)
1239 /*** IWineD3DBase methods ***/
1240 #define IWineD3DVolume_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
1241 /*** IWineD3DResource methods ***/
1242 #define IWineD3DVolume_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
1243 #define IWineD3DVolume_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
1244 #define IWineD3DVolume_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
1245 #define IWineD3DVolume_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
1246 #define IWineD3DVolume_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
1247 #define IWineD3DVolume_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
1248 #define IWineD3DVolume_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
1249 #define IWineD3DVolume_GetType(p)                 (p)->lpVtbl->GetType(p)
1250 /*** IWineD3DVolume methods ***/
1251 #define IWineD3DVolume_GetContainerParent(p,a)    (p)->lpVtbl->GetContainerParent(p,a)
1252 #define IWineD3DVolume_GetContainer(p,a,b)        (p)->lpVtbl->GetContainer(p,a,b)
1253 #define IWineD3DVolume_GetDesc(p,a)               (p)->lpVtbl->GetDesc(p,a)
1254 #define IWineD3DVolume_LockBox(p,a,b,c)           (p)->lpVtbl->LockBox(p,a,b,c)
1255 #define IWineD3DVolume_UnlockBox(p)               (p)->lpVtbl->UnlockBox(p)
1256 #define IWineD3DVolume_AddDirtyBox(p,a)           (p)->lpVtbl->AddDirtyBox(p,a)
1257 #define IWineD3DVolume_CleanDirtyBox(p)           (p)->lpVtbl->CleanDirtyBox(p)
1258 #define IWineD3DVolume_LoadTexture(p,a)           (p)->lpVtbl->LoadTexture(p,a)
1259 #define IWineD3DVolume_SetContainer(p,a)          (p)->lpVtbl->SetContainer(p,a)
1260 #endif
1261
1262 /*****************************************************************************
1263  * IWineD3DVertexDeclaration interface
1264  */
1265 #define INTERFACE IWineD3DVertexDeclaration
1266 DECLARE_INTERFACE_(IWineD3DVertexDeclaration,IWineD3DBase)
1267 {
1268     /*** IUnknown methods ***/
1269     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
1270     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1271     STDMETHOD_(ULONG,Release)(THIS) PURE;
1272     /*** IWineD3DBase methods ***/
1273     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1274     /*** IWineD3DVertexDeclaration methods ***/
1275     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice **ppDevice) PURE;
1276     STDMETHOD(GetDeclaration)(THIS_ VOID *pDecl, DWORD *pSize) PURE;
1277     STDMETHOD(SetDeclaration)(THIS_ VOID *pDecl) PURE;
1278 };
1279 #undef INTERFACE
1280
1281 #if !defined(__cplusplus) || defined(CINTERFACE)
1282 /*** IUnknown methods ***/
1283 #define IWineD3DVertexDeclaration_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
1284 #define IWineD3DVertexDeclaration_AddRef(p)                  (p)->lpVtbl->AddRef(p)
1285 #define IWineD3DVertexDeclaration_Release(p)                 (p)->lpVtbl->Release(p)
1286 /*** IWineD3DBase methods ***/
1287 #define IWineD3DVertexDeclaration_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
1288 /*** IWineD3DVertexDeclaration methods ***/
1289 #define IWineD3DVertexDeclaration_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
1290 #define IWineD3DVertexDeclaration_GetDeclaration(p,a,b)      (p)->lpVtbl->GetDeclaration(p,a,b)
1291 #define IWineD3DVertexDeclaration_SetDeclaration(p,b)        (p)->lpVtbl->SetDeclaration(p,b)
1292 #endif
1293
1294 /*****************************************************************************
1295  * IWineD3DStateBlock interface 
1296  */
1297 #define INTERFACE IWineD3DStateBlock
1298 DECLARE_INTERFACE_(IWineD3DStateBlock,IWineD3DBase)
1299 {
1300     /*** IUnknown methods ***/
1301     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1302     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1303     STDMETHOD_(ULONG,Release)(THIS) PURE;
1304     /*** IWineD3DBase methods ***/
1305     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1306     /*** IWineD3DStateBlock methods ***/
1307     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice **pDevice) PURE;
1308     STDMETHOD(Capture)(THIS) PURE;
1309     STDMETHOD(Apply)(THIS) PURE;
1310     STDMETHOD(InitStartupStateBlock)(THIS) PURE;
1311 };
1312 #undef INTERFACE
1313
1314 #if !defined(__cplusplus) || defined(CINTERFACE)
1315 /*** IUnknown methods ***/
1316 #define IWineD3DStateBlock_QueryInterface(p,a,b)                (p)->lpVtbl->QueryInterface(p,a,b)
1317 #define IWineD3DStateBlock_AddRef(p)                            (p)->lpVtbl->AddRef(p)
1318 #define IWineD3DStateBlock_Release(p)                           (p)->lpVtbl->Release(p)
1319 /*** IWineD3DBase methods ***/
1320 #define IWineD3DStateBlock_GetParent(p,a)                       (p)->lpVtbl->GetParent(p,a)
1321 /*** IWineD3DStateBlock methods ***/
1322 #define IWineD3DStateBlock_GetDevice(p,a)                       (p)->lpVtbl->GetDevice(p,a)
1323 #define IWineD3DStateBlock_Capture(p)                           (p)->lpVtbl->Capture(p)
1324 #define IWineD3DStateBlock_Apply(p)                             (p)->lpVtbl->Apply(p)
1325 #define IWineD3DStateBlock_InitStartupStateBlock(p)             (p)->lpVtbl->InitStartupStateBlock(p)
1326 #endif
1327
1328 /*****************************************************************************
1329  * WineD3DQuery interface 
1330  */
1331 #define INTERFACE IWineD3DQuery
1332 DECLARE_INTERFACE_(IWineD3DQuery,IWineD3DBase)
1333 {
1334     /*** IUnknown methods ***/
1335     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
1336     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1337     STDMETHOD_(ULONG,Release)(THIS) PURE;
1338     /*** IWineD3DBase methods ***/
1339     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1340     /*** IWineD3DQuery methods ***/
1341     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice **ppDevice) PURE;
1342     STDMETHOD(GetData)(THIS_  void *pData, DWORD dwSize, DWORD dwGetDataFlags) PURE;
1343     STDMETHOD_(DWORD,GetDataSize)(THIS) PURE;
1344     STDMETHOD_(WINED3DQUERYTYPE, GetType)(THIS) PURE;
1345     STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE;
1346     
1347 };
1348 #undef INTERFACE
1349
1350 #if !defined(__cplusplus) || defined(CINTERFACE)
1351 /*** IUnknown methods ***/
1352 #define IWineD3DQuery_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1353 #define IWineD3DQuery_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1354 #define IWineD3DQuery_Release(p)                   (p)->lpVtbl->Release(p)
1355 /*** IWineD3DBase methods ***/
1356 #define IWineD3DQuery_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
1357 /*** IWineD3DQuery methods ***/
1358 #define IWineD3DQuery_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
1359 #define IWineD3DQuery_GetData(p,a,b,c)             (p)->lpVtbl->GetData(p,a,b,c)
1360 #define IWineD3DQuery_GetDataSize(p)               (p)->lpVtbl->GetDataSize(p)
1361 #define IWineD3DQuery_GetType(p)                   (p)->lpVtbl->GetType(p)
1362 #define IWineD3DQuery_Issue(p,a)                   (p)->lpVtbl->Issue(p,a)
1363
1364 #endif
1365
1366 /*****************************************************************************
1367  * IWineD3DSwapChain interface
1368  * TODO: add gamma-ramp setting functions to make life easier
1369  * (There kinda missing from Microsofts DirectX!)
1370  */
1371 #define INTERFACE IWineD3DSwapChain
1372 DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
1373 {
1374     /*** IUnknown methods ***/
1375     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
1376     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1377     STDMETHOD_(ULONG,Release)(THIS) PURE;
1378     /*** IWineD3DBase methods ***/
1379     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1380     /*** IDirect3DSwapChain9 methods ***/
1381     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice **ppDevice) PURE;
1382     STDMETHOD(Present)(THIS_ CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) PURE;
1383     STDMETHOD(GetFrontBufferData)(THIS_ IWineD3DSurface *pDestSurface) PURE;
1384     STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, WINED3DBACKBUFFER_TYPE Type, IWineD3DSurface **ppBackBuffer) PURE;
1385     STDMETHOD(GetRasterStatus)(THIS_ WINED3DRASTER_STATUS *pRasterStatus) PURE;
1386     STDMETHOD(GetDisplayMode)(THIS_ WINED3DDISPLAYMODE *pMode) PURE;
1387     STDMETHOD(GetPresentParameters)(THIS_ WINED3DPRESENT_PARAMETERS *pPresentationParameters) PURE;
1388     STDMETHOD(SetGammaRamp)(THIS_ DWORD Flags, const WINED3DGAMMARAMP *pRamp) PURE;
1389     STDMETHOD(GetGammaRamp)(THIS_ WINED3DGAMMARAMP *pRamp) PURE;
1390 };
1391 #undef INTERFACE
1392
1393 #if !defined(__cplusplus) || defined(CINTERFACE)
1394 /*** IUnknown methods ***/
1395 #define IWineD3DSwapChain_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
1396 #define IWineD3DSwapChain_AddRef(p)                    (p)->lpVtbl->AddRef(p)
1397 #define IWineD3DSwapChain_Release(p)                   (p)->lpVtbl->Release(p)
1398 /*** IWineD3DBase methods ***/
1399 #define IWineD3DSwapChain_GetParent(p,a)               (p)->lpVtbl->GetParent(p,a)
1400 /*** IWineD3DSwapChain methods ***/
1401
1402 #define IWineD3DSwapChain_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
1403 #define IWineD3DSwapChain_Present(p,a,b,c,d,e)         (p)->lpVtbl->Present(p,a,b,c,d,e)
1404 #define IWineD3DSwapChain_GetFrontBufferData(p,a)      (p)->lpVtbl->GetFrontBufferData(p,a)
1405 #define IWineD3DSwapChain_GetBackBuffer(p,a,b,c)       (p)->lpVtbl->GetBackBuffer(p,a,b,c)
1406 #define IWineD3DSwapChain_GetRasterStatus(p,a)         (p)->lpVtbl->GetRasterStatus(p,a)
1407 #define IWineD3DSwapChain_GetDisplayMode(p,a)          (p)->lpVtbl->GetDisplayMode(p,a)
1408 #define IWineD3DSwapChain_GetPresentParameters(p,a)    (p)->lpVtbl->GetPresentParameters(p,a)
1409 #define IWineD3DSwapChain_SetGammaRamp(p,a,b)          (p)->lpVtbl->SetGammaRamp(p,a,b)
1410 #define IWineD3DSwapChain_GetGammaRamp(p,a)            (p)->lpVtbl->GetGammaRamp(p,a)
1411 #endif
1412
1413 /*****************************************************************************
1414  * IWineD3DBaseShader interface
1415  */
1416 #define INTERFACE IWineD3DBaseShader
1417 DECLARE_INTERFACE_(IWineD3DBaseShader,IWineD3DBase)
1418 {
1419     /*** IUnknown methods ***/
1420     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1421     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1422     STDMETHOD_(ULONG,Release)(THIS) PURE;
1423     /*** IWineD3DBase methods ***/
1424     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1425     /*** IWineD3DBaseShader methods ***/
1426     STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
1427     STDMETHOD(CompileShader)(THIS) PURE;
1428 };
1429 #undef INTERFACE
1430
1431 #if !defined(__cplusplus) || defined(CINTERFACE)
1432 /*** IUnknown methods ***/
1433 #define IWineD3DBaseShader_QueryInterface(p,a,b)     (p)->lpVtbl->QueryInterface(p,a,b)
1434 #define IWineD3DBaseShader_AddRef(p)                 (p)->lpVtbl->AddRef(p)
1435 #define IWineD3DBaseShader_Release(p)                (p)->lpVtbl->Release(p)
1436 /*** IWineD3DBase methods ***/
1437 #define IWineD3DBaseShader_GetParent(p,a)            (p)->lpVtbl->GetParent(p,a)
1438 /*** IWineD3DBaseShader methods ***/
1439 #define IWineD3DBaseShader_SetFunction(p,a)          (p)->lpVtbl->SetFunction(p,a)
1440 #define IWineD3DBaseShader_CompileShader(p)          (p)->lpVtbl->CompileShader(p)
1441 #endif
1442
1443 /*****************************************************************************
1444  * IWineD3DVertexShader interface 
1445  */
1446 #define INTERFACE IWineD3DVertexShader
1447 DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBaseShader)
1448 {
1449     /*** IUnknown methods ***/
1450     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1451     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1452     STDMETHOD_(ULONG,Release)(THIS) PURE;
1453     /*** IWineD3DBase methods ***/
1454     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1455     /*** IWineD3DBaseShader methods ***/
1456     STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
1457     STDMETHOD(CompileShader)(THIS) PURE;
1458     /*** IWineD3DVertexShader methods ***/
1459     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE;
1460     STDMETHOD(GetFunction)(THIS_ VOID *pData, UINT *pSizeOfData) PURE;
1461     STDMETHOD(SetConstantB)(THIS_ UINT StartRegister, CONST BOOL*  pConstantData, UINT BoolCount) PURE;
1462     STDMETHOD(SetConstantI)(THIS_ UINT StartRegister, CONST INT*   pConstantData, UINT Vector4iCount) PURE;
1463     STDMETHOD(SetConstantF)(THIS_ UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount) PURE;
1464     STDMETHOD(GetConstantB)(THIS_ UINT StartRegister, BOOL*  pConstantData, UINT BoolCount) PURE;
1465     STDMETHOD(GetConstantI)(THIS_ UINT StartRegister, INT*   pConstantData, UINT Vector4iCount) PURE;
1466     STDMETHOD(GetConstantF)(THIS_ UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount) PURE;
1467     /* Internal Interfaces */
1468     STDMETHOD_(DWORD, GetVersion)(THIS) PURE;
1469 };
1470 #undef INTERFACE
1471
1472 #if !defined(__cplusplus) || defined(CINTERFACE)
1473 /*** IUnknown methods ***/
1474 #define IWineD3DVertexShader_QueryInterface(p,a,b)     (p)->lpVtbl->QueryInterface(p,a,b)
1475 #define IWineD3DVertexShader_AddRef(p)                 (p)->lpVtbl->AddRef(p)
1476 #define IWineD3DVertexShader_Release(p)                (p)->lpVtbl->Release(p)
1477 /*** IWineD3DBase methods ***/
1478 #define IWineD3DVertexShader_GetParent(p,a)            (p)->lpVtbl->GetParent(p,a)
1479 /*** IWineD3DBaseShader methods ***/
1480 #define IWineD3DVertexShader_SetFunction(p,a)          (p)->lpVtbl->SetFunction(p,a)
1481 #define IWineD3DVertexShader_CompileShader(p)          (p)->lpVtbl->CompileShader(p)
1482 /*** IWineD3DVertexShader methods ***/
1483 #define IWineD3DVertexShader_GetDevice(p,a)            (p)->lpVtbl->GetDevice(p,a)
1484 #define IWineD3DVertexShader_GetFunction(p,a,b)        (p)->lpVtbl->GetFunction(p,a,b)
1485 #define IWineD3DVertexShader_SetConstantB(p,a,b,c)     (p)->lpVtbl->SetConstantB(p,a,b,c)
1486 #define IWineD3DVertexShader_SetConstantI(p,a,b,c)     (p)->lpVtbl->SetConstantI(p,a,b,c)
1487 #define IWineD3DVertexShader_SetConstantF(p,a,b,c)     (p)->lpVtbl->SetConstantF(p,a,b,c)
1488 #define IWineD3DVertexShader_GetConstantB(p,a,b,c)     (p)->lpVtbl->GetConstantB(p,a,b,c)
1489 #define IWineD3DVertexShader_GetConstantI(p,a,b,c)     (p)->lpVtbl->GetConstantI(p,a,b,c)
1490 #define IWineD3DVertexShader_GetConstantF(p,a,b,c)     (p)->lpVtbl->GetConstantF(p,a,b,c)
1491 #define IWineD3DVertexShader_GetVersion(p)             (p)->lpVtbl->GetVersion(p)
1492 #endif
1493
1494 /*****************************************************************************
1495  * IWineD3DPixelShader interface
1496  */
1497 #define INTERFACE IWineD3DPixelShader
1498 DECLARE_INTERFACE_(IWineD3DPixelShader,IWineD3DBaseShader)
1499 {
1500     /*** IUnknown methods ***/
1501     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1502     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1503     STDMETHOD_(ULONG,Release)(THIS) PURE;
1504     /*** IWineD3DBase methods ***/
1505     STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
1506     /*** IWineD3DBaseShader methods ***/
1507     STDMETHOD(SetFunction)(THIS_ CONST DWORD *pFunction) PURE;
1508     STDMETHOD(CompileShader)(THIS) PURE;
1509     /*** IWineD3DPixelShader methods ***/
1510     STDMETHOD(GetDevice)(THIS_ IWineD3DDevice** ppDevice) PURE;
1511     STDMETHOD(GetFunction)(THIS_ VOID* pData, UINT* pSizeOfData) PURE;
1512 };
1513 #undef INTERFACE
1514
1515 #if !defined(__cplusplus) || defined(CINTERFACE)
1516 /*** IUnknown methods ***/
1517 #define IWineD3DPixelShader_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
1518 #define IWineD3DPixelShader_AddRef(p)                  (p)->lpVtbl->AddRef(p)
1519 #define IWineD3DPixelShader_Release(p)                 (p)->lpVtbl->Release(p)
1520 /*** IWineD3DBase methods ***/
1521 #define IWineD3DPixelShader_GetParent(p,a)             (p)->lpVtbl->GetParent(p,a)
1522 /*** IWineD3DBaseShader methods ***/
1523 #define IWineD3DPixelShader_SetFunction(p,a)           (p)->lpVtbl->SetFunction(p,a)
1524 #define IWineD3DPixelShader_CompileShader(p)           (p)->lpVtbl->CompileShader(p)
1525 /*** IWineD3DPixelShader methods ***/
1526 #define IWineD3DPixelShader_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
1527 #define IWineD3DPixelShader_GetFunction(p,a,b)         (p)->lpVtbl->GetFunction(p,a,b)
1528 #endif
1529
1530 /*****************************************************************************
1531  * IWineD3DPalette interface
1532  */
1533 #define INTERFACE IWineD3DPalette
1534 DECLARE_INTERFACE_(IWineD3DPalette,IUnknown)
1535 {
1536     /*** IUnknown methods ***/
1537     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1538     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1539     STDMETHOD_(ULONG,Release)(THIS) PURE;
1540     /*** IWineD3DPalette methods ***/
1541     STDMETHOD_(HRESULT,GetParent)(THIS_ IUnknown **Parent);
1542     STDMETHOD_(HRESULT,GetEntries)(THIS_ DWORD Flags, DWORD Start, DWORD Count, PALETTEENTRY *PalEnt);
1543     STDMETHOD_(HRESULT,GetCaps)(THIS_ DWORD *Caps);
1544     STDMETHOD_(HRESULT,SetEntries)(THIS_ DWORD Flags, DWORD Start, DWORD Count, PALETTEENTRY *PalEnt);
1545 };
1546 #undef INTERFACE
1547
1548 #if !defined(__cplusplus) || defined(CINTERFACE)
1549 /*** IUnknown methods ***/
1550 #define IWineD3DPalette_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
1551 #define IWineD3DPalette_AddRef(p)                  (p)->lpVtbl->AddRef(p)
1552 #define IWineD3DPalette_Release(p)                 (p)->lpVtbl->Release(p)
1553 /*** IWineD3DPalette methods ***/
1554 #define IWineD3DPalette_GetParent(p, a)            (p)->lpVtbl->GetParent(p, a)
1555 #define IWineD3DPalette_GetEntries(p, a, b, c, d)  (p)->lpVtbl->GetEntries(p, a, b, c, d)
1556 #define IWineD3DPalette_GetCaps(p, a)              (p)->lpVtbl->GetCaps(p, a)
1557 #define IWineD3DPalette_SetEntries(p, a, b, c, d)  (p)->lpVtbl->SetEntries(p, a, b, c, d)
1558 #endif
1559
1560 #if 0 /* FIXME: During porting in from d3d8 - the following will be used */
1561 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl* This, CONST DWORD* pFunction);
1562 /* internal Interfaces */
1563 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA* input, VSHADEROUTPUTDATA* output);
1564 #endif /* Temporary #if 0 */
1565
1566
1567 #endif