d3dx9core.h 24 KB

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