d3dx9mesh.h 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. #include <_mingw_unicode.h>
  2. #undef INTERFACE
  3. /*
  4. * Copyright (C) 2009 David Adam
  5. * Copyright (C) 2010 Tony Wasserka
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #include "d3dx9.h"
  22. #ifndef __WINE_D3DX9MESH_H
  23. #define __WINE_D3DX9MESH_H
  24. DEFINE_GUID(IID_ID3DXBaseMesh, 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
  25. DEFINE_GUID(IID_ID3DXMesh, 0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
  26. DEFINE_GUID(IID_ID3DXPMesh, 0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
  27. DEFINE_GUID(IID_ID3DXSPMesh, 0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x02, 0x90, 0xb8, 0x3c, 0xc5);
  28. DEFINE_GUID(IID_ID3DXSkinInfo, 0x11eaa540, 0xf9a6, 0x4d49, 0xae, 0x6a, 0xe1, 0x92, 0x21, 0xf7, 0x0c, 0xc4);
  29. DEFINE_GUID(IID_ID3DXPatchMesh,0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
  30. DEFINE_GUID(IID_ID3DXPRTBuffer, 0xf1827e47, 0x00a8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28);
  31. DEFINE_GUID(IID_ID3DXPRTCompBuffer, 0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x07);
  32. DEFINE_GUID(IID_ID3DXTextureGutterHelper, 0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9);
  33. DEFINE_GUID(IID_ID3DXPRTEngine, 0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53);
  34. #define UNUSED16 (0xffff)
  35. #define UNUSED32 (0xffffffff)
  36. enum _MAX_FVF_DECL_SIZE
  37. {
  38. MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1
  39. };
  40. enum _D3DXMESH
  41. {
  42. D3DXMESH_32BIT = 0x001,
  43. D3DXMESH_DONOTCLIP = 0x002,
  44. D3DXMESH_POINTS = 0x004,
  45. D3DXMESH_RTPATCHES = 0x008,
  46. D3DXMESH_NPATCHES = 0x4000,
  47. D3DXMESH_VB_SYSTEMMEM = 0x010,
  48. D3DXMESH_VB_MANAGED = 0x020,
  49. D3DXMESH_VB_WRITEONLY = 0x040,
  50. D3DXMESH_VB_DYNAMIC = 0x080,
  51. D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000,
  52. D3DXMESH_IB_SYSTEMMEM = 0x100,
  53. D3DXMESH_IB_MANAGED = 0x200,
  54. D3DXMESH_IB_WRITEONLY = 0x400,
  55. D3DXMESH_IB_DYNAMIC = 0x800,
  56. D3DXMESH_IB_SOFTWAREPROCESSING = 0x10000,
  57. D3DXMESH_VB_SHARE = 0x1000,
  58. D3DXMESH_USEHWONLY = 0x2000,
  59. D3DXMESH_SYSTEMMEM = 0x110,
  60. D3DXMESH_MANAGED = 0x220,
  61. D3DXMESH_WRITEONLY = 0x440,
  62. D3DXMESH_DYNAMIC = 0x880,
  63. D3DXMESH_SOFTWAREPROCESSING = 0x18000
  64. };
  65. enum _D3DXMESHOPT
  66. {
  67. D3DXMESHOPT_DEVICEINDEPENDENT = 0x00400000,
  68. D3DXMESHOPT_COMPACT = 0x01000000,
  69. D3DXMESHOPT_ATTRSORT = 0x02000000,
  70. D3DXMESHOPT_VERTEXCACHE = 0x04000000,
  71. D3DXMESHOPT_STRIPREORDER = 0x08000000,
  72. D3DXMESHOPT_IGNOREVERTS = 0x10000000,
  73. D3DXMESHOPT_DONOTSPLIT = 0x20000000,
  74. };
  75. typedef enum _D3DXPATCHMESHTYPE
  76. {
  77. D3DXPATCHMESH_RECT = 1,
  78. D3DXPATCHMESH_TRI = 2,
  79. D3DXPATCHMESH_NPATCH = 3,
  80. D3DXPATCHMESH_FORCE_DWORD = 0x7fffffff,
  81. } D3DXPATCHMESHTYPE;
  82. enum _D3DXPATCHMESH
  83. {
  84. D3DXPATCHMESH_DEFAULT = 0,
  85. };
  86. enum _D3DXMESHSIMP
  87. {
  88. D3DXMESHSIMP_VERTEX = 0x1,
  89. D3DXMESHSIMP_FACE = 0x2,
  90. };
  91. typedef enum D3DXCLEANTYPE {
  92. D3DXCLEAN_BACKFACING = 0x00000001,
  93. D3DXCLEAN_BOWTIES = 0x00000002,
  94. D3DXCLEAN_SKINNING = D3DXCLEAN_BACKFACING,
  95. D3DXCLEAN_OPTIMIZATION = D3DXCLEAN_BACKFACING,
  96. D3DXCLEAN_SIMPLIFICATION = D3DXCLEAN_BACKFACING | D3DXCLEAN_BOWTIES,
  97. } D3DXCLEANTYPE;
  98. typedef enum _D3DXTANGENT
  99. {
  100. D3DXTANGENT_WRAP_U = 0x0001,
  101. D3DXTANGENT_WRAP_V = 0x0002,
  102. D3DXTANGENT_WRAP_UV = 0x0003,
  103. D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x0004,
  104. D3DXTANGENT_DONT_ORTHOGONALIZE = 0x0008,
  105. D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x0010,
  106. D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x0020,
  107. D3DXTANGENT_WEIGHT_BY_AREA = 0x0040,
  108. D3DXTANGENT_WEIGHT_EQUAL = 0x0080,
  109. D3DXTANGENT_WIND_CW = 0x0100,
  110. D3DXTANGENT_CALCULATE_NORMALS = 0x0200,
  111. D3DXTANGENT_GENERATE_IN_PLACE = 0x0400,
  112. } D3DXTANGENT;
  113. typedef enum _D3DXIMT
  114. {
  115. D3DXIMT_WRAP_U = 0x01,
  116. D3DXIMT_WRAP_V = 0x02,
  117. D3DXIMT_WRAP_UV = 0x03,
  118. } D3DXIMT;
  119. typedef enum _D3DXUVATLAS
  120. {
  121. D3DXUVATLAS_DEFAULT = 0x00,
  122. D3DXUVATLAS_GEODESIC_FAST = 0x01,
  123. D3DXUVATLAS_GEODESIC_QUALITY = 0x02,
  124. } D3DXUVATLAS;
  125. typedef enum _D3DXEFFECTDEFAULTTYPE
  126. {
  127. D3DXEDT_STRING = 1,
  128. D3DXEDT_FLOATS = 2,
  129. D3DXEDT_DWORD = 3,
  130. D3DXEDT_FORCEDWORD = 0x7fffffff,
  131. } D3DXEFFECTDEFAULTTYPE;
  132. enum _D3DXWELDEPSILONSFLAGS
  133. {
  134. D3DXWELDEPSILONS_WELDALL = 0x1,
  135. D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2,
  136. D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4,
  137. D3DXWELDEPSILONS_DONOTSPLIT = 0x8,
  138. };
  139. typedef enum _D3DXSHCOMPRESSQUALITYTYPE
  140. {
  141. D3DXSHCQUAL_FASTLOWQUALITY = 1,
  142. D3DXSHCQUAL_SLOWHIGHQUALITY = 2,
  143. D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff,
  144. } D3DXSHCOMPRESSQUALITYTYPE;
  145. typedef enum _D3DXSHGPUSIMOPT
  146. {
  147. D3DXSHGPUSIMOPT_SHADOWRES256 = 1,
  148. D3DXSHGPUSIMOPT_SHADOWRES512 = 0,
  149. D3DXSHGPUSIMOPT_SHADOWRES1024 = 2,
  150. D3DXSHGPUSIMOPT_SHADOWRES2048 = 3,
  151. D3DXSHGPUSIMOPT_HIGHQUALITY = 4,
  152. D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff,
  153. } D3DXSHGPUSIMOPT;
  154. typedef struct ID3DXBaseMesh* LPD3DXBASEMESH;
  155. typedef struct ID3DXMesh* LPD3DXMESH;
  156. typedef struct ID3DXPMesh *LPD3DXPMESH;
  157. typedef struct ID3DXSPMesh *LPD3DXSPMESH;
  158. typedef struct ID3DXSkinInfo *LPD3DXSKININFO;
  159. typedef struct ID3DXPatchMesh *LPD3DXPATCHMESH;
  160. typedef struct ID3DXPRTBuffer *LPD3DXPRTBUFFER;
  161. typedef struct ID3DXPRTCompBuffer *LPD3DXPRTCOMPBUFFER;
  162. typedef struct ID3DXPRTEngine *LPD3DXPRTENGINE;
  163. typedef struct ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER;
  164. typedef struct _D3DXATTRIBUTERANGE {
  165. DWORD AttribId;
  166. DWORD FaceStart;
  167. DWORD FaceCount;
  168. DWORD VertexStart;
  169. DWORD VertexCount;
  170. } D3DXATTRIBUTERANGE;
  171. typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE;
  172. typedef struct _D3DXMATERIAL
  173. {
  174. D3DMATERIAL9 MatD3D;
  175. char *pTextureFilename;
  176. } D3DXMATERIAL, *LPD3DXMATERIAL;
  177. typedef struct _D3DXEFFECTDEFAULT
  178. {
  179. char *pParamName;
  180. D3DXEFFECTDEFAULTTYPE Type;
  181. DWORD NumBytes;
  182. void *pValue;
  183. } D3DXEFFECTDEFAULT, *LPD3DXEFFECTDEFAULT;
  184. typedef struct _D3DXEFFECTINSTANCE
  185. {
  186. char *pEffectFilename;
  187. DWORD NumDefaults;
  188. LPD3DXEFFECTDEFAULT pDefaults;
  189. } D3DXEFFECTINSTANCE, *LPD3DXEFFECTINSTANCE;
  190. typedef struct _D3DXATTRIBUTEWEIGHTS
  191. {
  192. FLOAT Position;
  193. FLOAT Boundary;
  194. FLOAT Normal;
  195. FLOAT Diffuse;
  196. FLOAT Specular;
  197. FLOAT Texcoords[8];
  198. FLOAT Tangent;
  199. FLOAT Binormal;
  200. } D3DXATTRIBUTEWEIGHTS, *LPD3DXATTRIBUTEWEIGHTS;
  201. typedef struct _D3DXWELDEPSILONS
  202. {
  203. FLOAT Position;
  204. FLOAT BlendWeights;
  205. FLOAT Normals;
  206. FLOAT PSize;
  207. FLOAT Specular;
  208. FLOAT Diffuse;
  209. FLOAT Texcoords[8];
  210. FLOAT Tangent;
  211. FLOAT Binormal;
  212. FLOAT TessFactor;
  213. } D3DXWELDEPSILONS, *LPD3DXWELDEPSILONS;
  214. typedef struct _D3DXBONECOMBINATION
  215. {
  216. DWORD AttribId;
  217. DWORD FaceStart;
  218. DWORD FaceCount;
  219. DWORD VertexStart;
  220. DWORD VertexCout;
  221. DWORD *BoneId;
  222. } D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION;
  223. typedef struct _D3DXPATCHINFO
  224. {
  225. D3DXPATCHMESHTYPE PatchType;
  226. D3DDEGREETYPE Degree;
  227. D3DBASISTYPE Basis;
  228. } D3DXPATCHINFO, *LPD3DXPATCHINFO;
  229. typedef struct _D3DXINTERSECTINFO
  230. {
  231. DWORD FaceIndex;
  232. FLOAT U;
  233. FLOAT V;
  234. FLOAT Dist;
  235. } D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO;
  236. typedef struct _D3DXSHMATERIAL
  237. {
  238. D3DCOLORVALUE Diffuse;
  239. WINBOOL bMirror;
  240. WINBOOL bSubSurf;
  241. FLOAT RelativeIndexOfRefraction;
  242. D3DCOLORVALUE Absorption;
  243. D3DCOLORVALUE ReducedScattering;
  244. } D3DXSHMATERIAL;
  245. typedef struct _D3DXSHPRTSPLITMESHVERTDATA
  246. {
  247. UINT uVertRemap;
  248. UINT uSubCluster;
  249. UCHAR ucVertStatus;
  250. } D3DXSHPRTSPLITMESHVERTDATA;
  251. typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA
  252. {
  253. UINT uVertStart;
  254. UINT uVertLength;
  255. UINT uFaceStart;
  256. UINT uFaceLength;
  257. UINT uClusterStart;
  258. UINT uClusterLength;
  259. } D3DXSHPRTSPLITMESHCLUSTERDATA;
  260. typedef struct _XFILECOMPRESSEDANIMATIONSET
  261. {
  262. DWORD CompressedBlockSize;
  263. FLOAT TicksPerSec;
  264. DWORD PlaybackType;
  265. DWORD BufferLength;
  266. } XFILECOMPRESSEDANIMATIONSET;
  267. typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(float complete, void *ctx);
  268. typedef HRESULT (WINAPI *LPD3DXIMTSIGNALCALLBACK)(const D3DXVECTOR2 *, UINT, UINT, void *, FLOAT *);
  269. typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float complete, void *ctx);
  270. #undef INTERFACE
  271. #define INTERFACE ID3DXBaseMesh
  272. DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown)
  273. {
  274. /*** IUnknown methods ***/
  275. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  276. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  277. STDMETHOD_(ULONG, Release)(THIS) PURE;
  278. /*** ID3DXBaseMesh ***/
  279. STDMETHOD(DrawSubset)(THIS_ DWORD attrib_id) PURE;
  280. STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
  281. STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
  282. STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
  283. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  284. STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE;
  285. STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
  286. STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
  287. STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf,
  288. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  289. STDMETHOD(CloneMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  290. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  291. STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE;
  292. STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE;
  293. STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE;
  294. STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
  295. STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE;
  296. STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
  297. STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE;
  298. STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE;
  299. STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE;
  300. STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE;
  301. STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  302. };
  303. #undef INTERFACE
  304. #define INTERFACE ID3DXMesh
  305. DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh)
  306. {
  307. /*** IUnknown methods ***/
  308. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  309. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  310. STDMETHOD_(ULONG, Release)(THIS) PURE;
  311. /*** ID3DXBaseMesh ***/
  312. STDMETHOD(DrawSubset)(THIS_ DWORD attrib_id) PURE;
  313. STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
  314. STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
  315. STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
  316. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  317. STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE;
  318. STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
  319. STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
  320. STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf,
  321. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  322. STDMETHOD(CloneMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  323. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  324. STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE;
  325. STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE;
  326. STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE;
  327. STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
  328. STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE;
  329. STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
  330. STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE;
  331. STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE;
  332. STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE;
  333. STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE;
  334. STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  335. /*** ID3DXMesh ***/
  336. STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** data) PURE;
  337. STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
  338. STDMETHOD(Optimize)(THIS_ DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out,
  339. DWORD *face_remap, ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh) PURE;
  340. STDMETHOD(OptimizeInplace)(THIS_ DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out,
  341. DWORD *face_remap, ID3DXBuffer **vertex_remap) PURE;
  342. STDMETHOD(SetAttributeTable)(THIS_ const D3DXATTRIBUTERANGE *attrib_table,
  343. DWORD attrib_table_size) PURE;
  344. };
  345. #undef INTERFACE
  346. #define INTERFACE ID3DXPMesh
  347. DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh)
  348. {
  349. /*** IUnknown methods ***/
  350. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  351. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  352. STDMETHOD_(ULONG, Release)(THIS) PURE;
  353. /*** ID3DXBaseMesh ***/
  354. STDMETHOD(DrawSubset)(THIS_ DWORD attrib_id) PURE;
  355. STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
  356. STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
  357. STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
  358. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  359. STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE;
  360. STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
  361. STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
  362. STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf,
  363. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  364. STDMETHOD(CloneMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  365. struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE;
  366. STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE;
  367. STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE;
  368. STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE;
  369. STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
  370. STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE;
  371. STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
  372. STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE;
  373. STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE;
  374. STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE;
  375. STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE;
  376. STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  377. /*** ID3DXPMesh ***/
  378. STDMETHOD(ClonePMeshFVF)(THIS_ DWORD options, DWORD fvf,
  379. struct IDirect3DDevice9 *device, struct ID3DXPMesh **clone_mesh) PURE;
  380. STDMETHOD(ClonePMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  381. struct IDirect3DDevice9 *device, struct ID3DXPMesh **clone_mesh) PURE;
  382. STDMETHOD(SetNumFaces)(THIS_ DWORD faces) PURE;
  383. STDMETHOD(SetNumVertices)(THIS_ DWORD vertices) PURE;
  384. STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
  385. STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE;
  386. STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
  387. STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE;
  388. STDMETHOD(Save)(THIS_ IStream *stream, const D3DXMATERIAL *material,
  389. const D3DXEFFECTINSTANCE *effect_instance, DWORD num_materials) PURE;
  390. STDMETHOD(Optimize)(THIS_ DWORD flags, DWORD *adjacency_out, DWORD *face_remap,
  391. ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh) PURE;
  392. STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD flags, DWORD* face_remap) PURE;
  393. STDMETHOD(TrimByFaces)(THIS_ DWORD new_faces_min, DWORD new_faces_max, DWORD* face_remap, DWORD* vertex_remap) PURE;
  394. STDMETHOD(TrimByVertices)(THIS_ DWORD new_vertices_min, DWORD new_vertices_max, DWORD* face_remap, DWORD* vertex_remap) PURE;
  395. STDMETHOD(GetAdjacency)(THIS_ DWORD* adjacency) PURE;
  396. STDMETHOD(GenerateVertexHistory)(THIS_ DWORD* vertex_history) PURE;
  397. };
  398. #undef INTERFACE
  399. #define INTERFACE ID3DXSPMesh
  400. DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown)
  401. {
  402. /*** IUnknown methods ***/
  403. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  404. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  405. STDMETHOD_(ULONG, Release)(THIS) PURE;
  406. /*** ID3DXSPMesh ***/
  407. STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
  408. STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
  409. STDMETHOD_(DWORD, GetNumFVF)(THIS) PURE;
  410. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  411. STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
  412. STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
  413. STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf,
  414. struct IDirect3DDevice9 *device, DWORD *adjacency_out,
  415. DWORD *vertex_remap_out, struct ID3DXMesh **clone_mesh) PURE;
  416. STDMETHOD(CloneMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  417. struct IDirect3DDevice9 *device, DWORD *adjacency_out,
  418. DWORD *vertex_remap_out, struct ID3DXMesh **clone_mesh) PURE;
  419. STDMETHOD(ClonePMeshFVF)(THIS_ DWORD options, DWORD fvf,
  420. struct IDirect3DDevice9 *device, DWORD *vertex_remap_out,
  421. float *errors_by_face, struct ID3DXPMesh **clone_mesh) PURE;
  422. STDMETHOD(ClonePMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration,
  423. struct IDirect3DDevice9 *device, DWORD *vertex_remap_out,
  424. float *errors_by_face, struct ID3DXPMesh **clone_mesh) PURE;
  425. STDMETHOD(ReduceFaces)(THIS_ DWORD faces) PURE;
  426. STDMETHOD(ReduceVertices)(THIS_ DWORD vertices) PURE;
  427. STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
  428. STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
  429. STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS vertex_attribute_weights) PURE;
  430. STDMETHOD(GetVertexWeights)(THIS_ FLOAT* vertex_weights) PURE;
  431. };
  432. #undef INTERFACE
  433. #define INTERFACE ID3DXPatchMesh
  434. DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown)
  435. {
  436. /*** IUnknown methods ***/
  437. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  438. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  439. STDMETHOD_(ULONG, Release)(THIS) PURE;
  440. /*** ID3DXPatchMesh ***/
  441. STDMETHOD_(DWORD, GetNumPatches)(THIS) PURE;
  442. STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
  443. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  444. STDMETHOD_(DWORD, GetControlVerticesPerPatch)(THIS) PURE;
  445. STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
  446. STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
  447. STDMETHOD(GetPatchInfo)(THIS_ LPD3DXPATCHINFO patch_info) PURE;
  448. STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE;
  449. STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE;
  450. STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE;
  451. STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
  452. STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE;
  453. STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
  454. STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** data) PURE;
  455. STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
  456. STDMETHOD(GetTessSize)(THIS_ FLOAT tess_level, DWORD adaptive, DWORD* num_triangles, DWORD* num_vertices) PURE;
  457. STDMETHOD(GenerateAdjacency)(THIS_ FLOAT tolerance) PURE;
  458. STDMETHOD(CloneMesh)(THIS_ DWORD options, const D3DVERTEXELEMENT9 *declaration, ID3DXPatchMesh **clone_mesh) PURE;
  459. STDMETHOD(Optimize)(THIS_ DWORD flags) PURE;
  460. STDMETHOD(SetDisplaceParam)(THIS_ struct IDirect3DBaseTexture9 *texture, D3DTEXTUREFILTERTYPE min_filter,
  461. D3DTEXTUREFILTERTYPE mag_filter, D3DTEXTUREFILTERTYPE mip_filter, D3DTEXTUREADDRESS wrap,
  462. DWORD lod_bias) PURE;
  463. STDMETHOD(GetDisplaceParam)(THIS_ struct IDirect3DBaseTexture9 **texture, D3DTEXTUREFILTERTYPE *min_filter,
  464. D3DTEXTUREFILTERTYPE *mag_filter, D3DTEXTUREFILTERTYPE *mip_filter, D3DTEXTUREADDRESS *wrap,
  465. DWORD *lod_bias) PURE;
  466. STDMETHOD(Tessellate)(THIS_ float tess_level, ID3DXMesh *mesh) PURE;
  467. STDMETHOD(TessellateAdaptive)(THIS_ const D3DXVECTOR4 *trans, DWORD max_tess_level,
  468. DWORD min_tess_level, ID3DXMesh *mesh) PURE;
  469. };
  470. #undef INTERFACE
  471. #define INTERFACE ID3DXSkinInfo
  472. DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown)
  473. {
  474. /*** IUnknown methods ***/
  475. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  476. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  477. STDMETHOD_(ULONG, Release)(THIS) PURE;
  478. /*** ID3DXSkinInfo ***/
  479. STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD num_influences, const DWORD *vertices,
  480. const FLOAT *weights) PURE;
  481. STDMETHOD(SetBoneVertexInfluence)(THIS_ DWORD bone_num, DWORD influence_num, float weight) PURE;
  482. STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE;
  483. STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE;
  484. STDMETHOD(GetBoneVertexInfluence)(THIS_ DWORD bone_num, DWORD influence_num, float *weight, DWORD* vertex_num) PURE;
  485. STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* max_vertex_influences) PURE;
  486. STDMETHOD_(DWORD, GetNumBones)(THIS) PURE;
  487. STDMETHOD(FindBoneVertexInfluenceIndex)(THIS_ DWORD bone_num, DWORD vertex_num, DWORD* influence_index) PURE;
  488. STDMETHOD(GetMaxFaceInfluences)(THIS_ struct IDirect3DIndexBuffer9 *index_buffer,
  489. DWORD num_faces, DWORD *max_face_influences) PURE;
  490. STDMETHOD(SetMinBoneInfluence)(THIS_ FLOAT min_influence) PURE;
  491. STDMETHOD_(FLOAT, GetMinBoneInfluence)(THIS) PURE;
  492. STDMETHOD(SetBoneName)(THIS_ DWORD bone_idx, const char *name) PURE;
  493. STDMETHOD_(const char *, GetBoneName)(THIS_ DWORD bone_idx) PURE;
  494. STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD bone, const D3DXMATRIX *bone_transform) PURE;
  495. STDMETHOD_(D3DXMATRIX *, GetBoneOffsetMatrix)(THIS_ DWORD bone) PURE;
  496. STDMETHOD(Clone)(THIS_ ID3DXSkinInfo **skin_info) PURE;
  497. STDMETHOD(Remap)(THIS_ DWORD num_vertices, DWORD* vertex_remap) PURE;
  498. STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
  499. STDMETHOD(SetDeclaration)(THIS_ const D3DVERTEXELEMENT9 *declaration) PURE;
  500. STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
  501. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
  502. STDMETHOD(UpdateSkinnedMesh)(THIS_ const D3DXMATRIX *bone_transforms,
  503. const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices) PURE;
  504. STDMETHOD(ConvertToBlendedMesh)(THIS_ ID3DXMesh *mesh_in, DWORD options, const DWORD *adjacency_in,
  505. DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl,
  506. DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out) PURE;
  507. STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ ID3DXMesh *mesh_in, DWORD options, DWORD palette_size,
  508. const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap,
  509. DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table,
  510. ID3DXMesh **mesh_out) PURE;
  511. };
  512. #undef INTERFACE
  513. #define INTERFACE ID3DXPRTBuffer
  514. DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown)
  515. {
  516. /*** IUnknown methods ***/
  517. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  518. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  519. STDMETHOD_(ULONG, Release)(THIS) PURE;
  520. /*** ID3DXPRTBuffer methods ***/
  521. STDMETHOD_(UINT, GetNumSamples)(THIS) PURE;
  522. STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE;
  523. STDMETHOD_(UINT, GetNumChannels)(THIS) PURE;
  524. STDMETHOD_(WINBOOL, IsTexture)(THIS) PURE;
  525. STDMETHOD_(WINBOOL, GetWidth)(THIS) PURE;
  526. STDMETHOD_(WINBOOL, GetHeight)(THIS) PURE;
  527. STDMETHOD(Resize)(THIS_ UINT new_size) PURE;
  528. STDMETHOD(LockBuffer)(THIS_ UINT start, UINT num_samples, FLOAT **data) PURE;
  529. STDMETHOD(UnlockBuffer)(THIS) PURE;
  530. STDMETHOD(ScaleBuffer)(THIS_ FLOAT scale) PURE;
  531. STDMETHOD(AddBuffer)(THIS_ ID3DXPRTBuffer *buffer) PURE;
  532. STDMETHOD(AttachGH)(THIS_ struct ID3DXTextureGutterHelper *gh) PURE;
  533. STDMETHOD(ReleaseGH)(THIS) PURE;
  534. STDMETHOD(EvalGH)(THIS) PURE;
  535. STDMETHOD(ExtractTexture)(THIS_ UINT channel, UINT start_coefficient,
  536. UINT num_coefficients, struct IDirect3DTexture9 *texture) PURE;
  537. STDMETHOD(ExtractToMesh)(THIS_ UINT num_coefficients, D3DDECLUSAGE usage,
  538. UINT usage_index_start, ID3DXMesh *scene) PURE;
  539. };
  540. #undef INTERFACE
  541. #define INTERFACE ID3DXPRTCompBuffer
  542. DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown)
  543. {
  544. /*** IUnknown methods ***/
  545. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  546. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  547. STDMETHOD_(ULONG, Release)(THIS) PURE;
  548. /*** ID3DXPRTCompBuffer methods ***/
  549. STDMETHOD_(UINT, GetNumSamples)(THIS) PURE;
  550. STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE;
  551. STDMETHOD_(UINT, GetNumChannels)(THIS) PURE;
  552. STDMETHOD_(WINBOOL, IsTexture)(THIS) PURE;
  553. STDMETHOD_(UINT, GetWidth)(THIS) PURE;
  554. STDMETHOD_(UINT, GetHeight)(THIS) PURE;
  555. STDMETHOD_(UINT, GetNumClusters)(THIS) PURE;
  556. STDMETHOD_(UINT, GetNumPCA)(THIS) PURE;
  557. STDMETHOD(NormalizeData)(THIS) PURE;
  558. STDMETHOD(ExtractBasis)(THIS_ UINT cluster, FLOAT *cluster_basis) PURE;
  559. STDMETHOD(ExtractClusterIDs)(THIS_ UINT *cluster_ids) PURE;
  560. STDMETHOD(ExtractPCA)(THIS_ UINT start_pca, UINT num_extract, FLOAT *pca_coefficients) PURE;
  561. STDMETHOD(ExtractTexture)(THIS_ UINT start_pca, UINT num_pca, struct IDirect3DTexture9 *texture) PURE;
  562. STDMETHOD(ExtractToMesh)(THIS_ UINT num_pca, D3DDECLUSAGE usage, UINT usage_index_start, ID3DXMesh *scene) PURE;
  563. };
  564. #undef INTERFACE
  565. #define INTERFACE ID3DXTextureGutterHelper
  566. DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown)
  567. {
  568. /*** IUnknown methods ***/
  569. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  570. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  571. STDMETHOD_(ULONG, Release)(THIS) PURE;
  572. /*** ID3DXTextureGutterHelper methods ***/
  573. STDMETHOD_(UINT, GetWidth)(THIS) PURE;
  574. STDMETHOD_(UINT, GetHeight)(THIS) PURE;
  575. STDMETHOD(ApplyGuttersFloat)(THIS_ FLOAT *data_in, UINT num_coeffs, UINT width, UINT height) PURE;
  576. STDMETHOD(ApplyGuttersTex)(THIS_ struct IDirect3DTexture9 *texture) PURE;
  577. STDMETHOD(ApplyGuttersPRT)(THIS_ ID3DXPRTBuffer *buffer) PURE;
  578. STDMETHOD(ResampleTex)(THIS_ struct IDirect3DTexture9 *texture_in, struct ID3DXMesh *mesh_in,
  579. D3DDECLUSAGE usage, UINT usage_index, struct IDirect3DTexture9 *texture_out) PURE;
  580. STDMETHOD(GetFaceMap)(THIS_ UINT *face_data) PURE;
  581. STDMETHOD(GetBaryMap)(THIS_ D3DXVECTOR2 *bary_data) PURE;
  582. STDMETHOD(GetTexelMap)(THIS_ D3DXVECTOR2 *texel_data) PURE;
  583. STDMETHOD(GetGutterMap)(THIS_ BYTE *gutter_data) PURE;
  584. STDMETHOD(SetFaceMap)(THIS_ UINT *face_data) PURE;
  585. STDMETHOD(SetBaryMap)(THIS_ D3DXVECTOR2 *bary_data) PURE;
  586. STDMETHOD(SetTexelMap)(THIS_ D3DXVECTOR2 *texel_data) PURE;
  587. STDMETHOD(SetGutterMap)(THIS_ BYTE *gutter_data) PURE;
  588. };
  589. #undef INTERFACE
  590. #define INTERFACE ID3DXPRTEngine
  591. DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown)
  592. {
  593. /*** IUnknown methods ***/
  594. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  595. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  596. STDMETHOD_(ULONG, Release)(THIS) PURE;
  597. /*** ID3DXPRTEngine methods ***/
  598. STDMETHOD(SetMeshMaterials)(THIS_ const D3DXSHMATERIAL **materials, UINT num_meshes,
  599. UINT num_channels, WINBOOL set_albedo, FLOAT length_scale) PURE;
  600. STDMETHOD(SetPerVertexAlbedo)(THIS_ const void *data_in, UINT num_channels, UINT stride) PURE;
  601. STDMETHOD(SetPerTexelAlbedo)(THIS_ struct IDirect3DTexture9 *albedo_texture,
  602. UINT num_channels, struct ID3DXTextureGutterHelper *gh) PURE;
  603. STDMETHOD(GetVertexAlbedo)(THIS_ D3DXCOLOR *vert_colors, UINT num_verts) PURE;
  604. STDMETHOD(SetPerTexelNormals)(THIS_ struct IDirect3DTexture9 *normal_texture) PURE;
  605. STDMETHOD(ExtractPerVertexAlbedo)(THIS_ ID3DXMesh *mesh, D3DDECLUSAGE usage, UINT num_channels) PURE;
  606. STDMETHOD(ResampleBuffer)(THIS_ ID3DXPRTBuffer *buffer_in, ID3DXPRTBuffer *buffer_out) PURE;
  607. STDMETHOD(GetAdaptedMesh)(THIS_ struct IDirect3DDevice9 *device, UINT *face_remap,
  608. UINT *vert_remap, float *vert_weights, struct ID3DXMesh **mesh) PURE;
  609. STDMETHOD_(UINT, GetNumVerts)(THIS) PURE;
  610. STDMETHOD_(UINT, GetNumFaces)(THIS) PURE;
  611. STDMETHOD(SetMinMaxIntersection)(THIS_ FLOAT min, FLOAT max) PURE;
  612. STDMETHOD(RobustMeshRefine)(THIS_ FLOAT min_edge_length, UINT max_subdiv) PURE;
  613. STDMETHOD(SetSamplingInfo)(THIS_ UINT num_rays, WINBOOL use_sphere,
  614. WINBOOL use_cosine, WINBOOL adaptive, FLOAT adpative_thresh) PURE;
  615. STDMETHOD(ComputeDirectLightingSH)(THIS_ UINT sh_order, ID3DXPRTBuffer *data_out) PURE;
  616. STDMETHOD(ComputeDirectLightingSHAdaptive)(THIS_ UINT sh_order, float adaptive_thresh,
  617. float min_edge_length, UINT max_subdiv, ID3DXPRTBuffer *data_out) PURE;
  618. STDMETHOD(ComputeDirectLightingSHGPU)(THIS_ struct IDirect3DDevice9 *device, UINT flags,
  619. UINT sh_order, float zbias, float zangle_bias, struct ID3DXPRTBuffer *data_out) PURE;
  620. STDMETHOD(ComputeSS)(THIS_ ID3DXPRTBuffer *data_in, ID3DXPRTBuffer *data_out,
  621. ID3DXPRTBuffer *data_total) PURE;
  622. STDMETHOD(ComputeSSAdaptive)(THIS_ ID3DXPRTBuffer *data_in, float adaptive_thres,
  623. float min_edge_length, UINT max_subdiv, ID3DXPRTBuffer *data_out, ID3DXPRTBuffer *data_total) PURE;
  624. STDMETHOD(ComputeBounce)(THIS_ ID3DXPRTBuffer *data_in, ID3DXPRTBuffer *data_out,
  625. ID3DXPRTBuffer *data_total) PURE;
  626. STDMETHOD(ComputeBounceAdaptive)(THIS_ ID3DXPRTBuffer *data_in, float adaptive_thres,
  627. float min_edge_length, UINT max_subdiv, ID3DXPRTBuffer *data_out, ID3DXPRTBuffer *data_total) PURE;
  628. STDMETHOD(ComputeVolumeSamplesDirectSH)(THIS_ UINT sh_order_in, UINT sh_order_out,
  629. UINT num_vol_samples, const D3DXVECTOR3 *sample_locs, ID3DXPRTBuffer *data_out) PURE;
  630. STDMETHOD(ComputeVolumeSamples)(THIS_ ID3DXPRTBuffer *surf_data_in, UINT sh_order,
  631. UINT num_vol_samples, const D3DXVECTOR3 *sample_locs, ID3DXPRTBuffer *data_out) PURE;
  632. STDMETHOD(ComputeSurfSamplesDirectSH)(THIS_ UINT sh_order, UINT num_samples,
  633. const D3DXVECTOR3 *sample_locs, const D3DXVECTOR3 *sample_norms, ID3DXPRTBuffer *data_out) PURE;
  634. STDMETHOD(ComputeSurfSamplesBounce)(THIS_ ID3DXPRTBuffer *surf_data_in, UINT num_samples,
  635. const D3DXVECTOR3 *sample_locs, const D3DXVECTOR3 *sample_norms, ID3DXPRTBuffer *data_out,
  636. ID3DXPRTBuffer *data_total) PURE;
  637. STDMETHOD(FreeSSData)(THIS) PURE;
  638. STDMETHOD(FreeBounceData)(THIS) PURE;
  639. STDMETHOD(ComputeLDPRTCoeffs)(THIS_ ID3DXPRTBuffer *data_in, UINT sh_order, D3DXVECTOR3 *norm_out,
  640. ID3DXPRTBuffer *data_out) PURE;
  641. STDMETHOD(ScaleMeshChunk)(THIS_ UINT mesh_chunk, float scale, ID3DXPRTBuffer *data_out) PURE;
  642. STDMETHOD(MultiplyAlbedo)(THIS_ ID3DXPRTBuffer *data_out) PURE;
  643. STDMETHOD(SetCallback)(THIS_ LPD3DXSHPRTSIMCB cb, float frequency, void *user_context) PURE;
  644. STDMETHOD_(WINBOOL, ShadowRayIntersects)(THIS_ const D3DXVECTOR3 *ray_pos,
  645. const D3DXVECTOR3 *ray_dir) PURE;
  646. STDMETHOD_(WINBOOL, ClosestRayIntersects)(THIS_ const D3DXVECTOR3 *ray_pos,
  647. const D3DXVECTOR3 *ray_dir, DWORD *face_index, FLOAT *u, FLOAT *v, FLOAT *dist) PURE;
  648. };
  649. #undef INTERFACE
  650. #ifdef __cplusplus
  651. extern "C" {
  652. #endif
  653. HRESULT WINAPI D3DXCreateMesh(DWORD face_count, DWORD vertex_count, DWORD flags,
  654. const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh);
  655. HRESULT WINAPI D3DXCreateMeshFVF(DWORD face_count, DWORD vertex_count, DWORD flags,
  656. DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh);
  657. HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer);
  658. HRESULT WINAPI D3DXCreateSPMesh(ID3DXMesh *mesh, const DWORD *adjacency,
  659. const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, ID3DXSPMesh **spmesh);
  660. HRESULT WINAPI D3DXCreatePMeshFromStream(struct IStream *stream, DWORD flags, struct IDirect3DDevice9 *device,
  661. struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  662. DWORD *material_count, struct ID3DXPMesh **mesh);
  663. HRESULT WINAPI D3DXCreateSkinInfo(DWORD vertex_count, const D3DVERTEXELEMENT9 *declaration,
  664. DWORD bone_count, ID3DXSkinInfo **skin_info);
  665. HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD vertex_count, DWORD fvf, DWORD bone_count, ID3DXSkinInfo **skin_info);
  666. HRESULT WINAPI D3DXCreateSkinInfoFromBlendedMesh(ID3DXBaseMesh *mesh, DWORD bone_count,
  667. const D3DXBONECOMBINATION *bone_combination_table, ID3DXSkinInfo **skin_info);
  668. HRESULT WINAPI D3DXCreatePatchMesh(const D3DXPATCHINFO *patch_info, DWORD patch_count,
  669. DWORD vertex_count, DWORD flags, const D3DVERTEXELEMENT9 *declaration,
  670. struct IDirect3DDevice9 *device, struct ID3DXPatchMesh **mesh);
  671. HRESULT WINAPI D3DXCreatePRTBuffer(UINT sample_count, UINT coeff_count, UINT channel_count, ID3DXPRTBuffer **buffer);
  672. HRESULT WINAPI D3DXCreatePRTBufferTex(UINT width, UINT height, UINT coeff_count,
  673. UINT channel_count, ID3DXPRTBuffer **buffer);
  674. HRESULT WINAPI D3DXCreatePRTCompBuffer(D3DXSHCOMPRESSQUALITYTYPE quality, UINT cluster_count, UINT pca_count,
  675. LPD3DXSHPRTSIMCB cb, void *ctx, ID3DXPRTBuffer *input, ID3DXPRTCompBuffer **buffer);
  676. HRESULT WINAPI D3DXCreateTextureGutterHelper(UINT width, UINT height, ID3DXMesh *mesh,
  677. float gutter_size, ID3DXTextureGutterHelper **gh);
  678. HRESULT WINAPI D3DXCreatePRTEngine(ID3DXMesh *mesh, DWORD *adjacency, WINBOOL extract_uv,
  679. ID3DXMesh *blocker_mesh, ID3DXPRTEngine **engine);
  680. HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD flags, struct IDirect3DDevice9 *device,
  681. struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  682. DWORD *material_count, struct ID3DXMesh **mesh);
  683. HRESULT WINAPI D3DXLoadMeshFromXW(const WCHAR *filename, DWORD flags, struct IDirect3DDevice9 *device,
  684. struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  685. DWORD *material_count, struct ID3DXMesh **mesh);
  686. #define D3DXLoadMeshFromX __MINGW_NAME_AW(D3DXLoadMeshFromX)
  687. HRESULT WINAPI D3DXLoadMeshFromXInMemory(const void *data, DWORD data_size, DWORD flags,
  688. struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials,
  689. struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh);
  690. HRESULT WINAPI D3DXLoadMeshFromXResource(HMODULE module, const char *resource, const char *resource_type,
  691. DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency,
  692. struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  693. DWORD *material_count, struct ID3DXMesh **mesh);
  694. HRESULT WINAPI D3DXLoadMeshFromXof(struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device,
  695. struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  696. DWORD *material_count, struct ID3DXMesh **mesh);
  697. HRESULT WINAPI D3DXLoadPatchMeshFromXof(struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device,
  698. struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  699. DWORD *material_count, struct ID3DXPatchMesh **mesh);
  700. HRESULT WINAPI D3DXLoadSkinMeshFromXof(struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device,
  701. struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
  702. DWORD *material_count, struct ID3DXSkinInfo **skin_info, struct ID3DXMesh **mesh);
  703. HRESULT WINAPI D3DXLoadPRTBufferFromFileA(const char *filename, ID3DXPRTBuffer **buffer);
  704. HRESULT WINAPI D3DXLoadPRTBufferFromFileW(const WCHAR *filename, ID3DXPRTBuffer **buffer);
  705. #define D3DXLoadPRTBufferFromFile __MINGW_NAME_AW(D3DXLoadPRTBufferFromFile)
  706. HRESULT WINAPI D3DXLoadPRTCompBufferFromFileA(const char *filename, ID3DXPRTCompBuffer **buffer);
  707. HRESULT WINAPI D3DXLoadPRTCompBufferFromFileW(const WCHAR *filename, ID3DXPRTCompBuffer **buffer);
  708. #define D3DXLoadPRTCompBufferFromFile __MINGW_NAME_AW(D3DXLoadPRTCompBufferFromFile)
  709. HRESULT WINAPI D3DXSaveMeshToXA(const char *filename, ID3DXMesh *mesh, const DWORD *adjacency,
  710. const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effect_instances, DWORD material_count, DWORD format);
  711. HRESULT WINAPI D3DXSaveMeshToXW(const WCHAR *filename, ID3DXMesh *mesh, const DWORD *adjacency,
  712. const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effect_instances, DWORD material_count, DWORD format);
  713. #define D3DXSaveMeshToX __MINGW_NAME_AW(D3DXSaveMeshToX)
  714. HRESULT WINAPI D3DXSavePRTBufferToFileA(const char *filename, ID3DXPRTBuffer *buffer);
  715. HRESULT WINAPI D3DXSavePRTBufferToFileW(const WCHAR *filename, ID3DXPRTBuffer *buffer);
  716. #define D3DXSavePRTBufferToFile __MINGW_NAME_AW(D3DXSavePRTBufferToFile)
  717. HRESULT WINAPI D3DXSavePRTCompBufferToFileA(const char *filename, ID3DXPRTCompBuffer *buffer);
  718. HRESULT WINAPI D3DXSavePRTCompBufferToFileW(const WCHAR *filename, ID3DXPRTCompBuffer *buffer);
  719. #define D3DXSavePRTCompBufferToFile __MINGW_NAME_AW(D3DXSavePRTCompBufferToFile)
  720. UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl);
  721. UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx);
  722. UINT WINAPI D3DXGetFVFVertexSize(DWORD);
  723. WINBOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *vmin, const D3DXVECTOR3 *vmax,
  724. const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir);
  725. WINBOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *center, FLOAT radius,
  726. const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir);
  727. HRESULT WINAPI D3DXCleanMesh(D3DXCLEANTYPE clean_type, ID3DXMesh *mesh_in, const DWORD *adjacency_in,
  728. ID3DXMesh **mesh_out, DWORD *adjacency_out, ID3DXBuffer **errors);
  729. HRESULT WINAPI D3DXConcatenateMeshes(struct ID3DXMesh **meshes, UINT mesh_count, DWORD flags,
  730. const D3DXMATRIX *geometry_matrices, const D3DXMATRIX *texture_matrices,
  731. const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh);
  732. HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *first_pos, DWORD num_vertices,
  733. DWORD stride, D3DXVECTOR3 *vmin, D3DXVECTOR3 *vmax);
  734. HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *first_pos, DWORD num_vertices,
  735. DWORD stride, D3DXVECTOR3 *center, FLOAT *radius);
  736. HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal(ID3DXMesh *mesh, DWORD texture_idx, float *texel_signal,
  737. UINT width, UINT height, UINT signal_dimension, UINT component_count, DWORD flags,
  738. LPD3DXUVATLASCB cb, void *ctx, ID3DXBuffer **buffer);
  739. HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal(ID3DXMesh *mesh, const float *vertex_signal,
  740. UINT signal_dimension, UINT signal_stride, DWORD flags,
  741. LPD3DXUVATLASCB cb, void *ctx, ID3DXBuffer **buffer);
  742. HRESULT WINAPI D3DXComputeIMTFromSignal(ID3DXMesh *mesh, DWORD texture_idx, UINT signal_dimension,
  743. float max_uv_distance, DWORD flags, LPD3DXIMTSIGNALCALLBACK signal_cb, void *signal_ctx,
  744. LPD3DXUVATLASCB status_cb, void *status_ctx, ID3DXBuffer **buffer);
  745. HRESULT WINAPI D3DXComputeIMTFromTexture(struct ID3DXMesh *mesh, struct IDirect3DTexture9 *texture,
  746. DWORD texture_idx, DWORD options, LPD3DXUVATLASCB cb, void *ctx, struct ID3DXBuffer **out);
  747. HRESULT WINAPI D3DXComputeNormals(ID3DXBaseMesh *mesh, const DWORD *adjacency);
  748. HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh_in, DWORD texture_in_semantic, DWORD texture_in_idx,
  749. DWORD u_partial_out_semantic, DWORD u_partial_out_idx, DWORD v_partial_out_semantic,
  750. DWORD v_partial_out_idx, DWORD normal_out_semantic, DWORD normal_out_idx, DWORD flags,
  751. const DWORD *adjacency, float partial_edge_threshold, float singular_point_threshold,
  752. float normal_edge_threshold, ID3DXMesh **mesh_out, ID3DXBuffer **buffer);
  753. HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage, DWORD tangent_idx,
  754. DWORD binorm_idx, DWORD wrap, const DWORD *adjacency);
  755. HRESULT WINAPI D3DXConvertMeshSubsetToSingleStrip(struct ID3DXBaseMesh *mesh_in, DWORD attribute_id,
  756. DWORD ib_flags, struct IDirect3DIndexBuffer9 **index_buffer, DWORD *index_count);
  757. HRESULT WINAPI D3DXConvertMeshSubsetToStrips(struct ID3DXBaseMesh *mesh_in, DWORD attribute_id,
  758. DWORD ib_flags, struct IDirect3DIndexBuffer9 **index_buffer, DWORD *index_count,
  759. struct ID3DXBuffer **strip_lengths, DWORD *strip_count);
  760. HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD, D3DVERTEXELEMENT9[MAX_FVF_DECL_SIZE]);
  761. HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *decl, DWORD *fvf);
  762. HRESULT WINAPI D3DXGenerateOutputDecl(D3DVERTEXELEMENT9 *decl_out, const D3DVERTEXELEMENT9 *decl_in);
  763. HRESULT WINAPI D3DXGeneratePMesh(ID3DXMesh *mesh, const DWORD *adjacency,
  764. const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights,
  765. DWORD min_value, DWORD flags, ID3DXPMesh **pmesh);
  766. HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction,
  767. WINBOOL *hit, DWORD *face_idx, float *u, float *v, float *distance, ID3DXBuffer **hits, DWORD *hit_count);
  768. HRESULT WINAPI D3DXIntersectSubset(ID3DXBaseMesh *mesh, DWORD attribute_id, const D3DXVECTOR3 *ray_position,
  769. const D3DXVECTOR3 *ray_direction, WINBOOL *hit, DWORD *face_idx, float *u, float *v, float *distance,
  770. ID3DXBuffer **hits, DWORD *hit_count);
  771. WINBOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *vtx0, const D3DXVECTOR3 *vtx1,
  772. const D3DXVECTOR3 *vtx2, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, FLOAT *u,
  773. FLOAT *v, FLOAT *dist);
  774. HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT face_count,
  775. UINT vertex_count, WINBOOL idx_32bit, DWORD *face_remap);
  776. HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT face_count,
  777. UINT vertex_count, WINBOOL idx_32bit, DWORD *vertex_remap);
  778. HRESULT WINAPI D3DXRectPatchSize(const FLOAT *segment_count, DWORD *num_triangles,
  779. DWORD *num_vertices);
  780. HRESULT WINAPI D3DXSHPRTCompSuperCluster(UINT *cluster_ids, ID3DXMesh *scene, UINT max_cluster_count,
  781. UINT cluster_count, UINT *scluster_ids, UINT *scluster_count);
  782. HRESULT WINAPI D3DXSHPRTCompSplitMeshSC(UINT *cluster_idx, UINT vertex_count, UINT cluster_count, UINT *scluster_ids,
  783. UINT scluster_count, void *index_buffer_in, WINBOOL ib_in_32bit, UINT face_count, ID3DXBuffer **index_buffer_out,
  784. UINT *index_buffer_size, WINBOOL ib_out_32bit, ID3DXBuffer **face_remap, ID3DXBuffer **vertex_data,
  785. UINT *vertex_data_length, UINT *sc_cluster_list, D3DXSHPRTSPLITMESHCLUSTERDATA *sc_data);
  786. HRESULT WINAPI D3DXSimplifyMesh(ID3DXMesh *mesh_in, const DWORD *adjacency,
  787. const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, DWORD min_value,
  788. DWORD flags, ID3DXMesh **mesh_out);
  789. HRESULT WINAPI D3DXSplitMesh(ID3DXMesh *mesh_in, const DWORD *adjacency_in, const DWORD max_size,
  790. const DWORD flags, DWORD *mesh_out_count, ID3DXBuffer **mesh_out, ID3DXBuffer **adjacency_out,
  791. ID3DXBuffer **face_remap_out, ID3DXBuffer **vertex_remap_out);
  792. HRESULT WINAPI D3DXTessellateNPatches(ID3DXMesh *mesh_in, const DWORD *adjacency_in, float segment_count,
  793. WINBOOL quad_interp, ID3DXMesh **mesh_out, ID3DXBuffer **adjacency_out);
  794. HRESULT WINAPI D3DXTessellateRectPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count,
  795. const D3DVERTEXELEMENT9 *declaration, const D3DRECTPATCH_INFO *patch_info, struct ID3DXMesh *mesh);
  796. HRESULT WINAPI D3DXTessellateTriPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count,
  797. const D3DVERTEXELEMENT9 *declaration, const D3DTRIPATCH_INFO *patch_info, struct ID3DXMesh *mesh);
  798. HRESULT WINAPI D3DXTriPatchSize(const FLOAT *segment_count, DWORD *num_triangles,
  799. DWORD *num_vertices);
  800. HRESULT WINAPI D3DXUVAtlasCreate(ID3DXMesh *mesh_in, UINT max_chart_count, float max_stretch_in,
  801. UINT width, UINT height, float gutter, DWORD texture_idx, const DWORD *adjacency, const DWORD *false_edges,
  802. const float *imt_array, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXMesh **mesh_out,
  803. ID3DXBuffer **face_partitioning_out, ID3DXBuffer **vertex_remap_out, float *max_stretch_out, UINT *chart_count);
  804. HRESULT WINAPI D3DXUVAtlasPack(ID3DXMesh *mesh, UINT width, UINT height, float gutter, DWORD texture_idx,
  805. const DWORD *partition_result_adjacency, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags,
  806. ID3DXBuffer *face_partitioning);
  807. HRESULT WINAPI D3DXUVAtlasPartition(ID3DXMesh *mesh_in, UINT max_chart_count, float max_stretch_in,
  808. DWORD texture_idx, const DWORD *adjacency, const DWORD *false_edges, const float *imt_array,
  809. LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXMesh **mesh_out,
  810. ID3DXBuffer **face_partitioning_out, ID3DXBuffer **vertex_remap_out, ID3DXBuffer **adjacency_out,
  811. float *max_stretch_out, UINT *chart_count);
  812. HRESULT WINAPI D3DXValidMesh(ID3DXMesh *mesh, const DWORD *adjacency, ID3DXBuffer **errors);
  813. HRESULT WINAPI D3DXValidPatchMesh(ID3DXPatchMesh *mesh, DWORD *degenerate_vertex_count,
  814. DWORD *degenerate_patch_count, ID3DXBuffer **errors);
  815. HRESULT WINAPI D3DXWeldVertices(ID3DXMesh *mesh, DWORD flags, const D3DXWELDEPSILONS *epsilons,
  816. const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out);
  817. #ifdef __cplusplus
  818. }
  819. #endif
  820. DEFINE_GUID(DXFILEOBJ_XSkinMeshHeader, 0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2);
  821. DEFINE_GUID(DXFILEOBJ_VertexDuplicationIndices, 0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3);
  822. DEFINE_GUID(DXFILEOBJ_FaceAdjacency, 0xa64c844a, 0xe282, 0x4756, 0x8b, 0x80, 0x25, 0x0c, 0xde, 0x04, 0x39, 0x8c);
  823. DEFINE_GUID(DXFILEOBJ_SkinWeights, 0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb);
  824. DEFINE_GUID(DXFILEOBJ_Patch, 0xa3eb5d44, 0xfc22, 0x429d, 0x9a, 0xfb, 0x32, 0x21, 0xcb, 0x97, 0x19, 0xa6);
  825. DEFINE_GUID(DXFILEOBJ_PatchMesh, 0xd02c95cc, 0xedba, 0x4305, 0x9b, 0x5d, 0x18, 0x20, 0xd7, 0x70, 0x4d, 0xbf);
  826. DEFINE_GUID(DXFILEOBJ_PatchMesh9, 0xb9ec94e1, 0xb9a6, 0x4251, 0xba, 0x18, 0x94, 0x89, 0x3f, 0x02, 0xc0, 0xea);
  827. DEFINE_GUID(DXFILEOBJ_PMInfo, 0xb6c3e656, 0xec8b, 0x4b92, 0x9b, 0x62, 0x68, 0x16, 0x59, 0x52, 0x29, 0x47);
  828. DEFINE_GUID(DXFILEOBJ_PMAttributeRange, 0x917e0427, 0xc61e, 0x4a14, 0x9c, 0x64, 0xaf, 0xe6, 0x5f, 0x9e, 0x98, 0x44);
  829. DEFINE_GUID(DXFILEOBJ_PMVSplitRecord, 0x574ccc14, 0xf0b3, 0x4333, 0x82, 0x2d, 0x93, 0xe8, 0xa8, 0xa0, 0x8e, 0x4c);
  830. DEFINE_GUID(DXFILEOBJ_FVFData, 0xb6e70a0e, 0x8ef9, 0x4e83, 0x94, 0xad, 0xec, 0xc8, 0xb0, 0xc0, 0x48, 0x97);
  831. DEFINE_GUID(DXFILEOBJ_VertexElement, 0xf752461c, 0x1e23, 0x48f6, 0xb9, 0xf8, 0x83, 0x50, 0x85, 0x0f, 0x33, 0x6f);
  832. DEFINE_GUID(DXFILEOBJ_DeclData, 0xbf22e553, 0x292c, 0x4781, 0x9f, 0xea, 0x62, 0xbd, 0x55, 0x4b, 0xdd, 0x93);
  833. DEFINE_GUID(DXFILEOBJ_EffectFloats, 0xf1cfe2b3, 0x0de3, 0x4e28, 0xaf, 0xa1, 0x15, 0x5a, 0x75, 0x0a, 0x28, 0x2d);
  834. DEFINE_GUID(DXFILEOBJ_EffectString, 0xd55b097e, 0xbdb6, 0x4c52, 0xb0, 0x3d, 0x60, 0x51, 0xc8, 0x9d, 0x0e, 0x42);
  835. DEFINE_GUID(DXFILEOBJ_EffectDWord, 0x622c0ed0, 0x956e, 0x4da9, 0x90, 0x8a, 0x2a, 0xf9, 0x4f, 0x3c, 0xe7, 0x16);
  836. DEFINE_GUID(DXFILEOBJ_EffectParamFloats, 0x3014b9a0, 0x62f5, 0x478c, 0x9b, 0x86, 0xe4, 0xac, 0x9f, 0x4e, 0x41, 0x8b);
  837. DEFINE_GUID(DXFILEOBJ_EffectParamString, 0x1dbc4c88, 0x94c1, 0x46ee, 0x90, 0x76, 0x2c, 0x28, 0x81, 0x8c, 0x94, 0x81);
  838. DEFINE_GUID(DXFILEOBJ_EffectParamDWord, 0xe13963bc, 0xae51, 0x4c5d, 0xb0, 0x0f, 0xcf, 0xa3, 0xa9, 0xd9, 0x7c, 0xe5);
  839. DEFINE_GUID(DXFILEOBJ_EffectInstance, 0xe331f7e4, 0x0559, 0x4cc2, 0x8e, 0x99, 0x1c, 0xec, 0x16, 0x57, 0x92, 0x8f);
  840. DEFINE_GUID(DXFILEOBJ_AnimTicksPerSecond, 0x9e415a43, 0x7ba6, 0x4a73, 0x87, 0x43, 0xb7, 0x3d, 0x47, 0xe8, 0x84, 0x76);
  841. DEFINE_GUID(DXFILEOBJ_CompressedAnimationSet, 0x7f9b00b3, 0xf125, 0x4890, 0x87, 0x6e, 0x1c, 0x42, 0xbf, 0x69, 0x7c, 0x4d);
  842. #define XSKINEXP_TEMPLATES \
  843. "xof 0303txt 0032\
  844. template XSkinMeshHeader \
  845. { \
  846. <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \
  847. WORD nMaxSkinWeightsPerVertex; \
  848. WORD nMaxSkinWeightsPerFace; \
  849. WORD nBones; \
  850. } \
  851. template VertexDuplicationIndices \
  852. { \
  853. <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \
  854. DWORD nIndices; \
  855. DWORD nOriginalVertices; \
  856. array DWORD indices[nIndices]; \
  857. } \
  858. template FaceAdjacency \
  859. { \
  860. <A64C844A-E282-4756-8B80-250CDE04398C> \
  861. DWORD nIndices; \
  862. array DWORD indices[nIndices]; \
  863. } \
  864. template SkinWeights \
  865. { \
  866. <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \
  867. STRING transformNodeName; \
  868. DWORD nWeights; \
  869. array DWORD vertexIndices[nWeights]; \
  870. array float weights[nWeights]; \
  871. Matrix4x4 matrixOffset; \
  872. } \
  873. template Patch \
  874. { \
  875. <A3EB5D44-FC22-429D-9AFB-3221CB9719A6> \
  876. DWORD nControlIndices; \
  877. array DWORD controlIndices[nControlIndices]; \
  878. } \
  879. template PatchMesh \
  880. { \
  881. <D02C95CC-EDBA-4305-9B5D-1820D7704BBF> \
  882. DWORD nVertices; \
  883. array Vector vertices[nVertices]; \
  884. DWORD nPatches; \
  885. array Patch patches[nPatches]; \
  886. [ ... ] \
  887. } \
  888. template PatchMesh9 \
  889. { \
  890. <B9EC94E1-B9A6-4251-BA18-94893F02C0EA> \
  891. DWORD Type; \
  892. DWORD Degree; \
  893. DWORD Basis; \
  894. DWORD nVertices; \
  895. array Vector vertices[nVertices]; \
  896. DWORD nPatches; \
  897. array Patch patches[nPatches]; \
  898. [ ... ] \
  899. } template EffectFloats \
  900. { \
  901. <F1CFE2B3-0DE3-4e28-AFA1-155A750A282D> \
  902. DWORD nFloats; \
  903. array float Floats[nFloats]; \
  904. } \
  905. template EffectString \
  906. { \
  907. <D55B097E-BDB6-4c52-B03D-6051C89D0E42> \
  908. STRING Value; \
  909. } \
  910. template EffectDWord \
  911. { \
  912. <622C0ED0-956E-4da9-908A-2AF94F3CE716> \
  913. DWORD Value; \
  914. } template EffectParamFloats \
  915. { \
  916. <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \
  917. STRING ParamName; \
  918. DWORD nFloats; \
  919. array float Floats[nFloats]; \
  920. } template EffectParamString \
  921. { \
  922. <1DBC4C88-94C1-46ee-9076-2C28818C9481> \
  923. STRING ParamName; \
  924. STRING Value; \
  925. } \
  926. template EffectParamDWord \
  927. { \
  928. <E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5> \
  929. STRING ParamName; \
  930. DWORD Value; \
  931. } \
  932. template EffectInstance \
  933. { \
  934. <E331F7E4-0559-4cc2-8E99-1CEC1657928F> \
  935. STRING EffectFilename; \
  936. [ ... ] \
  937. } template AnimTicksPerSecond \
  938. { \
  939. <9E415A43-7BA6-4a73-8743-B73D47E88476> \
  940. DWORD AnimTicksPerSecond; \
  941. } \
  942. template CompressedAnimationSet \
  943. { \
  944. <7F9B00B3-F125-4890-876E-1C42BF697C4D> \
  945. DWORD CompressedBlockSize; \
  946. FLOAT TicksPerSec; \
  947. DWORD PlaybackType; \
  948. DWORD BufferLength; \
  949. array DWORD CompressedData[BufferLength]; \
  950. } "
  951. #define XEXTENSIONS_TEMPLATES \
  952. "xof 0303txt 0032\
  953. template FVFData \
  954. { \
  955. <B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897> \
  956. DWORD dwFVF; \
  957. DWORD nDWords; \
  958. array DWORD data[nDWords]; \
  959. } \
  960. template VertexElement \
  961. { \
  962. <F752461C-1E23-48f6-B9F8-8350850F336F> \
  963. DWORD Type; \
  964. DWORD Method; \
  965. DWORD Usage; \
  966. DWORD UsageIndex; \
  967. } \
  968. template DeclData \
  969. { \
  970. <BF22E553-292C-4781-9FEA-62BD554BDD93> \
  971. DWORD nElements; \
  972. array VertexElement Elements[nElements]; \
  973. DWORD nDWords; \
  974. array DWORD data[nDWords]; \
  975. } \
  976. template PMAttributeRange \
  977. { \
  978. <917E0427-C61E-4a14-9C64-AFE65F9E9844> \
  979. DWORD iFaceOffset; \
  980. DWORD nFacesMin; \
  981. DWORD nFacesMax; \
  982. DWORD iVertexOffset; \
  983. DWORD nVerticesMin; \
  984. DWORD nVerticesMax; \
  985. } \
  986. template PMVSplitRecord \
  987. { \
  988. <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \
  989. DWORD iFaceCLW; \
  990. DWORD iVlrOffset; \
  991. DWORD iCode; \
  992. } \
  993. template PMInfo \
  994. { \
  995. <B6C3E656-EC8B-4b92-9B62-681659522947> \
  996. DWORD nAttributes; \
  997. array PMAttributeRange attributeRanges[nAttributes]; \
  998. DWORD nMaxValence; \
  999. DWORD nMinLogicalVertices; \
  1000. DWORD nMaxLogicalVertices; \
  1001. DWORD nVSplits; \
  1002. array PMVSplitRecord splitRecords[nVSplits]; \
  1003. DWORD nAttributeMispredicts; \
  1004. array DWORD attributeMispredicts[nAttributeMispredicts]; \
  1005. } "
  1006. #endif /* __WINE_D3DX9MESH_H */