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