Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

873 lines
40 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: d3dx9effect.h
  6. // Content: D3DX effect types and Shaders
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #include "d3dx9.h"
  10. #ifndef __D3DX9EFFECT_H__
  11. #define __D3DX9EFFECT_H__
  12. //----------------------------------------------------------------------------
  13. // D3DXFX_DONOTSAVESTATE
  14. // This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
  15. // is specified, device state is not saved or restored in Begin/End.
  16. // D3DXFX_DONOTSAVESHADERSTATE
  17. // This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
  18. // is specified, shader device state is not saved or restored in Begin/End.
  19. // This includes pixel/vertex shaders and shader constants
  20. // D3DXFX_DONOTSAVESAMPLERSTATE
  21. // This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
  22. // is specified, sampler device state is not saved or restored in Begin/End.
  23. // D3DXFX_NOT_CLONEABLE
  24. // This flag is used as a parameter to the D3DXCreateEffect family of APIs.
  25. // When this flag is specified, the effect will be non-cloneable and will not
  26. // contain any shader binary data.
  27. // Furthermore, GetPassDesc will not return shader function pointers.
  28. // Setting this flag reduces effect memory usage by about 50%.
  29. //----------------------------------------------------------------------------
  30. #define D3DXFX_DONOTSAVESTATE (1 << 0)
  31. #define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
  32. #define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
  33. #define D3DXFX_NOT_CLONEABLE (1 << 11)
  34. #define D3DXFX_LARGEADDRESSAWARE (1 << 17)
  35. //----------------------------------------------------------------------------
  36. // D3DX_PARAMETER_SHARED
  37. // Indicates that the value of a parameter will be shared with all effects
  38. // which share the same namespace. Changing the value in one effect will
  39. // change it in all.
  40. //
  41. // D3DX_PARAMETER_LITERAL
  42. // Indicates that the value of this parameter can be treated as literal.
  43. // Literal parameters can be marked when the effect is compiled, and their
  44. // cannot be changed after the effect is compiled. Shared parameters cannot
  45. // be literal.
  46. //----------------------------------------------------------------------------
  47. #define D3DX_PARAMETER_SHARED (1 << 0)
  48. #define D3DX_PARAMETER_LITERAL (1 << 1)
  49. #define D3DX_PARAMETER_ANNOTATION (1 << 2)
  50. //----------------------------------------------------------------------------
  51. // D3DXEFFECT_DESC:
  52. //----------------------------------------------------------------------------
  53. typedef struct _D3DXEFFECT_DESC
  54. {
  55. LPCSTR Creator; // Creator string
  56. UINT Parameters; // Number of parameters
  57. UINT Techniques; // Number of techniques
  58. UINT Functions; // Number of function entrypoints
  59. } D3DXEFFECT_DESC;
  60. //----------------------------------------------------------------------------
  61. // D3DXPARAMETER_DESC:
  62. //----------------------------------------------------------------------------
  63. typedef struct _D3DXPARAMETER_DESC
  64. {
  65. LPCSTR Name; // Parameter name
  66. LPCSTR Semantic; // Parameter semantic
  67. D3DXPARAMETER_CLASS Class; // Class
  68. D3DXPARAMETER_TYPE Type; // Component type
  69. UINT Rows; // Number of rows
  70. UINT Columns; // Number of columns
  71. UINT Elements; // Number of array elements
  72. UINT Annotations; // Number of annotations
  73. UINT StructMembers; // Number of structure member sub-parameters
  74. DWORD Flags; // D3DX_PARAMETER_* flags
  75. UINT Bytes; // Parameter size, in bytes
  76. } D3DXPARAMETER_DESC;
  77. //----------------------------------------------------------------------------
  78. // D3DXTECHNIQUE_DESC:
  79. //----------------------------------------------------------------------------
  80. typedef struct _D3DXTECHNIQUE_DESC
  81. {
  82. LPCSTR Name; // Technique name
  83. UINT Passes; // Number of passes
  84. UINT Annotations; // Number of annotations
  85. } D3DXTECHNIQUE_DESC;
  86. //----------------------------------------------------------------------------
  87. // D3DXPASS_DESC:
  88. //----------------------------------------------------------------------------
  89. typedef struct _D3DXPASS_DESC
  90. {
  91. LPCSTR Name; // Pass name
  92. UINT Annotations; // Number of annotations
  93. CONST DWORD *pVertexShaderFunction; // Vertex shader function
  94. CONST DWORD *pPixelShaderFunction; // Pixel shader function
  95. } D3DXPASS_DESC;
  96. //----------------------------------------------------------------------------
  97. // D3DXFUNCTION_DESC:
  98. //----------------------------------------------------------------------------
  99. typedef struct _D3DXFUNCTION_DESC
  100. {
  101. LPCSTR Name; // Function name
  102. UINT Annotations; // Number of annotations
  103. } D3DXFUNCTION_DESC;
  104. //////////////////////////////////////////////////////////////////////////////
  105. // ID3DXEffectPool ///////////////////////////////////////////////////////////
  106. //////////////////////////////////////////////////////////////////////////////
  107. typedef interface ID3DXEffectPool ID3DXEffectPool;
  108. typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL;
  109. // {9537AB04-3250-412e-8213-FCD2F8677933}
  110. DEFINE_GUID(IID_ID3DXEffectPool,
  111. 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
  112. #undef INTERFACE
  113. #define INTERFACE ID3DXEffectPool
  114. DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown)
  115. {
  116. // IUnknown
  117. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  118. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  119. STDMETHOD_(ULONG, Release)(THIS) PURE;
  120. // No public methods
  121. };
  122. //////////////////////////////////////////////////////////////////////////////
  123. // ID3DXBaseEffect ///////////////////////////////////////////////////////////
  124. //////////////////////////////////////////////////////////////////////////////
  125. typedef interface ID3DXBaseEffect ID3DXBaseEffect;
  126. typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT;
  127. // {017C18AC-103F-4417-8C51-6BF6EF1E56BE}
  128. DEFINE_GUID(IID_ID3DXBaseEffect,
  129. 0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
  130. #undef INTERFACE
  131. #define INTERFACE ID3DXBaseEffect
  132. DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
  133. {
  134. // IUnknown
  135. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  136. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  137. STDMETHOD_(ULONG, Release)(THIS) PURE;
  138. // Descs
  139. STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
  140. STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
  141. STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
  142. STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
  143. STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
  144. // Handle operations
  145. STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  146. STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
  147. STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
  148. STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  149. STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
  150. STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
  151. STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
  152. STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
  153. STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
  154. STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
  155. STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
  156. STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
  157. // Get/Set Parameters
  158. STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
  159. STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
  160. STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
  161. STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
  162. STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
  163. STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
  164. STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
  165. STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
  166. STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
  167. STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
  168. STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
  169. STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
  170. STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
  171. STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
  172. STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
  173. STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
  174. STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
  175. STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
  176. STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  177. STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  178. STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  179. STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  180. STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  181. STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  182. STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  183. STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  184. STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  185. STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  186. STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  187. STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  188. STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
  189. STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
  190. STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
  191. STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
  192. STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
  193. STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
  194. //Set Range of an Array to pass to device
  195. //Useful for sending only a subrange of an array down to the device
  196. STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
  197. };
  198. //----------------------------------------------------------------------------
  199. // ID3DXEffectStateManager:
  200. // ------------------------
  201. // This is a user implemented interface that can be used to manage device
  202. // state changes made by an Effect.
  203. //----------------------------------------------------------------------------
  204. typedef interface ID3DXEffectStateManager ID3DXEffectStateManager;
  205. typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER;
  206. // {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE}
  207. DEFINE_GUID(IID_ID3DXEffectStateManager,
  208. 0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
  209. #undef INTERFACE
  210. #define INTERFACE ID3DXEffectStateManager
  211. DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
  212. {
  213. // The user must correctly implement QueryInterface, AddRef, and Release.
  214. // IUnknown
  215. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  216. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  217. STDMETHOD_(ULONG, Release)(THIS) PURE;
  218. // The following methods are called by the Effect when it wants to make
  219. // the corresponding device call. Note that:
  220. // 1. Users manage the state and are therefore responsible for making the
  221. // the corresponding device calls themselves inside their callbacks.
  222. // 2. Effects pay attention to the return values of the callbacks, and so
  223. // users must pay attention to what they return in their callbacks.
  224. STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE;
  225. STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE;
  226. STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE;
  227. STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
  228. STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
  229. STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
  230. STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
  231. STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
  232. STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE;
  233. STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
  234. STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE;
  235. STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
  236. STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
  237. STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
  238. STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE;
  239. STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
  240. STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
  241. STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
  242. };
  243. //////////////////////////////////////////////////////////////////////////////
  244. // ID3DXEffect ///////////////////////////////////////////////////////////////
  245. //////////////////////////////////////////////////////////////////////////////
  246. typedef interface ID3DXEffect ID3DXEffect;
  247. typedef interface ID3DXEffect *LPD3DXEFFECT;
  248. // {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5}
  249. DEFINE_GUID(IID_ID3DXEffect,
  250. 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
  251. #undef INTERFACE
  252. #define INTERFACE ID3DXEffect
  253. DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
  254. {
  255. // ID3DXBaseEffect
  256. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  257. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  258. STDMETHOD_(ULONG, Release)(THIS) PURE;
  259. // Descs
  260. STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
  261. STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
  262. STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
  263. STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
  264. STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
  265. // Handle operations
  266. STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  267. STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
  268. STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
  269. STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  270. STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
  271. STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
  272. STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
  273. STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
  274. STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
  275. STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
  276. STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
  277. STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
  278. // Get/Set Parameters
  279. STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
  280. STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
  281. STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
  282. STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
  283. STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
  284. STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
  285. STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
  286. STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
  287. STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
  288. STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
  289. STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
  290. STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
  291. STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
  292. STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
  293. STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
  294. STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
  295. STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
  296. STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
  297. STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  298. STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  299. STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  300. STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  301. STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  302. STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  303. STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  304. STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  305. STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  306. STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  307. STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  308. STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  309. STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
  310. STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
  311. STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
  312. STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
  313. STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
  314. STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
  315. //Set Range of an Array to pass to device
  316. //Usefull for sending only a subrange of an array down to the device
  317. STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
  318. // ID3DXBaseEffect
  319. // Pool
  320. STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE;
  321. // Selecting and setting a technique
  322. STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
  323. STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE;
  324. STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
  325. STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE;
  326. STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE;
  327. // Using current technique
  328. // Begin starts active technique
  329. // BeginPass begins a pass
  330. // CommitChanges updates changes to any set calls in the pass. This should be called before
  331. // any DrawPrimitive call to d3d
  332. // EndPass ends a pass
  333. // End ends active technique
  334. STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
  335. STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE;
  336. STDMETHOD(CommitChanges)(THIS) PURE;
  337. STDMETHOD(EndPass)(THIS) PURE;
  338. STDMETHOD(End)(THIS) PURE;
  339. // Managing D3D Device
  340. STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
  341. STDMETHOD(OnLostDevice)(THIS) PURE;
  342. STDMETHOD(OnResetDevice)(THIS) PURE;
  343. // Logging device calls
  344. STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE;
  345. STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE;
  346. // Parameter blocks
  347. STDMETHOD(BeginParameterBlock)(THIS) PURE;
  348. STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
  349. STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
  350. STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
  351. // Cloning
  352. STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE;
  353. // Fast path for setting variables directly in ID3DXEffect
  354. STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE;
  355. };
  356. //////////////////////////////////////////////////////////////////////////////
  357. // ID3DXEffectCompiler ///////////////////////////////////////////////////////
  358. //////////////////////////////////////////////////////////////////////////////
  359. typedef interface ID3DXEffectCompiler ID3DXEffectCompiler;
  360. typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
  361. // {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0}
  362. DEFINE_GUID(IID_ID3DXEffectCompiler,
  363. 0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
  364. #undef INTERFACE
  365. #define INTERFACE ID3DXEffectCompiler
  366. DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
  367. {
  368. // ID3DXBaseEffect
  369. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  370. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  371. STDMETHOD_(ULONG, Release)(THIS) PURE;
  372. // Descs
  373. STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
  374. STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
  375. STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
  376. STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
  377. STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
  378. // Handle operations
  379. STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  380. STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
  381. STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
  382. STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
  383. STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
  384. STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
  385. STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
  386. STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
  387. STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
  388. STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
  389. STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
  390. STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
  391. // Get/Set Parameters
  392. STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
  393. STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
  394. STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
  395. STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
  396. STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
  397. STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
  398. STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
  399. STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
  400. STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
  401. STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
  402. STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
  403. STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
  404. STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
  405. STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
  406. STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
  407. STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
  408. STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
  409. STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
  410. STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  411. STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  412. STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  413. STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  414. STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  415. STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  416. STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
  417. STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
  418. STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
  419. STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
  420. STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
  421. STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
  422. STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
  423. STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
  424. STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
  425. STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
  426. STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
  427. STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
  428. //Set Range of an Array to pass to device
  429. //Usefull for sending only a subrange of an array down to the device
  430. STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
  431. // ID3DXBaseEffect
  432. // Parameter sharing, specialization, and information
  433. STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE;
  434. STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE;
  435. // Compilation
  436. STDMETHOD(CompileEffect)(THIS_ DWORD Flags,
  437. LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE;
  438. STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags,
  439. LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE;
  440. };
  441. //////////////////////////////////////////////////////////////////////////////
  442. // APIs //////////////////////////////////////////////////////////////////////
  443. //////////////////////////////////////////////////////////////////////////////
  444. #ifdef __cplusplus
  445. extern "C" {
  446. #endif //__cplusplus
  447. //----------------------------------------------------------------------------
  448. // D3DXCreateEffectPool:
  449. // ---------------------
  450. // Creates an effect pool. Pools are used for sharing parameters between
  451. // multiple effects. For all effects within a pool, shared parameters of the
  452. // same name all share the same value.
  453. //
  454. // Parameters:
  455. // ppPool
  456. // Returns the created pool.
  457. //----------------------------------------------------------------------------
  458. HRESULT WINAPI
  459. D3DXCreateEffectPool(
  460. LPD3DXEFFECTPOOL* ppPool);
  461. //----------------------------------------------------------------------------
  462. // D3DXCreateEffect:
  463. // -----------------
  464. // Creates an effect from an ascii or binary effect description.
  465. //
  466. // Parameters:
  467. // pDevice
  468. // Pointer of the device on which to create the effect
  469. // pSrcFile
  470. // Name of the file containing the effect description
  471. // hSrcModule
  472. // Module handle. if NULL, current module will be used.
  473. // pSrcResource
  474. // Resource name in module
  475. // pSrcData
  476. // Pointer to effect description
  477. // SrcDataSize
  478. // Size of the effect description in bytes
  479. // pDefines
  480. // Optional NULL-terminated array of preprocessor macro definitions.
  481. // Flags
  482. // See D3DXSHADER_xxx flags.
  483. // pSkipConstants
  484. // A list of semi-colon delimited variable names. The effect will
  485. // not set these variables to the device when they are referenced
  486. // by a shader. NOTE: the variables specified here must be
  487. // register bound in the file and must not be used in expressions
  488. // in passes or samplers or the file will not load.
  489. // pInclude
  490. // Optional interface pointer to use for handling #include directives.
  491. // If this parameter is NULL, #includes will be honored when compiling
  492. // from file, and will error when compiling from resource or memory.
  493. // pPool
  494. // Pointer to ID3DXEffectPool object to use for shared parameters.
  495. // If NULL, no parameters will be shared.
  496. // ppEffect
  497. // Returns a buffer containing created effect.
  498. // ppCompilationErrors
  499. // Returns a buffer containing any error messages which occurred during
  500. // compile. Or NULL if you do not care about the error messages.
  501. //
  502. //----------------------------------------------------------------------------
  503. HRESULT WINAPI
  504. D3DXCreateEffectFromFileA(
  505. LPDIRECT3DDEVICE9 pDevice,
  506. LPCSTR pSrcFile,
  507. CONST D3DXMACRO* pDefines,
  508. LPD3DXINCLUDE pInclude,
  509. DWORD Flags,
  510. LPD3DXEFFECTPOOL pPool,
  511. LPD3DXEFFECT* ppEffect,
  512. LPD3DXBUFFER* ppCompilationErrors);
  513. HRESULT WINAPI
  514. D3DXCreateEffectFromFileW(
  515. LPDIRECT3DDEVICE9 pDevice,
  516. LPCWSTR pSrcFile,
  517. CONST D3DXMACRO* pDefines,
  518. LPD3DXINCLUDE pInclude,
  519. DWORD Flags,
  520. LPD3DXEFFECTPOOL pPool,
  521. LPD3DXEFFECT* ppEffect,
  522. LPD3DXBUFFER* ppCompilationErrors);
  523. #ifdef UNICODE
  524. #define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
  525. #else
  526. #define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
  527. #endif
  528. HRESULT WINAPI
  529. D3DXCreateEffectFromResourceA(
  530. LPDIRECT3DDEVICE9 pDevice,
  531. HMODULE hSrcModule,
  532. LPCSTR pSrcResource,
  533. CONST D3DXMACRO* pDefines,
  534. LPD3DXINCLUDE pInclude,
  535. DWORD Flags,
  536. LPD3DXEFFECTPOOL pPool,
  537. LPD3DXEFFECT* ppEffect,
  538. LPD3DXBUFFER* ppCompilationErrors);
  539. HRESULT WINAPI
  540. D3DXCreateEffectFromResourceW(
  541. LPDIRECT3DDEVICE9 pDevice,
  542. HMODULE hSrcModule,
  543. LPCWSTR pSrcResource,
  544. CONST D3DXMACRO* pDefines,
  545. LPD3DXINCLUDE pInclude,
  546. DWORD Flags,
  547. LPD3DXEFFECTPOOL pPool,
  548. LPD3DXEFFECT* ppEffect,
  549. LPD3DXBUFFER* ppCompilationErrors);
  550. #ifdef UNICODE
  551. #define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
  552. #else
  553. #define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
  554. #endif
  555. HRESULT WINAPI
  556. D3DXCreateEffect(
  557. LPDIRECT3DDEVICE9 pDevice,
  558. LPCVOID pSrcData,
  559. UINT SrcDataLen,
  560. CONST D3DXMACRO* pDefines,
  561. LPD3DXINCLUDE pInclude,
  562. DWORD Flags,
  563. LPD3DXEFFECTPOOL pPool,
  564. LPD3DXEFFECT* ppEffect,
  565. LPD3DXBUFFER* ppCompilationErrors);
  566. //
  567. // Ex functions that accept pSkipConstants in addition to other parameters
  568. //
  569. HRESULT WINAPI
  570. D3DXCreateEffectFromFileExA(
  571. LPDIRECT3DDEVICE9 pDevice,
  572. LPCSTR pSrcFile,
  573. CONST D3DXMACRO* pDefines,
  574. LPD3DXINCLUDE pInclude,
  575. LPCSTR pSkipConstants,
  576. DWORD Flags,
  577. LPD3DXEFFECTPOOL pPool,
  578. LPD3DXEFFECT* ppEffect,
  579. LPD3DXBUFFER* ppCompilationErrors);
  580. HRESULT WINAPI
  581. D3DXCreateEffectFromFileExW(
  582. LPDIRECT3DDEVICE9 pDevice,
  583. LPCWSTR pSrcFile,
  584. CONST D3DXMACRO* pDefines,
  585. LPD3DXINCLUDE pInclude,
  586. LPCSTR pSkipConstants,
  587. DWORD Flags,
  588. LPD3DXEFFECTPOOL pPool,
  589. LPD3DXEFFECT* ppEffect,
  590. LPD3DXBUFFER* ppCompilationErrors);
  591. #ifdef UNICODE
  592. #define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW
  593. #else
  594. #define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA
  595. #endif
  596. HRESULT WINAPI
  597. D3DXCreateEffectFromResourceExA(
  598. LPDIRECT3DDEVICE9 pDevice,
  599. HMODULE hSrcModule,
  600. LPCSTR pSrcResource,
  601. CONST D3DXMACRO* pDefines,
  602. LPD3DXINCLUDE pInclude,
  603. LPCSTR pSkipConstants,
  604. DWORD Flags,
  605. LPD3DXEFFECTPOOL pPool,
  606. LPD3DXEFFECT* ppEffect,
  607. LPD3DXBUFFER* ppCompilationErrors);
  608. HRESULT WINAPI
  609. D3DXCreateEffectFromResourceExW(
  610. LPDIRECT3DDEVICE9 pDevice,
  611. HMODULE hSrcModule,
  612. LPCWSTR pSrcResource,
  613. CONST D3DXMACRO* pDefines,
  614. LPD3DXINCLUDE pInclude,
  615. LPCSTR pSkipConstants,
  616. DWORD Flags,
  617. LPD3DXEFFECTPOOL pPool,
  618. LPD3DXEFFECT* ppEffect,
  619. LPD3DXBUFFER* ppCompilationErrors);
  620. #ifdef UNICODE
  621. #define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW
  622. #else
  623. #define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA
  624. #endif
  625. HRESULT WINAPI
  626. D3DXCreateEffectEx(
  627. LPDIRECT3DDEVICE9 pDevice,
  628. LPCVOID pSrcData,
  629. UINT SrcDataLen,
  630. CONST D3DXMACRO* pDefines,
  631. LPD3DXINCLUDE pInclude,
  632. LPCSTR pSkipConstants,
  633. DWORD Flags,
  634. LPD3DXEFFECTPOOL pPool,
  635. LPD3DXEFFECT* ppEffect,
  636. LPD3DXBUFFER* ppCompilationErrors);
  637. //----------------------------------------------------------------------------
  638. // D3DXCreateEffectCompiler:
  639. // -------------------------
  640. // Creates an effect from an ascii or binary effect description.
  641. //
  642. // Parameters:
  643. // pSrcFile
  644. // Name of the file containing the effect description
  645. // hSrcModule
  646. // Module handle. if NULL, current module will be used.
  647. // pSrcResource
  648. // Resource name in module
  649. // pSrcData
  650. // Pointer to effect description
  651. // SrcDataSize
  652. // Size of the effect description in bytes
  653. // pDefines
  654. // Optional NULL-terminated array of preprocessor macro definitions.
  655. // pInclude
  656. // Optional interface pointer to use for handling #include directives.
  657. // If this parameter is NULL, #includes will be honored when compiling
  658. // from file, and will error when compiling from resource or memory.
  659. // pPool
  660. // Pointer to ID3DXEffectPool object to use for shared parameters.
  661. // If NULL, no parameters will be shared.
  662. // ppCompiler
  663. // Returns a buffer containing created effect compiler.
  664. // ppParseErrors
  665. // Returns a buffer containing any error messages which occurred during
  666. // parse. Or NULL if you do not care about the error messages.
  667. //
  668. //----------------------------------------------------------------------------
  669. HRESULT WINAPI
  670. D3DXCreateEffectCompilerFromFileA(
  671. LPCSTR pSrcFile,
  672. CONST D3DXMACRO* pDefines,
  673. LPD3DXINCLUDE pInclude,
  674. DWORD Flags,
  675. LPD3DXEFFECTCOMPILER* ppCompiler,
  676. LPD3DXBUFFER* ppParseErrors);
  677. HRESULT WINAPI
  678. D3DXCreateEffectCompilerFromFileW(
  679. LPCWSTR pSrcFile,
  680. CONST D3DXMACRO* pDefines,
  681. LPD3DXINCLUDE pInclude,
  682. DWORD Flags,
  683. LPD3DXEFFECTCOMPILER* ppCompiler,
  684. LPD3DXBUFFER* ppParseErrors);
  685. #ifdef UNICODE
  686. #define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW
  687. #else
  688. #define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA
  689. #endif
  690. HRESULT WINAPI
  691. D3DXCreateEffectCompilerFromResourceA(
  692. HMODULE hSrcModule,
  693. LPCSTR pSrcResource,
  694. CONST D3DXMACRO* pDefines,
  695. LPD3DXINCLUDE pInclude,
  696. DWORD Flags,
  697. LPD3DXEFFECTCOMPILER* ppCompiler,
  698. LPD3DXBUFFER* ppParseErrors);
  699. HRESULT WINAPI
  700. D3DXCreateEffectCompilerFromResourceW(
  701. HMODULE hSrcModule,
  702. LPCWSTR pSrcResource,
  703. CONST D3DXMACRO* pDefines,
  704. LPD3DXINCLUDE pInclude,
  705. DWORD Flags,
  706. LPD3DXEFFECTCOMPILER* ppCompiler,
  707. LPD3DXBUFFER* ppParseErrors);
  708. #ifdef UNICODE
  709. #define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW
  710. #else
  711. #define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA
  712. #endif
  713. HRESULT WINAPI
  714. D3DXCreateEffectCompiler(
  715. LPCSTR pSrcData,
  716. UINT SrcDataLen,
  717. CONST D3DXMACRO* pDefines,
  718. LPD3DXINCLUDE pInclude,
  719. DWORD Flags,
  720. LPD3DXEFFECTCOMPILER* ppCompiler,
  721. LPD3DXBUFFER* ppParseErrors);
  722. //----------------------------------------------------------------------------
  723. // D3DXDisassembleEffect:
  724. // -----------------------
  725. //
  726. // Parameters:
  727. //----------------------------------------------------------------------------
  728. HRESULT WINAPI
  729. D3DXDisassembleEffect(
  730. LPD3DXEFFECT pEffect,
  731. BOOL EnableColorCode,
  732. LPD3DXBUFFER *ppDisassembly);
  733. #ifdef __cplusplus
  734. }
  735. #endif //__cplusplus
  736. #endif //__D3DX9EFFECT_H__