]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/builddeps/dp.win64/include/d3dx9core.h
Merge remote branch 'refs/remotes/origin/terencehill/misc_bugfixes'
[xonotic/xonotic.git] / misc / builddeps / dp.win64 / include / d3dx9core.h
1 /*
2  * Copyright (C) 2007, 2008 Tony Wasserka
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include <_mingw_dxhelper.h>
20 #include <d3dx9.h>
21
22 #ifndef __WINE_D3DX9CORE_H
23 #define __WINE_D3DX9CORE_H
24
25 /**********************************************
26  ***************** Definitions ****************
27  **********************************************/
28 /* D3DX_VERSION will be completely ignored since we are
29     implementing all dlls from d3dx9_24 to d3dx9_36 */
30 #define D3DX_VERSION 0x0902
31 #define D3DX_SDK_VERSION 36
32 #define D3DXSPRITE_DONOTSAVESTATE           1
33 #define D3DXSPRITE_DONOTMODIFY_RENDERSTATE  2
34 #define D3DXSPRITE_OBJECTSPACE              4
35 #define D3DXSPRITE_BILLBOARD                8
36 #define D3DXSPRITE_ALPHABLEND              16
37 #define D3DXSPRITE_SORT_TEXTURE            32
38 #define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK  64
39 #define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT 128
40 #define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE  256
41
42 /**********************************************
43  ******************** GUIDs *******************
44  **********************************************/
45 DEFINE_GUID(IID_ID3DXBuffer, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
46 DEFINE_GUID(IID_ID3DXFont, 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
47 DEFINE_GUID(IID_ID3DXLine, 0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8);
48 DEFINE_GUID(IID_ID3DXRenderToEnvMap, 0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e);
49 DEFINE_GUID(IID_ID3DXRenderToSurface, 0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94);
50 DEFINE_GUID(IID_ID3DXSprite, 0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
51
52 /**********************************************
53  ****************** typedefs ******************
54  **********************************************/
55 typedef struct ID3DXBuffer *LPD3DXBUFFER;
56 typedef struct ID3DXFont *LPD3DXFONT;
57 typedef struct ID3DXLine *LPD3DXLINE;
58 typedef struct ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
59 typedef struct ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
60 typedef struct ID3DXSprite *LPD3DXSPRITE;
61
62 /**********************************************
63  *********** interface declarations ***********
64  **********************************************/
65 #define INTERFACE ID3DXBuffer
66 DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
67 {
68     /*** IUnknown methods ***/
69     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE;
70     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
71     STDMETHOD_(ULONG, Release)(THIS) PURE;
72     /*** ID3DXBuffer methods ***/
73     STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
74     STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
75 };
76 #undef INTERFACE
77
78 #if !defined(__cplusplus) || defined(CINTERFACE)
79 /*** IUnknown methods ***/
80 #define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
81 #define ID3DXBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
82 #define ID3DXBuffer_Release(p)            (p)->lpVtbl->Release(p)
83 /*** ID3DXBuffer methods ***/
84 #define ID3DXBuffer_GetBufferPointer(p)   (p)->lpVtbl->GetBufferPointer(p)
85 #define ID3DXBuffer_GetBufferSize(p)      (p)->lpVtbl->GetBufferSize(p)
86 #else
87 /*** IUnknown methods ***/
88 #define ID3DXBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
89 #define ID3DXBuffer_AddRef(p)             (p)->AddRef()
90 #define ID3DXBuffer_Release(p)            (p)->Release()
91 /*** ID3DXBuffer methods ***/
92 #define ID3DXBuffer_GetBufferPointer(p)   (p)->GetBufferPointer()
93 #define ID3DXBuffer_GetBufferSize(p)      (p)->GetBufferSize()
94 #endif
95
96 typedef struct _D3DXFONT_DESCA
97 {
98     INT Height;
99     UINT Width;
100     UINT Weight;
101     UINT MipLevels;
102     BOOL Italic;
103     BYTE CharSet;
104     BYTE OutputPrecision;
105     BYTE Quality;
106     BYTE PitchAndFamily;
107     CHAR FaceName[LF_FACESIZE];
108 } D3DXFONT_DESCA, *LPD3DXFONT_DESCA;
109
110 typedef struct _D3DXFONT_DESCW
111 {
112     INT Height;
113     UINT Width;
114     UINT Weight;
115     UINT MipLevels;
116     BOOL Italic;
117     BYTE CharSet;
118     BYTE OutputPrecision;
119     BYTE Quality;
120     BYTE PitchAndFamily;
121     WCHAR FaceName[LF_FACESIZE];
122 } D3DXFONT_DESCW, *LPD3DXFONT_DESCW;
123
124 DECL_WINELIB_TYPE_AW(D3DXFONT_DESC)
125 DECL_WINELIB_TYPE_AW(LPD3DXFONT_DESC)
126
127 #define INTERFACE ID3DXFont
128 DECLARE_INTERFACE_(ID3DXFont, IUnknown)
129 {
130     /*** IUnknown methods ***/
131     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
132     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
133     STDMETHOD_(ULONG, Release)(THIS) PURE;
134     /*** ID3DXFont methods ***/
135     STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
136     STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *desc) PURE;
137     STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *desc) PURE;
138     STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *metrics) PURE;
139     STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *metrics) PURE;
140
141     STDMETHOD_(HDC, GetDC)(THIS) PURE;
142     STDMETHOD(GetGlyphData)(THIS_ UINT glyph, LPDIRECT3DTEXTURE9 *texture, RECT *blackbox, POINT *cellinc) PURE;
143
144     STDMETHOD(PreloadCharacters)(THIS_ UINT first, UINT last) PURE;
145     STDMETHOD(PreloadGlyphs)(THIS_ UINT first, UINT last) PURE;
146     STDMETHOD(PreloadTextA)(THIS_ LPCSTR string, INT count) PURE;
147     STDMETHOD(PreloadTextW)(THIS_ LPCWSTR string, INT count) PURE;
148
149     STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE sprite, LPCSTR string, INT count, LPRECT rect, DWORD format, D3DCOLOR color) PURE;
150     STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE sprite, LPCWSTR string, INT count, LPRECT rect, DWORD format, D3DCOLOR color) PURE;
151
152     STDMETHOD(OnLostDevice)(THIS) PURE;
153     STDMETHOD(OnResetDevice)(THIS) PURE;
154 };
155 #undef INTERFACE
156
157 #if !defined(__cplusplus) || defined(CINTERFACE)
158
159 /*** IUnknown methods ***/
160 #define ID3DXFont_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
161 #define ID3DXFont_AddRef(p)                (p)->lpVtbl->AddRef(p)
162 #define ID3DXFont_Release(p)               (p)->lpVtbl->Release(p)
163 /*** ID3DXFont methods ***/
164 #define ID3DXFont_GetDevice(p,a)           (p)->lpVtbl->GetDevice(p,a)
165 #define ID3DXFont_GetDescA(p,a)            (p)->lpVtbl->GetDescA(p,a)
166 #define ID3DXFont_GetDescW(p,a)            (p)->lpVtbl->GetDescW(p,a)
167 #define ID3DXFont_GetTextMetricsA(p,a)     (p)->lpVtbl->GetTextMetricsA(p,a)
168 #define ID3DXFont_GetTextMetricsW(p,a)     (p)->lpVtbl->GetTextMetricsW(p,a)
169 #define ID3DXFont_GetDC(p)                 (p)->lpVtbl->GetDC(p)
170 #define ID3DXFont_GetGlyphData(p,a,b,c,d)  (p)->lpVtbl->GetGlyphData(p,a,b,c,d)
171 #define ID3DXFont_PreloadCharacters(p,a,b) (p)->lpVtbl->PreloadCharacters(p,a,b)
172 #define ID3DXFont_PreloadGlyphs(p,a,b)     (p)->lpVtbl->PreloadGlyphs(p,a,b)
173 #define ID3DXFont_PreloadTextA(p,a,b)      (p)->lpVtbl->PreloadTextA(p,a,b)
174 #define ID3DXFont_PreloadTextW(p,a,b)      (p)->lpVtbl->PreloadTextW(p,a,b)
175 #define ID3DXFont_DrawTextA(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextA(p,a,b,c,d,e,f)
176 #define ID3DXFont_DrawTextW(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextW(p,a,b,c,d,e,f)
177 #define ID3DXFont_OnLostDevice(p)          (p)->lpVtbl->OnLostDevice(p)
178 #define ID3DXFont_OnResetDevice(p)         (p)->lpVtbl->OnResetDevice(p)
179 #else
180 /*** IUnknown methods ***/
181 #define ID3DXFont_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
182 #define ID3DXFont_AddRef(p)                (p)->AddRef()
183 #define ID3DXFont_Release(p)               (p)->Release()
184 /*** ID3DXFont methods ***/
185 #define ID3DXFont_GetDevice(p,a)           (p)->GetDevice(a)
186 #define ID3DXFont_GetDescA(p,a)            (p)->GetDescA(a)
187 #define ID3DXFont_GetDescW(p,a)            (p)->GetDescW(a)
188 #define ID3DXFont_GetTextMetricsA(p,a)     (p)->GetTextMetricsA(a)
189 #define ID3DXFont_GetTextMetricsW(p,a)     (p)->GetTextMetricsW(a)
190 #define ID3DXFont_GetDC(p)                 (p)->GetDC()
191 #define ID3DXFont_GetGlyphData(p,a,b,c,d)  (p)->GetGlyphData(a,b,c,d)
192 #define ID3DXFont_PreloadCharacters(p,a,b) (p)->PreloadCharacters(a,b)
193 #define ID3DXFont_PreloadGlyphs(p,a,b)     (p)->PreloadGlyphs(a,b)
194 #define ID3DXFont_PreloadTextA(p,a,b)      (p)->PreloadTextA(a,b)
195 #define ID3DXFont_PreloadTextW(p,a,b)      (p)->PreloadTextW(a,b)
196 #define ID3DXFont_DrawTextA(p,a,b,c,d,e,f) (p)->DrawTextA(a,b,c,d,e,f)
197 #define ID3DXFont_DrawTextW(p,a,b,c,d,e,f) (p)->DrawTextW(a,b,c,d,e,f)
198 #define ID3DXFont_OnLostDevice(p)          (p)->OnLostDevice()
199 #define ID3DXFont_OnResetDevice(p)         (p)->OnResetDevice()
200 #endif
201 #define ID3DXFont_DrawText       WINELIB_NAME_AW(ID3DXFont_DrawText)
202 #define ID3DXFont_GetDesc        WINELIB_NAME_AW(ID3DXFont_GetDesc)
203 #define ID3DXFont_GetTextMetrics WINELIB_NAME_AW(ID3DXFont_GetTextMetrics)
204 #define ID3DXFont_PreloadText    WINELIB_NAME_AW(ID3DXFont_PreloadText)
205
206 #define INTERFACE ID3DXLine
207 DECLARE_INTERFACE_(ID3DXLine, IUnknown)
208 {
209     /*** IUnknown methods ***/
210     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
211     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
212     STDMETHOD_(ULONG, Release)(THIS) PURE;
213
214     /*** ID3DXLine methods ***/
215     STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
216
217     STDMETHOD(Begin)(THIS) PURE;
218     STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *vertexlist, DWORD vertexlistcount, D3DCOLOR color) PURE;
219     STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *vertexlist, DWORD vertexlistcount,
220                              CONST D3DXMATRIX *transform, D3DCOLOR color) PURE;
221     STDMETHOD(SetPattern)(THIS_ DWORD pattern) PURE;
222     STDMETHOD_(DWORD, GetPattern)(THIS) PURE;
223     STDMETHOD(SetPatternScale)(THIS_ FLOAT scale) PURE;
224     STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;
225     STDMETHOD(SetWidth)(THIS_ FLOAT width) PURE;
226     STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;
227     STDMETHOD(SetAntialias)(THIS_ BOOL antialias) PURE;
228     STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;
229     STDMETHOD(SetGLLines)(THIS_ BOOL gl_lines) PURE;
230     STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;
231     STDMETHOD(End)(THIS) PURE;
232
233     STDMETHOD(OnLostDevice)(THIS) PURE;
234     STDMETHOD(OnResetDevice)(THIS) PURE;
235 };
236 #undef INTERFACE
237
238 #if !defined(__cplusplus) || defined(CINTERFACE)
239 /*** IUnknown methods ***/
240 #define ID3DXLine_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
241 #define ID3DXLine_AddRef(p)                (p)->lpVtbl->AddRef(p)
242 #define ID3DXLine_Release(p)               (p)->lpVtbl->Release(p)
243 /*** ID3DXLine methods ***/
244 #define ID3DXLine_GetDevice(p,a)           (p)->lpVtbl->GetDevice(p,a)
245 #define ID3DXLine_Begin(p)                 (p)->lpVtbl->Begin(p)
246 #define ID3DXLine_Draw(p,a,b,c)            (p)->lpVtbl->Draw(p,a,b,c)
247 #define ID3DXLine_DrawTransform(p,a,b,c,d) (p)->lpVtbl->DrawTransform(p,a,b,c,d)
248 #define ID3DXLine_SetPattern(p,a)          (p)->lpVtbl->SetPattern(p,a)
249 #define ID3DXLine_GetPattern(p)            (p)->lpVtbl->GetPattern(p)
250 #define ID3DXLine_SetPatternScale(p,a)     (p)->lpVtbl->SetPatternScale(p,a)
251 #define ID3DXLine_GetPatternScale(p)       (p)->lpVtbl->GetPatternScale(p)
252 #define ID3DXLine_SetWidth(p,a)            (p)->lpVtbl->SetWidth(p,a)
253 #define ID3DXLine_GetWidth(p)              (p)->lpVtbl->GetWidth(p)
254 #define ID3DXLine_SetAntialias(p,a)        (p)->lpVtbl->SetAntialias(p,a)
255 #define ID3DXLine_GetAntialias(p)          (p)->lpVtbl->GetAntialias(p)
256 #define ID3DXLine_SetGLLines(p,a)          (p)->lpVtbl->SetGLLines(p,a)
257 #define ID3DXLine_GetGLLines(p)            (p)->lpVtbl->GetGLLines(p)
258 #define ID3DXLine_End(p)                   (p)->lpVtbl->End(p)
259 #define ID3DXLine_OnLostDevice(p)          (p)->lpVtbl->OnLostDevice(p)
260 #define ID3DXLine_OnResetDevice(p)         (p)->lpVtbl->OnResetDevice(p)
261 #else
262 /*** IUnknown methods ***/
263 #define ID3DXLine_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
264 #define ID3DXLine_AddRef(p)                (p)->AddRef()
265 #define ID3DXLine_Release(p)               (p)->Release()
266 /*** ID3DXLine methods ***/
267 #define ID3DXLine_GetDevice(p,a)           (p)->GetDevice(a)
268 #define ID3DXLine_Begin(p)                 (p)->Begin()
269 #define ID3DXLine_Draw(p,a,b,c)            (p)->Draw(a,b,c)
270 #define ID3DXLine_DrawTransform(p,a,b,c,d) (p)->DrawTransform(a,b,c,d)
271 #define ID3DXLine_SetPattern(p,a)          (p)->SetPattern(a)
272 #define ID3DXLine_GetPattern(p)            (p)->GetPattern()
273 #define ID3DXLine_SetPatternScale(p,a)     (p)->SetPatternScale(a)
274 #define ID3DXLine_GetPatternScale(p)       (p)->GetPatternScale()
275 #define ID3DXLine_SetWidth(p,a)            (p)->SetWidth(a)
276 #define ID3DXLine_GetWidth(p)              (p)->GetWidth()
277 #define ID3DXLine_SetAntialias(p,a)        (p)->SetAntialias(a)
278 #define ID3DXLine_GetAntialias(p)          (p)->GetAntialias()
279 #define ID3DXLine_SetGLLines(p,a)          (p)->SetGLLines(a)
280 #define ID3DXLine_GetGLLines(p)            (p)->GetGLLines()
281 #define ID3DXLine_End(p)                   (p)->End()
282 #define ID3DXLine_OnLostDevice(p)          (p)->OnLostDevice()
283 #define ID3DXLine_OnResetDevice(p)         (p)->OnResetDevice()
284 #endif
285
286 typedef struct _D3DXRTE_DESC
287 {
288     UINT Size;
289     UINT MipLevels;
290     D3DFORMAT Format;
291     BOOL DepthStencil;
292     D3DFORMAT DepthStencilFormat;
293 } D3DXRTE_DESC;
294
295 #define INTERFACE ID3DXRenderToEnvMap
296 DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
297 {
298     /*** IUnknown methods ***/
299     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
300     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
301     STDMETHOD_(ULONG, Release)(THIS) PURE;
302
303     /*** ID3DXRenderToEnvMap methods ***/
304     STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
305     STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC *desc) PURE;
306
307     STDMETHOD(BeginCube)(THIS_ LPDIRECT3DCUBETEXTURE9 cubetex) PURE;
308     STDMETHOD(BeginSphere)(THIS_ LPDIRECT3DTEXTURE9 tex) PURE;
309     STDMETHOD(BeginHemisphere)(THIS_ LPDIRECT3DTEXTURE9 texzpos, LPDIRECT3DTEXTURE9 texzneg) PURE;
310     STDMETHOD(BeginParabolic)(THIS_ LPDIRECT3DTEXTURE9 texzpos, LPDIRECT3DTEXTURE9 texzneg) PURE;
311
312     STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES face, DWORD mipfilter) PURE;
313     STDMETHOD(End)(THIS_ DWORD mipfilter) PURE;
314
315     STDMETHOD(OnLostDevice)(THIS) PURE;
316     STDMETHOD(OnResetDevice)(THIS) PURE;
317 };
318 #undef INTERFACE
319
320 #if !defined(__cplusplus) || defined(CINTERFACE)
321 /*** IUnknown methods ***/
322 #define ID3DXRenderToEnvMap_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
323 #define ID3DXRenderToEnvMap_AddRef(p)              (p)->lpVtbl->AddRef(p)
324 #define ID3DXRenderToEnvMap_Release(p)             (p)->lpVtbl->Release(p)
325 /*** ID3DXRenderToEnvMap methods ***/
326 #define ID3DXRenderToEnvMap_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
327 #define ID3DXRenderToEnvMap_GetDesc(p,a)           (p)->lpVtbl->GetDesc(p,a)
328 #define ID3DXRenderToEnvMap_BeginCube(p,a)         (p)->lpVtbl->BeginCube(p,a)
329 #define ID3DXRenderToEnvMap_BeginSphere(p,a)       (p)->lpVtbl->BeginSphere(p,a)
330 #define ID3DXRenderToEnvMap_BeginHemisphere(p,a,b) (p)->lpVtbl->BeginHemisphere(p,a,b)
331 #define ID3DXRenderToEnvMap_BeginParabolic(p,a,b)  (p)->lpVtbl->BeginParabolic(p,a,b)
332 #define ID3DXRenderToEnvMap_Face(p,a,b)            (p)->lpVtbl->Face(p,a,b)
333 #define ID3DXRenderToEnvMap_End(p,a)               (p)->lpVtbl->End(p,a)
334 #define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->lpVtbl->OnLostDevice(p)
335 #define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->lpVtbl->OnLostDevice(p)
336 #else
337 /*** IUnknown methods ***/
338 #define ID3DXRenderToEnvMap_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
339 #define ID3DXRenderToEnvMap_AddRef(p)              (p)->AddRef()
340 #define ID3DXRenderToEnvMap_Release(p)             (p)->Release()
341 /*** ID3DXRenderToEnvMap methods ***/
342 #define ID3DXRenderToEnvMap_GetDevice(p,a)         (p)->GetDevice(a)
343 #define ID3DXRenderToEnvMap_GetDesc(p,a)           (p)->GetDesc(a)
344 #define ID3DXRenderToEnvMap_BeginCube(p,a)         (p)->BeginCube(a)
345 #define ID3DXRenderToEnvMap_BeginSphere(p,a)       (p)->BeginSphere(a)
346 #define ID3DXRenderToEnvMap_BeginHemisphere(p,a,b) (p)->BeginHemisphere(a,b)
347 #define ID3DXRenderToEnvMap_BeginParabolic(p,a,b)  (p)->BeginParabolic(a,b)
348 #define ID3DXRenderToEnvMap_Face(p,a,b)            (p)->Face(a,b)
349 #define ID3DXRenderToEnvMap_End(p,a)               (p)->End(a)
350 #define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->OnLostDevice()
351 #define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->OnLostDevice()
352 #endif
353
354 typedef struct _D3DXRTS_DESC
355 {
356     UINT Width;
357     UINT Height;
358     D3DFORMAT Format;
359     BOOL DepthStencil;
360     D3DFORMAT DepthStencilFormat;
361 } D3DXRTS_DESC;
362
363 #define INTERFACE ID3DXRenderToSurface
364 DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
365 {
366     /*** IUnknown methods ***/
367     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE;
368     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
369     STDMETHOD_(ULONG, Release)(THIS) PURE;
370     /*** ID3DXRenderToSurface methods ***/
371     STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
372     STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC *desc) PURE;
373
374     STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 surface, CONST D3DVIEWPORT9 *viewport) PURE;
375     STDMETHOD(EndScene)(THIS_ DWORD mipfilter) PURE;
376
377     STDMETHOD(OnLostDevice)(THIS) PURE;
378     STDMETHOD(OnResetDevice)(THIS) PURE;
379 };
380 #undef INTERFACE
381
382 #if !defined(__cplusplus) || defined(CINTERFACE)
383 /*** IUnknown methods ***/
384 #define ID3DXRenderToSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
385 #define ID3DXRenderToSurface_AddRef(p)             (p)->lpVtbl->AddRef(p)
386 #define ID3DXRenderToSurface_Release(p)            (p)->lpVtbl->Release(p)
387 /*** ID3DXRenderToSurface methods ***/
388 #define ID3DXRenderToSurface_GetDevice(p,a)        (p)->lpVtbl->GetDevice(p,a)
389 #define ID3DXRenderToSurface_GetDesc(p,a)          (p)->lpVtbl->GetDesc(p,a)
390 #define ID3DXRenderToSurface_BeginScene(p,a,b)     (p)->lpVtbl->BeginScene(p,a,b)
391 #define ID3DXRenderToSurface_EndScene(p,a)         (p)->lpVtbl->EndScene(p,a)
392 #define ID3DXRenderToSurface_OnLostDevice(p)       (p)->lpVtbl->OnLostDevice(p)
393 #define ID3DXRenderToSurface_OnResetDevice(p)      (p)->lpVtbl->OnResetDevice(p)
394 #else
395 /*** IUnknown methods ***/
396 #define ID3DXRenderToSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
397 #define ID3DXRenderToSurface_AddRef(p)             (p)->AddRef()
398 #define ID3DXRenderToSurface_Release(p)            (p)->Release()
399 /*** ID3DXRenderToSurface methods ***/
400 #define ID3DXRenderToSurface_GetDevice(p,a)        (p)->GetDevice(a)
401 #define ID3DXRenderToSurface_GetDesc(p,a)          (p)->GetDesc(a)
402 #define ID3DXRenderToSurface_BeginScene(p,a,b)     (p)->BeginScene(a,b)
403 #define ID3DXRenderToSurface_EndScene(p,a)         (p)->EndScene(a)
404 #define ID3DXRenderToSurface_OnLostDevice(p)       (p)->OnLostDevice()
405 #define ID3DXRenderToSurface_OnResetDevice(p)      (p)->OnResetDevice()
406 #endif
407
408 #define INTERFACE ID3DXSprite
409 DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
410 {
411     /*** IUnknown methods ***/
412     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
413     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
414     STDMETHOD_(ULONG, Release)(THIS) PURE;
415     /*** ID3DXSprite methods ***/
416     STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
417
418     STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *transform) PURE;
419     STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *transform) PURE;
420     STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE;
421     STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE;
422
423     STDMETHOD(Begin)(THIS_ DWORD flags) PURE;
424     STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 texture, CONST RECT *rect, CONST D3DXVECTOR3 *center, CONST D3DXVECTOR3 *position, D3DCOLOR color) PURE;
425     STDMETHOD(Flush)(THIS) PURE;
426     STDMETHOD(End)(THIS) PURE;
427
428     STDMETHOD(OnLostDevice)(THIS) PURE;
429     STDMETHOD(OnResetDevice)(THIS) PURE;
430 };
431 #undef INTERFACE
432
433 #if !defined(__cplusplus) || defined(CINTERFACE)
434 /*** IUnknown methods ***/
435 #define ID3DXSprite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
436 #define ID3DXSprite_AddRef(p)             (p)->lpVtbl->AddRef(p)
437 #define ID3DXSprite_Release(p)            (p)->lpVtbl->Release(p)
438 /*** ID3DXSprite methods ***/
439 #define ID3DXSprite_GetDevice(p,a)        (p)->lpVtbl->GetDevice(p,a)
440 #define ID3DXSprite_GetTransform(p,a)     (p)->lpVtbl->GetTransform(p,a)
441 #define ID3DXSprite_SetTransform(p,a)     (p)->lpVtbl->SetTransform(p,a)
442 #define ID3DXSprite_SetWorldViewRH(p,a,b) (p)->lpVtbl->SetWorldViewRH(p,a,b)
443 #define ID3DXSprite_SetWorldViewLH(p,a,b) (p)->lpVtbl->SetWorldViewLH(p,a,b)
444 #define ID3DXSprite_Begin(p,a)            (p)->lpVtbl->Begin(p,a)
445 #define ID3DXSprite_Draw(p,a,b,c,d,e)     (p)->lpVtbl->Draw(p,a,b,c,d,e)
446 #define ID3DXSprite_Flush(p)              (p)->lpVtbl->Flush(p)
447 #define ID3DXSprite_End(p)                (p)->lpVtbl->End(p)
448 #define ID3DXSprite_OnLostDevice(p)       (p)->lpVtbl->OnLostDevice(p)
449 #define ID3DXSprite_OnResetDevice(p)      (p)->lpVtbl->OnResetDevice(p)
450 #else
451 /*** IUnknown methods ***/
452 #define ID3DXSprite_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
453 #define ID3DXSprite_AddRef(p)                (p)->AddRef()
454 #define ID3DXSprite_Release(p)               (p)->Release()
455 /*** ID3DXSprite methods ***/
456 #define ID3DXSprite_GetDevice(p,a)        (p)->GetDevice(a)
457 #define ID3DXSprite_GetTransform(p,a)     (p)->GetTransform(a)
458 #define ID3DXSprite_SetTransform(p,a)     (p)->SetTransform(a)
459 #define ID3DXSprite_SetWorldViewRH(p,a,b) (p)->SetWorldViewRH(a,b)
460 #define ID3DXSprite_SetWorldViewLH(p,a,b) (p)->SetWorldViewLH(a,b)
461 #define ID3DXSprite_Begin(p,a)            (p)->Begin(a)
462 #define ID3DXSprite_Draw(p,a,b,c,d,e)     (p)->Draw(a,b,c,d,e)
463 #define ID3DXSprite_Flush(p)              (p)->Flush()
464 #define ID3DXSprite_End(p)                (p)->End()
465 #define ID3DXSprite_OnLostDevice(p)       (p)->OnLostDevice()
466 #define ID3DXSprite_OnResetDevice(p)      (p)->OnResetDevice()
467 #endif
468
469 /**********************************************
470  ****************** functions *****************
471  **********************************************/
472 #ifdef __cplusplus
473 extern "C" {
474 #endif
475
476 BOOL    WINAPI D3DXCheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers);
477 HRESULT WINAPI D3DXCreateFontA(LPDIRECT3DDEVICE9 device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset,
478                                DWORD precision, DWORD quality, DWORD pitchandfamily, LPCSTR facename, LPD3DXFONT *font);
479 HRESULT WINAPI D3DXCreateFontW(LPDIRECT3DDEVICE9 device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset,
480                                DWORD precision, DWORD quality, DWORD pitchandfamily, LPCWSTR facename, LPD3DXFONT *font);
481 #define        D3DXCreateFont WINELIB_NAME_AW(D3DXCreateFont)
482 HRESULT WINAPI D3DXCreateFontIndirectA(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_DESCA *desc, LPD3DXFONT *font);
483 HRESULT WINAPI D3DXCreateFontIndirectW(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_DESCW *desc, LPD3DXFONT *font);
484 #define        D3DXCreateFontIndirect WINELIB_NAME_AW(D3DXCreateFontIndirect)
485 HRESULT WINAPI D3DXCreateLine(LPDIRECT3DDEVICE9 device, LPD3DXLINE *line);
486 HRESULT WINAPI D3DXCreateRenderToEnvMap(LPDIRECT3DDEVICE9 device, UINT size, UINT miplevels, D3DFORMAT format, BOOL stencil, D3DFORMAT stencil_format, LPD3DXRenderToEnvMap *rtem);
487 HRESULT WINAPI D3DXCreateRenderToSurface(LPDIRECT3DDEVICE9 device, UINT width, UINT height, D3DFORMAT format, BOOL stencil, D3DFORMAT stencil_format, LPD3DXRENDERTOSURFACE *rts);
488 HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sprite);
489 BOOL    WINAPI D3DXDebugMute(BOOL mute);
490 UINT    WINAPI D3DXGetDriverLevel(LPDIRECT3DDEVICE9 device);
491
492 #ifdef __cplusplus
493 }
494 #endif
495
496 #endif /* __WINE_D3DX9CORE_H */