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 #define COM_NO_WINDOWS_H
32 #include <objbase.h>
33
34 /* Stupid DDraw Struct references surfaces */
35 struct IWineD3DSurface;
36
37 #include "wined3d_types.h"
38 /*****************************************************************
39 * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES
40 * PLEASE USE wine/wined3d_gl.h INSTEAD
41 */
42
43 /*****************************************************************************
44 * #defines and error codes
45 */
46 #define _FACWINED3D 0x876
47 #define MAKE_WINED3DHRESULT( code ) MAKE_HRESULT( 1, _FACWINED3D, code )
48 #define MAKE_WINED3DSTATUS( code ) MAKE_HRESULT( 0, _FACWINED3D, code )
49
50 /*****************************************************************************
51 * Direct3D Errors
52 */
53 #define WINED3D_OK S_OK
54 #define WINED3DERR_WRONGTEXTUREFORMAT MAKE_WINED3DHRESULT(2072)
55 #define WINED3DERR_UNSUPPORTEDCOLOROPERATION MAKE_WINED3DHRESULT(2073)
56 #define WINED3DERR_UNSUPPORTEDCOLORARG MAKE_WINED3DHRESULT(2074)
57 #define WINED3DERR_UNSUPPORTEDALPHAOPERATION MAKE_WINED3DHRESULT(2075)
58 #define WINED3DERR_UNSUPPORTEDALPHAARG MAKE_WINED3DHRESULT(2076)
59 #define WINED3DERR_TOOMANYOPERATIONS MAKE_WINED3DHRESULT(2077)
60 #define WINED3DERR_CONFLICTINGTEXTUREFILTER MAKE_WINED3DHRESULT(2078)
61 #define WINED3DERR_UNSUPPORTEDFACTORVALUE MAKE_WINED3DHRESULT(2079)
62 #define WINED3DERR_CONFLICTINGRENDERSTATE MAKE_WINED3DHRESULT(2081)
63 #define WINED3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_WINED3DHRESULT(2082)
64 #define WINED3DERR_CONFLICTINGTEXTUREPALETTE MAKE_WINED3DHRESULT(2086)
65 #define WINED3DERR_DRIVERINTERNALERROR MAKE_WINED3DHRESULT(2087)
66 #define WINED3DERR_NOTFOUND MAKE_WINED3DHRESULT(2150)
67 #define WINED3DERR_MOREDATA MAKE_WINED3DHRESULT(2151)
68 #define WINED3DERR_DEVICELOST MAKE_WINED3DHRESULT(2152)
69 #define WINED3DERR_DEVICENOTRESET MAKE_WINED3DHRESULT(2153)
70 #define WINED3DERR_NOTAVAILABLE MAKE_WINED3DHRESULT(2154)
71 #define WINED3DERR_OUTOFVIDEOMEMORY MAKE_WINED3DHRESULT(380)
72 #define WINED3DERR_INVALIDDEVICE MAKE_WINED3DHRESULT(2155)
73 #define WINED3DERR_INVALIDCALL MAKE_WINED3DHRESULT(2156)
74 #define WINED3DERR_DRIVERINVALIDCALL MAKE_WINED3DHRESULT(2157)
75 #define WINED3DERR_WASSTILLDRAWING MAKE_WINED3DHRESULT(540)
76 #define WINEDDERR_NOTAOVERLAYSURFACE MAKE_WINED3DHRESULT(580)
77 #define WINEDDERR_NODC MAKE_WINED3DHRESULT(586)
78 #define WINEDDERR_DCALREADYCREATED MAKE_WINED3DHRESULT(620)
79 #define WINEDDERR_NOTFLIPPABLE MAKE_WINED3DHRESULT(582)
80 #define WINEDDERR_SURFACEBUSY MAKE_WINED3DHRESULT(430)
81 #define WINEDDERR_INVALIDRECT MAKE_WINED3DHRESULT(150)
82 #define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205)
83 #define WINED3DOK_NOAUTOGEN MAKE_WINED3DSTATUS(2159)
84
85 /*****************************************************************************
86 * Predeclare the interfaces
87 */
88
89 struct IWineD3D;
90 struct IWineD3DBase;
91 struct IWineD3DDevice;
92 struct IWineD3DPalette;
93 struct IWineD3DResource;
94 struct IWineD3DVertexBuffer;
95 struct IWineD3DIndexBuffer;
96 struct IWineD3DBaseTexture;
97 struct IWineD3DTexture;
98 struct IWineD3DCubeTexture;
99 struct IWineD3DVolumeTexture;
100 struct IWineD3DStateBlock;
101 struct IWineD3DVolume;
102 struct IWineD3DVertexDeclaration;
103 struct IWineD3DBaseShader;
104 struct IWineD3DVertexShader;
105 struct IWineD3DPixelShader;
106 struct IWineD3DQuery;
107 struct IWineD3DSwapChain;
108 struct IWineD3DClipper;
109
110
111 /* {108F9C44-6F30-11d9-C687-00046142C14F} */
112 DEFINE_GUID(IID_IWineD3D,
113 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
114
115 DEFINE_GUID(IID_IWineD3DBase,
116 0x46799311, 0x8e0e, 0x40ce, 0xb2, 0xec, 0xdd, 0xb9, 0x9f, 0x18, 0xfc, 0xb4);
117
118 /* {108F9C44-6F30-11d9-C687-00046142C14F} */
119 DEFINE_GUID(IID_IWineD3DDevice,
120 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
121
122 /* {f756720c-32b9-4439-b5a3-1d6c97037d9e} */
123 DEFINE_GUID(IID_IWineD3DPalette,
124 0xf756720c, 0x32b9, 0x4439, 0xb5, 0xa3, 0x1d, 0x6c, 0x97, 0x03, 0x7d, 0x9e);
125
126 /* {1F3BFB34-6F30-11d9-C687-00046142C14F} */
127 DEFINE_GUID(IID_IWineD3DResource,
128 0x1f3bfb34, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
129
130 /* {217F671E-6F30-11d9-C687-00046142C14F} */
131 DEFINE_GUID(IID_IWineD3DVertexBuffer,
132 0x217f671e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
133
134 /* {24769ED8-6F30-11d9-C687-00046142C14F} */
135 DEFINE_GUID(IID_IWineD3DVolume,
136 0x24769ed8, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
137
138
139 /* {34D01B10-6F30-11d9-C687-00046142C14F} */
140 DEFINE_GUID(IID_IWineD3DSwapChain,
141 0x34d01b10, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
142
143 /* {37CD5526-6F30-11d9-C687-00046142C14F} */
144 DEFINE_GUID(IID_IWineD3DSurface,
145 0x37cd5526, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
146
147
148 /* {3A02A54E-6F30-11d9-C687-00046142C14F} */
149 DEFINE_GUID(IID_IWineD3DIndexBuffer,
150 0x3a02a54e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
151
152 /* {3C2AEBF6-6F30-11d9-C687-00046142C14F} */
153 DEFINE_GUID(IID_IWineD3DBaseTexture,
154 0x3c2aebf6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
155
156 /* {3E72CC1C-6F30-11d9-C687-00046142C14F} */
157 DEFINE_GUID(IID_IWineD3DTexture,
158 0x3e72cc1c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
159
160 /* {41752900-6F30-11d9-C687-00046142C14F} */
161 DEFINE_GUID(IID_IWineD3DCubeTexture,
162 0x41752900, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
163
164 /* {7B39470C-6F30-11d9-C687-00046142C14F} */
165 DEFINE_GUID(IID_IWineD3DVolumeTexture,
166 0x7b39470c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
167
168 /* {7CD55BE6-6F30-11d9-C687-00046142C14F} */
169 DEFINE_GUID(IID_IWineD3DVertexDeclaration,
170 0x7cd55be6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
171
172 /* {EAC93065-A4DF-446F-86A1-9EF2BCA40A3C} */
173 DEFINE_GUID(IID_IWineD3DBaseShader,
174 0xeac93065, 0xa4df, 0x446f, 0x86, 0xa1, 0x9e, 0xf2, 0xbc, 0xa4, 0x0a, 0x3c);
175
176 /* {7F7A2B60-6F30-11d9-C687-00046142C14F} */
177 DEFINE_GUID(IID_IWineD3DVertexShader,
178 0x7f7a2b60, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
179
180 /* {818503DA-6F30-11d9-C687-00046142C14F} */
181 DEFINE_GUID(IID_IWineD3DPixelShader,
182 0x818503da, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
183
184 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
185 DEFINE_GUID(IID_IWineD3DStateBlock,
186 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
187
188 /* {905DDBAC-6F30-11d9-C687-00046142C14F} */
189 DEFINE_GUID(IID_IWineD3DQuery,
190 0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
191
192 /* {8f2bceb1-d338-488c-ab7f-0ec980bf5d2d} */
193 DEFINE_GUID(IID_IWineD3DClipper,
194 0x8f2bceb1, 0xd338, 0x488c, 0xab, 0x7f, 0x0e, 0xc9, 0x80, 0xbf, 0x5d, 0x2d);
195
196 /*****************************************************************************
197 * Callback functions required for predefining surfaces / stencils
198 */
199 typedef HRESULT (WINAPI *D3DCB_CREATERENDERTARGETFN) (IUnknown *pDevice,
200 IUnknown *pSuperior,
201 UINT Width,
202 UINT Height,
203 WINED3DFORMAT Format,
204 WINED3DMULTISAMPLE_TYPE MultiSample,
205 DWORD MultisampleQuality,
206 BOOL Lockable,
207 struct IWineD3DSurface **ppSurface,
208 HANDLE *pSharedHandle);
209
210 typedef HRESULT (WINAPI *D3DCB_CREATESURFACEFN) (IUnknown *pDevice,
211 IUnknown *pSuperior,
212 UINT Width,
213 UINT Height,
214 WINED3DFORMAT Format,
215 DWORD Usage,
216 WINED3DPOOL Pool,
217 UINT Level,
218 WINED3DCUBEMAP_FACES Face,
219 struct IWineD3DSurface **ppSurface,
220 HANDLE *pSharedHandle);
221
222 typedef HRESULT (WINAPI *D3DCB_CREATEDEPTHSTENCILSURFACEFN) (IUnknown *pDevice,
223 IUnknown *pSuperior,
224 UINT Width,
225 UINT Height,
226 WINED3DFORMAT Format,
227 WINED3DMULTISAMPLE_TYPE MultiSample,
228 DWORD MultisampleQuality,
229 BOOL Discard,
230 struct IWineD3DSurface **ppSurface,
231 HANDLE *pSharedHandle);
232
233
234 typedef HRESULT (WINAPI *D3DCB_CREATEVOLUMEFN) (IUnknown *pDevice,
235 IUnknown *pSuperior,
236 UINT Width,
237 UINT Height,
238 UINT Depth,
239 WINED3DFORMAT Format,
240 WINED3DPOOL Pool,
241 DWORD Usage,
242 struct IWineD3DVolume **ppVolume,
243 HANDLE *pSharedHandle);
244
245 typedef HRESULT (WINAPI *D3DCB_CREATEADDITIONALSWAPCHAIN) (IUnknown *pDevice,
246 WINED3DPRESENT_PARAMETERS *pPresentationParameters,
247 struct IWineD3DSwapChain **pSwapChain
248 );
249
250 typedef HRESULT (WINAPI *D3DCB_ENUMRESOURCES) (struct IWineD3DResource *resource,
251 void *pData
252 );
253
254 /*****************************************************************************
255 * Callback functions for custom implicit object destruction.
256 */
257 typedef ULONG (WINAPI *D3DCB_DESTROYSWAPCHAINFN) (struct IWineD3DSwapChain *pSwapChain);
258
259 typedef ULONG (WINAPI *D3DCB_DESTROYSURFACEFN) (struct IWineD3DSurface *pSurface);
260
261 typedef ULONG (WINAPI *D3DCB_DESTROYVOLUMEFN) (struct IWineD3DVolume *pVolume);
262
263 /*****************************************************************************
264 * IWineD3DBase interface
265 */
266
267 #define INTERFACE IWineD3DBase
268 DECLARE_INTERFACE_(IWineD3DBase, IUnknown)
269 {
270 /*** IUnknown methods ***/
271 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
272 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
273 STDMETHOD_(ULONG,Release)(THIS) PURE;
274 /*** IWineD3DBase methods ***/
275 STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
276 };
277 #undef INTERFACE
278
279 #if !defined(__cplusplus) || defined(CINTERFACE)
280 /*** IUnknown methods ***/
281 #define IWineD3DBase_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
282 #define IWineD3DBase_AddRef(p) (p)->lpVtbl->AddRef(p)
283 #define IWineD3DBase_Release(p) (p)->lpVtbl->Release(p)
284 /*** IWineD3DBase methods ***/
285 #define IWineD3DBase_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
286 #endif
287
288 /*****************************************************************************
289 * IWineD3D interface
290 */
291
292 #define INTERFACE IWineD3D
293 DECLARE_INTERFACE_(IWineD3D, IWineD3DBase)
294 {
295 /*** IUnknown methods ***/
296 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
297 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
298 STDMETHOD_(ULONG,Release)(THIS) PURE;
299 /*** IWineD3DBase methods ***/
300 STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
301 /*** IWineD3D methods ***/
302 STDMETHOD_(UINT,GetAdapterCount)(THIS) PURE;
303 STDMETHOD(RegisterSoftwareDevice)(THIS_ void * pInitializeFunction) PURE;
304 STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
305 STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT Adapter, WINED3DFORMAT Format) PURE;
306 STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, UINT Mode, WINED3DFORMAT Format, WINED3DDISPLAYMODE * pMode) PURE;
307 STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, WINED3DDISPLAYMODE *pMode) PURE;
308 STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, WINED3DADAPTER_IDENTIFIER* pIdentifier) PURE;
309 STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT SurfaceFormat, BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQuality) PURE;
310 STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT AdapterFormat, WINED3DFORMAT RenderTargetFormat, WINED3DFORMAT DepthStencilFormat) PURE;
311 STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter, WINED3DDEVTYPE CheckType, WINED3DFORMAT DisplayFormat, WINED3DFORMAT BackBufferFormat, BOOL Windowed) PURE;
312 STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT AdapterFormat, DWORD Usage, WINED3DRESOURCETYPE RType, WINED3DFORMAT CheckFormat) PURE;
313 STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT SourceFormat, WINED3DFORMAT TargetFormat) PURE;
314 STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DCAPS *pCaps) PURE;
315 STDMETHOD(CreateDevice)(THIS_ UINT Adapter, WINED3DDEVTYPE DeviceType,HWND hFocusWindow, DWORD BehaviorFlags, struct IWineD3DDevice **ppReturnedDeviceInterface, IUnknown *parent) PURE;
316
317 };
318 #undef INTERFACE
319
320 #if !defined(__cplusplus) || defined(CINTERFACE)
321 /*** IUnknown methods ***/
322 #define IWineD3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
323 #define IWineD3D_AddRef(p) (p)->lpVtbl->AddRef(p)
324 #define IWineD3D_Release(p) (p)->lpVtbl->Release(p)
325 /*** IWineD3DBase methods ***/
326 #define IWineD3D_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
327 /*** IWineD3D methods ***/
328 #define IWineD3D_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p)
329 #define IWineD3D_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a)
330 #define IWineD3D_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a)
331 #define IWineD3D_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b)
332 #define IWineD3D_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
333 #define IWineD3D_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
334 #define IWineD3D_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
335 #define IWineD3D_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
336 #define IWineD3D_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
337 #define IWineD3D_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
338 #define IWineD3D_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
339 #define IWineD3D_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
340 #define IWineD3D_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c)
341 #define IWineD3D_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
342 #endif
343
344 /* Define the main WineD3D entrypoint */
345 IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent);
346
347 /*****************************************************************************
348 * IWineD3DDevice interface
349 */
350 #define INTERFACE IWineD3DDevice
351 DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
352 {
353 /*** IUnknown methods ***/
354 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
355 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
356 STDMETHOD_(ULONG,Release)(THIS) PURE;
357 /*** IWineD3DBase methods ***/
358 STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
359 /*** IWineD3DDevice methods ***/
360 STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,WINED3DPOOL Pool,struct IWineD3DVertexBuffer **ppVertexBuffer, HANDLE *sharedHandle, IUnknown *parent) PURE;
361 STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DIndexBuffer** ppIndexBuffer, HANDLE* pSharedHandle, IUnknown *parent) PURE;
362 STDMETHOD(CreateStateBlock)(THIS_ WINED3DSTATEBLOCKTYPE Type, struct IWineD3DStateBlock **ppStateBlock, IUnknown *parent) PURE;
363 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;
364 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;
365 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;
366 STDMETHOD(CreateVolume)(THIS_ UINT Width, UINT Height, UINT Depth, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DVolume** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent) PURE;
367 STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DCubeTexture** ppCubeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE;
368 STDMETHOD(CreateQuery)(THIS_ WINED3DQUERYTYPE Type, struct IWineD3DQuery **ppQuery, IUnknown *pParent);
369 STDMETHOD(CreateAdditionalSwapChain)(THIS_ WINED3DPRESENT_PARAMETERS *pPresentationParameters, struct IWineD3DSwapChain **pSwapChain, IUnknown *pParent, D3DCB_CREATERENDERTARGETFN pFn, D3DCB_CREATEDEPTHSTENCILSURFACEFN pFn2);
370 STDMETHOD(CreateVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent, const WINED3DVERTEXELEMENT *elements, UINT element_count) PURE;
371 STDMETHOD(CreateVertexDeclarationFromFVF)(THIS_ struct IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent, DWORD Fvf) PURE;
372 STDMETHOD(CreateVertexShader)(THIS_ struct IWineD3DVertexDeclaration *vertex_declaration, CONST DWORD* pFunction, struct IWineD3DVertexShader** ppShader, IUnknown *pParent) PURE;
373 STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, struct IWineD3DPixelShader** ppShader, IUnknown *pParent) PURE;
374 STDMETHOD_(HRESULT,CreatePalette)(THIS_ DWORD Flags, PALETTEENTRY *PalEnt, struct IWineD3DPalette **Palette, IUnknown *Parent);
375 STDMETHOD(Init3D)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain);
376 STDMETHOD(Uninit3D)(THIS, D3DCB_DESTROYSURFACEFN pFn, D3DCB_DESTROYSWAPCHAINFN pFn2);
377 STDMETHOD_(void, SetFullscreen)(THIS_ BOOL fullscreen);
378 STDMETHOD_(void, SetMultithreaded)(THIS);
379 STDMETHOD(EvictManagedResources)(THIS) PURE;
380 STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
381 STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT BackBuffer, WINED3DBACKBUFFER_TYPE, struct IWineD3DSurface** ppBackBuffer) PURE;
382 STDMETHOD(GetCreationParameters)(THIS_ WINED3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
383 STDMETHOD(GetDeviceCaps)(THIS_ WINED3DCAPS* pCaps) PURE;
384 STDMETHOD(GetDirect3D)(THIS_ IWineD3D** ppD3D) PURE;
385 STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, WINED3DDISPLAYMODE* pMode) PURE;
386 STDMETHOD(SetDisplayMode)(THIS_ UINT iSwapChain, WINED3DDISPLAYMODE* pMode) PURE;
387 STDMETHOD(GetHWND)(THIS_ HWND *hwnd) PURE;
388 STDMETHOD(SetHWND)(THIS_ HWND hwnd) PURE;
389 STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
390 STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, WINED3DRASTER_STATUS* pRasterStatus) PURE;
391 STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, struct IWineD3DSwapChain **pSwapChain) PURE;
392 STDMETHOD(Reset)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
393 STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
394 STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, struct IWineD3DSurface* pCursorBitmap) PURE;
395 STDMETHOD_(void, SetCursorPosition)(THIS_ int XScreenSpace, int YScreenSpace, DWORD Flags) PURE;
396 STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
397 STDMETHOD(TestCooperativeLevel)(THIS) PURE;
398 STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float * pPlane) PURE;
399 STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float * pPlane) PURE;
400 STDMETHOD(SetClipStatus)(THIS_ CONST WINED3DCLIPSTATUS * pClipStatus) PURE;
401 STDMETHOD(GetClipStatus)(THIS_ WINED3DCLIPSTATUS * pClipStatus) PURE;
402 STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
403 STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
404 STDMETHOD(SetDepthStencilSurface)(THIS_ struct IWineD3DSurface* pNewZStencil) PURE;
405 STDMETHOD(GetDepthStencilSurface)(THIS_ struct IWineD3DSurface** ppZStencilSurface) PURE;
406 STDMETHOD(SetFVF)(THIS_ DWORD fvf) PURE;
407 STDMETHOD(GetFVF)(THIS_ DWORD * pfvf) PURE;
408 STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST WINED3DGAMMARAMP* pRamp) PURE;
409 STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, WINED3DGAMMARAMP* pRamp) PURE;
410 STDMETHOD(SetIndices)(THIS_ struct IWineD3DIndexBuffer * pIndexData) PURE;
411 STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData) PURE;
412 STDMETHOD(SetBaseVertexIndex)(THIS_ INT baseIndex);
413 STDMETHOD(GetBaseVertexIndex)(THIS_ INT *baseIndex);
414 STDMETHOD(SetLight)(THIS_ DWORD Index,CONST WINED3DLIGHT * pLight) PURE;
415 STDMETHOD(GetLight)(THIS_ DWORD Index,WINED3DLIGHT * pLight) PURE;
416 STDMETHOD(SetLightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;
417 STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL * pEnable) PURE;
418 STDMETHOD(SetMaterial)(THIS_ CONST WINED3DMATERIAL * pMaterial) PURE;
419 STDMETHOD(GetMaterial)(THIS_ WINED3DMATERIAL *pMaterial) PURE;
420 STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
421 STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
422 STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE;
423 STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
424 STDMETHOD(SetPixelShader)(THIS_ struct IWineD3DPixelShader *pShader) PURE;
425 STDMETHOD(GetPixelShader)(THIS_ struct IWineD3DPixelShader **ppShader) PURE;
426 STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE;
427 STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
428 STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
429 STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
430 STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
431 STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
432 STDMETHOD(SetRenderState)(THIS_ WINED3DRENDERSTATETYPE State, DWORD Value) PURE;
433 STDMETHOD(GetRenderState)(THIS_ WINED3DRENDERSTATETYPE State, DWORD * pValue) PURE;
434 STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface* pRenderTarget) PURE;
435 STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface** ppRenderTarget) PURE;
436 STDMETHOD(SetFrontBackBuffers)(THIS_ struct IWineD3DSurface *Front, struct IWineD3DSurface *Back) PURE;
437 STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
438 STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD* Value) PURE;
439 STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
440 STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
441 STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
442 STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
443 STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,struct IWineD3DVertexBuffer * pStreamData,UINT Offset,UINT Stride) PURE;
444 STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,struct IWineD3DVertexBuffer ** ppStreamData,UINT *pOffset, UINT * pStride) PURE;
445 STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE;
446 STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE;
447 STDMETHOD(SetTexture)(THIS_ DWORD Stage, struct IWineD3DBaseTexture* pTexture) PURE;
448 STDMETHOD(GetTexture)(THIS_ DWORD Stage, struct IWineD3DBaseTexture** ppTexture) PURE;
449 STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, WINED3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
450 STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, WINED3DTEXTURESTAGESTATETYPE Type,DWORD *pValue) PURE;
451 STDMETHOD(SetTransform)(THIS_ WINED3DTRANSFORMSTATETYPE State, CONST WINED3DMATRIX * pMatrix) PURE;
452 STDMETHOD(GetTransform)(THIS_ WINED3DTRANSFORMSTATETYPE State, WINED3DMATRIX * pMatrix) PURE;
453 STDMETHOD(SetVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration* pDecl) PURE;
454 STDMETHOD(GetVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration** ppDecl) PURE;
455 STDMETHOD(SetVertexShader)(THIS_ struct IWineD3DVertexShader* pShader) PURE;
456 STDMETHOD(GetVertexShader)(THIS_ struct IWineD3DVertexShader** ppShader) PURE;
457 STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE;
458 STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
459 STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
460 STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
461 STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
462 STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
463 STDMETHOD(SetViewport)(THIS_ CONST WINED3DVIEWPORT * pViewport) PURE;
464 STDMETHOD(GetViewport)(THIS_ WINED3DVIEWPORT * pViewport) PURE;
465 STDMETHOD(MultiplyTransform)(THIS_ WINED3DTRANSFORMSTATETYPE State, CONST WINED3DMATRIX * pMatrix) PURE;
466 STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
467 STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, struct IWineD3DVertexBuffer* pDestBuffer, struct IWineD3DVertexDeclaration* pVertexDecl, DWORD Flags) PURE;
468 STDMETHOD(BeginStateBlock)(THIS) PURE;
469 STDMETHOD(EndStateBlock)(THIS_ struct IWineD3DStateBlock** ppStateBlock) PURE;
470 STDMETHOD(BeginScene)(THIS) PURE;
471 STDMETHOD(EndScene)(THIS) PURE;
472 STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
473 STDMETHOD(Clear)(THIS_ DWORD Count, CONST WINED3DRECT * pRects, DWORD Flags, WINED3DCOLOR Color, float Z, DWORD Stencil) PURE;
474 STDMETHOD(DrawPrimitive)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE;
475 STDMETHOD(DrawIndexedPrimitive)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE;
476 STDMETHOD(DrawPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
477 STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void * pIndexData, WINED3DFORMAT IndexDataFormat, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
478 STDMETHOD(DrawPrimitiveStrided)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) PURE;
479 STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData, UINT NumVertices, CONST void *pIndexData, WINED3DFORMAT IndexDataFormat) PURE;
480 STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DRECTPATCH_INFO* pRectPatchInfo) PURE;
481 STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DTRIPATCH_INFO* pTriPatchInfo) PURE;
482 STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
483 STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST WINED3DRECT* pRect, WINED3DCOLOR color) PURE;
484 STDMETHOD(UpdateTexture)(THIS_ struct IWineD3DBaseTexture *pSourceTexture, struct IWineD3DBaseTexture *pDestinationTexture) PURE;
485 STDMETHOD(UpdateSurface)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPoint) PURE;
486 STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,struct IWineD3DSurface* pSurface) PURE;
487 /*** object tracking ***/
488 STDMETHOD_(void, ResourceReleased)(THIS_ struct IWineD3DResource *resource);
489 STDMETHOD(EnumResources)(THIS_ D3DCB_ENUMRESOURCES pCallback, void *pData);
490 };
491 #undef INTERFACE
492
493 #if !defined(__cplusplus) || defined(CINTERFACE)
494 /*** IUnknown methods ***/
495 #define IWineD3DDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
496 #define IWineD3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
497 #define IWineD3DDevice_Release(p) (p)->lpVtbl->Release(p)
498 /*** IWineD3DBase methods ***/
499 #define IWineD3DDevice_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
500 /*** IWineD3DDevice methods ***/
501 #define IWineD3DDevice_CreateVertexBuffer(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f,g)
502 #define IWineD3DDevice_CreateIndexBuffer(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f,g)
503 #define IWineD3DDevice_CreateStateBlock(p,a,b,c) (p)->lpVtbl->CreateStateBlock(p,a,b,c)
504 #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)
505 #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)
506 #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)
507 #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)
508 #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)
509 #define IWineD3DDevice_CreateQuery(p,a,b,c) (p)->lpVtbl->CreateQuery(p,a,b,c)
510 #define IWineD3DDevice_CreateAdditionalSwapChain(p,a,b,c,d,e) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b,c,d,e)
511 #define IWineD3DDevice_CreateVertexDeclaration(p,a,b,c,d) (p)->lpVtbl->CreateVertexDeclaration(p,a,b,c,d)
512 #define IWineD3DDevice_CreateVertexDeclarationFromFVF(p,a,b,c) (p)->lpVtbl->CreateVertexDeclarationFromFVF(p,a,b,c)
513 #define IWineD3DDevice_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d)
514 #define IWineD3DDevice_CreatePixelShader(p,a,b,c) (p)->lpVtbl->CreatePixelShader(p,a,b,c)
515 #define IWineD3DDevice_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d)
516 #define IWineD3DDevice_Init3D(p, a, b) (p)->lpVtbl->Init3D(p, a, b)
517 #define IWineD3DDevice_Uninit3D(p, a, b) (p)->lpVtbl->Uninit3D(p, a, b)
518 #define IWineD3DDevice_SetFullscreen(p, a) (p)->lpVtbl->SetFullscreen(p, a)
519 #define IWineD3DDevice_SetMultithreaded(p) (p)->lpVtbl->SetMultithreaded(p)
520 #define IWineD3DDevice_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p)
521 #define