2 * Copyright 2010 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __D3DX9EFFECT_H__
22 #define __D3DX9EFFECT_H__
24 #define D3DXFX_DONOTSAVESTATE (1 << 0)
25 #define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
26 #define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
27 #define D3DXFX_NOT_CLONEABLE (1 << 11)
28 #define D3DXFX_LARGEADDRESSAWARE (1 << 17)
30 #define D3DX_PARAMETER_SHARED 1
31 #define D3DX_PARAMETER_LITERAL 2
32 #define D3DX_PARAMETER_ANNOTATION 4
34 typedef struct _D3DXEFFECT_DESC
{
41 typedef struct _D3DXPARAMETER_DESC
{
44 D3DXPARAMETER_CLASS Class
;
45 D3DXPARAMETER_TYPE Type
;
55 typedef struct _D3DXTECHNIQUE_DESC
{
61 typedef struct _D3DXPASS_DESC
{
64 CONST DWORD
*pVertexShaderFunction
;
65 CONST DWORD
*pPixelShaderFunction
;
68 typedef struct _D3DXFUNCTION_DESC
{
73 typedef struct ID3DXEffectPool
*LPD3DXEFFECTPOOL
;
75 DEFINE_GUID(IID_ID3DXEffectPool
, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
78 #define INTERFACE ID3DXEffectPool
80 DECLARE_INTERFACE_(ID3DXEffectPool
, IUnknown
)
82 /*** IUnknown methods ***/
83 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* object
) PURE
;
84 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
85 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
89 typedef struct ID3DXBaseEffect
*LPD3DXBASEEFFECT
;
91 DEFINE_GUID(IID_ID3DXBaseEffect
, 0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
93 #define INTERFACE ID3DXBaseEffect
95 DECLARE_INTERFACE_(ID3DXBaseEffect
, IUnknown
)
97 /*** IUnknown methods ***/
98 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* object
) PURE
;
99 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
100 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
101 /*** ID3DXBaseEffect methods ***/
102 STDMETHOD(GetDesc
)(THIS_ D3DXEFFECT_DESC
* desc
) PURE
;
103 STDMETHOD(GetParameterDesc
)(THIS_ D3DXHANDLE parameter
, D3DXPARAMETER_DESC
* desc
) PURE
;
104 STDMETHOD(GetTechniqueDesc
)(THIS_ D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
* desc
) PURE
;
105 STDMETHOD(GetPassDesc
)(THIS_ D3DXHANDLE pass
, D3DXPASS_DESC
* desc
) PURE
;
106 STDMETHOD(GetFunctionDesc
)(THIS_ D3DXHANDLE shader
, D3DXFUNCTION_DESC
* desc
) PURE
;
107 STDMETHOD_(D3DXHANDLE
, GetParameter
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
108 STDMETHOD_(D3DXHANDLE
, GetParameterByName
)(THIS_ D3DXHANDLE parameter
, LPCSTR name
) PURE
;
109 STDMETHOD_(D3DXHANDLE
, GetParameterBySemantic
)(THIS_ D3DXHANDLE parameter
, LPCSTR semantic
) PURE
;
110 STDMETHOD_(D3DXHANDLE
, GetParameterElement
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
111 STDMETHOD_(D3DXHANDLE
, GetTechnique
)(THIS_ UINT index
) PURE
;
112 STDMETHOD_(D3DXHANDLE
, GetTechniqueByName
)(THIS_ LPCSTR name
) PURE
;
113 STDMETHOD_(D3DXHANDLE
, GetPass
)(THIS_ D3DXHANDLE technique
, UINT index
) PURE
;
114 STDMETHOD_(D3DXHANDLE
, GetPassByName
)(THIS_ D3DXHANDLE technique
, LPCSTR name
) PURE
;
115 STDMETHOD_(D3DXHANDLE
, GetFunction
)(THIS_ UINT index
);
116 STDMETHOD_(D3DXHANDLE
, GetFunctionByName
)(THIS_ LPCSTR name
);
117 STDMETHOD_(D3DXHANDLE
, GetAnnotation
)(THIS_ D3DXHANDLE object
, UINT index
) PURE
;
118 STDMETHOD_(D3DXHANDLE
, GetAnnotationByName
)(THIS_ D3DXHANDLE object
, LPCSTR name
) PURE
;
119 STDMETHOD(SetValue
)(THIS_ D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
) PURE
;
120 STDMETHOD(GetValue
)(THIS_ D3DXHANDLE parameter
, LPVOID data
, UINT bytes
) PURE
;
121 STDMETHOD(SetBool
)(THIS_ D3DXHANDLE parameter
, BOOL b
) PURE
;
122 STDMETHOD(GetBool
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
) PURE
;
123 STDMETHOD(SetBoolArray
)(THIS_ D3DXHANDLE parameter
, CONST BOOL
* b
, UINT count
) PURE
;
124 STDMETHOD(GetBoolArray
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
, UINT count
) PURE
;
125 STDMETHOD(SetInt
)(THIS_ D3DXHANDLE parameter
, INT n
) PURE
;
126 STDMETHOD(GetInt
)(THIS_ D3DXHANDLE parameter
, INT
* n
) PURE
;
127 STDMETHOD(SetIntArray
)(THIS_ D3DXHANDLE parameter
, CONST INT
* n
, UINT count
) PURE
;
128 STDMETHOD(GetIntArray
)(THIS_ D3DXHANDLE parameter
, INT
* n
, UINT count
) PURE
;
129 STDMETHOD(SetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT f
) PURE
;
130 STDMETHOD(GetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
) PURE
;
131 STDMETHOD(SetFloatArray
)(THIS_ D3DXHANDLE parameter
, CONST FLOAT
* f
, UINT count
) PURE
;
132 STDMETHOD(GetFloatArray
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
, UINT count
) PURE
;
133 STDMETHOD(SetVector
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
) PURE
;
134 STDMETHOD(GetVector
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
) PURE
;
135 STDMETHOD(SetVectorArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
, UINT count
) PURE
;
136 STDMETHOD(GetVectorArray
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
, UINT count
) PURE
;
137 STDMETHOD(SetMatrix
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
138 STDMETHOD(GetMatrix
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
139 STDMETHOD(SetMatrixArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
140 STDMETHOD(GetMatrixArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
141 STDMETHOD(SetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
142 STDMETHOD(GetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
143 STDMETHOD(SetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
144 STDMETHOD(GetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
145 STDMETHOD(SetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
146 STDMETHOD(GetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
147 STDMETHOD(SetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
148 STDMETHOD(GetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
149 STDMETHOD(SetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR string
) PURE
;
150 STDMETHOD(GetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR
* string
) PURE
;
151 STDMETHOD(SetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
*texture
) PURE
;
152 STDMETHOD(GetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
**texture
) PURE
;
153 STDMETHOD(GetPixelShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DPixelShader9
**shader
) PURE
;
154 STDMETHOD(GetVertexShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DVertexShader9
**shader
) PURE
;
155 STDMETHOD(SetArrayRange
)(THIS_ D3DXHANDLE parameter
, UINT start
, UINT end
) PURE
;
159 typedef struct ID3DXEffectStateManager
*LPD3DXEFFECTSTATEMANAGER
;
161 DEFINE_GUID(IID_ID3DXEffectStateManager
, 0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
163 #define INTERFACE ID3DXEffectStateManager
165 DECLARE_INTERFACE_(ID3DXEffectStateManager
, IUnknown
)
167 /*** IUnknown methods ***/
168 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* object
) PURE
;
169 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
170 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
171 /*** ID3DXEffectStateManager methods ***/
172 STDMETHOD(SetTransform
)(THIS_ D3DTRANSFORMSTATETYPE state
, CONST D3DMATRIX
* matrix
) PURE
;
173 STDMETHOD(SetMaterial
)(THIS_ CONST D3DMATERIAL9
* material
) PURE
;
174 STDMETHOD(SetLight
)(THIS_ DWORD index
, CONST D3DLIGHT9
* light
) PURE
;
175 STDMETHOD(LightEnable
)(THIS_ DWORD index
, BOOL enable
) PURE
;
176 STDMETHOD(SetRenderState
)(THIS_ D3DRENDERSTATETYPE state
, DWORD value
) PURE
;
177 STDMETHOD(SetTexture
)(THIS_ DWORD stage
, struct IDirect3DBaseTexture9
*texture
) PURE
;
178 STDMETHOD(SetTextureStageState
)(THIS_ DWORD stage
, D3DTEXTURESTAGESTATETYPE type
, DWORD value
) PURE
;
179 STDMETHOD(SetSamplerState
)(THIS_ DWORD sampler
, D3DSAMPLERSTATETYPE type
, DWORD value
) PURE
;
180 STDMETHOD(SetNPatchMode
)(THIS_ FLOAT num_segments
) PURE
;
181 STDMETHOD(SetFVF
)(THIS_ DWORD format
) PURE
;
182 STDMETHOD(SetVertexShader
)(THIS_
struct IDirect3DVertexShader9
*shader
) PURE
;
183 STDMETHOD(SetVertexShaderConstantF
)(THIS_ UINT register_index
, CONST FLOAT
* constant_data
, UINT register_count
) PURE
;
184 STDMETHOD(SetVertexShaderConstantI
)(THIS_ UINT register_index
, CONST INT
* constant_data
, UINT register_count
) PURE
;
185 STDMETHOD(SetVertexShaderConstantB
)(THIS_ UINT register_index
, CONST BOOL
* constant_data
, UINT register_count
) PURE
;
186 STDMETHOD(SetPixelShader
)(THIS_
struct IDirect3DPixelShader9
*shader
) PURE
;
187 STDMETHOD(SetPixelShaderConstantF
)(THIS_ UINT register_index
, CONST FLOAT
* constant_data
, UINT register_count
) PURE
;
188 STDMETHOD(SetPixelShaderConstantI
)(THIS_ UINT register_index
, CONST INT
* constant_data
, UINT register_count
) PURE
;
189 STDMETHOD(SetPixelShaderConstantB
)(THIS_ UINT register_index
, CONST BOOL
* constant_data
, UINT register_count
) PURE
;
193 typedef struct ID3DXEffect
*LPD3DXEFFECT
;
195 DEFINE_GUID(IID_ID3DXEffect
, 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
197 #define INTERFACE ID3DXEffect
199 DECLARE_INTERFACE_(ID3DXEffect
, ID3DXBaseEffect
)
201 /*** IUnknown methods ***/
202 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* object
) PURE
;
203 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
204 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
205 /*** ID3DXBaseEffect methods ***/
206 STDMETHOD(GetDesc
)(THIS_ D3DXEFFECT_DESC
* desc
) PURE
;
207 STDMETHOD(GetParameterDesc
)(THIS_ D3DXHANDLE parameter
, D3DXPARAMETER_DESC
* desc
) PURE
;
208 STDMETHOD(GetTechniqueDesc
)(THIS_ D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
* desc
) PURE
;
209 STDMETHOD(GetPassDesc
)(THIS_ D3DXHANDLE pass
, D3DXPASS_DESC
* desc
) PURE
;
210 STDMETHOD(GetFunctionDesc
)(THIS_ D3DXHANDLE shader
, D3DXFUNCTION_DESC
* desc
) PURE
;
211 STDMETHOD_(D3DXHANDLE
, GetParameter
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
212 STDMETHOD_(D3DXHANDLE
, GetParameterByName
)(THIS_ D3DXHANDLE parameter
, LPCSTR name
) PURE
;
213 STDMETHOD_(D3DXHANDLE
, GetParameterBySemantic
)(THIS_ D3DXHANDLE parameter
, LPCSTR semantic
) PURE
;
214 STDMETHOD_(D3DXHANDLE
, GetParameterElement
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
215 STDMETHOD_(D3DXHANDLE
, GetTechnique
)(THIS_ UINT index
) PURE
;
216 STDMETHOD_(D3DXHANDLE
, GetTechniqueByName
)(THIS_ LPCSTR name
) PURE
;
217 STDMETHOD_(D3DXHANDLE
, GetPass
)(THIS_ D3DXHANDLE technique
, UINT index
) PURE
;
218 STDMETHOD_(D3DXHANDLE
, GetPassByName
)(THIS_ D3DXHANDLE technique
, LPCSTR name
) PURE
;
219 STDMETHOD_(D3DXHANDLE
, GetFunction
)(THIS_ UINT index
);
220 STDMETHOD_(D3DXHANDLE
, GetFunctionByName
)(THIS_ LPCSTR name
);
221 STDMETHOD_(D3DXHANDLE
, GetAnnotation
)(THIS_ D3DXHANDLE object
, UINT index
) PURE
;
222 STDMETHOD_(D3DXHANDLE
, GetAnnotationByName
)(THIS_ D3DXHANDLE object
, LPCSTR name
) PURE
;
223 STDMETHOD(SetValue
)(THIS_ D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
) PURE
;
224 STDMETHOD(GetValue
)(THIS_ D3DXHANDLE parameter
, LPVOID data
, UINT bytes
) PURE
;
225 STDMETHOD(SetBool
)(THIS_ D3DXHANDLE parameter
, BOOL b
) PURE
;
226 STDMETHOD(GetBool
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
) PURE
;
227 STDMETHOD(SetBoolArray
)(THIS_ D3DXHANDLE parameter
, CONST BOOL
* b
, UINT count
) PURE
;
228 STDMETHOD(GetBoolArray
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
, UINT count
) PURE
;
229 STDMETHOD(SetInt
)(THIS_ D3DXHANDLE parameter
, INT n
) PURE
;
230 STDMETHOD(GetInt
)(THIS_ D3DXHANDLE parameter
, INT
* n
) PURE
;
231 STDMETHOD(SetIntArray
)(THIS_ D3DXHANDLE parameter
, CONST INT
* n
, UINT count
) PURE
;
232 STDMETHOD(GetIntArray
)(THIS_ D3DXHANDLE parameter
, INT
* n
, UINT count
) PURE
;
233 STDMETHOD(SetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT f
) PURE
;
234 STDMETHOD(GetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
) PURE
;
235 STDMETHOD(SetFloatArray
)(THIS_ D3DXHANDLE parameter
, CONST FLOAT
* f
, UINT count
) PURE
;
236 STDMETHOD(GetFloatArray
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
, UINT count
) PURE
;
237 STDMETHOD(SetVector
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
) PURE
;
238 STDMETHOD(GetVector
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
) PURE
;
239 STDMETHOD(SetVectorArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
, UINT count
) PURE
;
240 STDMETHOD(GetVectorArray
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
, UINT count
) PURE
;
241 STDMETHOD(SetMatrix
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
242 STDMETHOD(GetMatrix
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
243 STDMETHOD(SetMatrixArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
244 STDMETHOD(GetMatrixArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
245 STDMETHOD(SetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
246 STDMETHOD(GetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
247 STDMETHOD(SetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
248 STDMETHOD(GetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
249 STDMETHOD(SetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
250 STDMETHOD(GetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
251 STDMETHOD(SetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
252 STDMETHOD(GetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
253 STDMETHOD(SetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR string
) PURE
;
254 STDMETHOD(GetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR
* string
) PURE
;
255 STDMETHOD(SetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
*texture
) PURE
;
256 STDMETHOD(GetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
**texture
) PURE
;
257 STDMETHOD(GetPixelShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DPixelShader9
**shader
) PURE
;
258 STDMETHOD(GetVertexShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DVertexShader9
**shader
) PURE
;
259 STDMETHOD(SetArrayRange
)(THIS_ D3DXHANDLE parameter
, UINT start
, UINT end
) PURE
;
260 /*** ID3DXEffect methods ***/
261 STDMETHOD(GetPool
)(THIS_ LPD3DXEFFECTPOOL
* pool
) PURE
;
262 STDMETHOD(SetTechnique
)(THIS_ D3DXHANDLE technique
) PURE
;
263 STDMETHOD_(D3DXHANDLE
, GetCurrentTechnique
)(THIS
) PURE
;
264 STDMETHOD(ValidateTechnique
)(THIS_ D3DXHANDLE technique
) PURE
;
265 STDMETHOD(FindNextValidTechnique
)(THIS_ D3DXHANDLE technique
, D3DXHANDLE
* next_technique
) PURE
;
266 STDMETHOD_(BOOL
, IsParameterUsed
)(THIS_ D3DXHANDLE parameter
, D3DXHANDLE technique
) PURE
;
267 STDMETHOD(Begin
)(THIS_ UINT
*passes
, DWORD flags
) PURE
;
268 STDMETHOD(BeginPass
)(THIS_ UINT pass
) PURE
;
269 STDMETHOD(CommitChanges
)(THIS
) PURE
;
270 STDMETHOD(EndPass
)(THIS
) PURE
;
271 STDMETHOD(End
)(THIS
) PURE
;
272 STDMETHOD(GetDevice
)(THIS_
struct IDirect3DDevice9
**device
) PURE
;
273 STDMETHOD(OnLostDevice
)(THIS
) PURE
;
274 STDMETHOD(OnResetDevice
)(THIS
) PURE
;
275 STDMETHOD(SetStateManager
)(THIS_ LPD3DXEFFECTSTATEMANAGER manager
) PURE
;
276 STDMETHOD(GetStateManager
)(THIS_ LPD3DXEFFECTSTATEMANAGER
* manager
) PURE
;
277 STDMETHOD(BeginParameterBlock
)(THIS
) PURE
;
278 STDMETHOD_(D3DXHANDLE
, EndParameterBlock
)(THIS
) PURE
;
279 STDMETHOD(ApplyParameterBlock
)(THIS_ D3DXHANDLE parameter_block
) PURE
;
280 STDMETHOD(DeleteParameterBlock
)(THIS_ D3DXHANDLE parameter_block
) PURE
;
281 STDMETHOD(CloneEffect
)(THIS_
struct IDirect3DDevice9
*device
, struct ID3DXEffect
**effect
) PURE
;
282 STDMETHOD(SetRawValue
)(THIS_ D3DXHANDLE parameter
, LPCVOID data
, UINT byte_offset
, UINT bytes
) PURE
;
286 typedef struct ID3DXEffectCompiler
*LPD3DXEFFECTCOMPILER
;
288 DEFINE_GUID(IID_ID3DXEffectCompiler
, 0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
290 #define INTERFACE ID3DXEffectCompiler
292 DECLARE_INTERFACE_(ID3DXEffectCompiler
, ID3DXBaseEffect
)
294 /*** IUnknown methods ***/
295 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* object
) PURE
;
296 STDMETHOD_(ULONG
, AddRef
)(THIS
) PURE
;
297 STDMETHOD_(ULONG
, Release
)(THIS
) PURE
;
298 /*** ID3DXBaseEffect methods ***/
299 STDMETHOD(GetDesc
)(THIS_ D3DXEFFECT_DESC
* desc
) PURE
;
300 STDMETHOD(GetParameterDesc
)(THIS_ D3DXHANDLE parameter
, D3DXPARAMETER_DESC
* desc
) PURE
;
301 STDMETHOD(GetTechniqueDesc
)(THIS_ D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
* desc
) PURE
;
302 STDMETHOD(GetPassDesc
)(THIS_ D3DXHANDLE pass
, D3DXPASS_DESC
* desc
) PURE
;
303 STDMETHOD(GetFunctionDesc
)(THIS_ D3DXHANDLE shader
, D3DXFUNCTION_DESC
* desc
) PURE
;
304 STDMETHOD_(D3DXHANDLE
, GetParameter
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
305 STDMETHOD_(D3DXHANDLE
, GetParameterByName
)(THIS_ D3DXHANDLE parameter
, LPCSTR name
) PURE
;
306 STDMETHOD_(D3DXHANDLE
, GetParameterBySemantic
)(THIS_ D3DXHANDLE parameter
, LPCSTR semantic
) PURE
;
307 STDMETHOD_(D3DXHANDLE
, GetParameterElement
)(THIS_ D3DXHANDLE parameter
, UINT index
) PURE
;
308 STDMETHOD_(D3DXHANDLE
, GetTechnique
)(THIS_ UINT index
) PURE
;
309 STDMETHOD_(D3DXHANDLE
, GetTechniqueByName
)(THIS_ LPCSTR name
) PURE
;
310 STDMETHOD_(D3DXHANDLE
, GetPass
)(THIS_ D3DXHANDLE technique
, UINT index
) PURE
;
311 STDMETHOD_(D3DXHANDLE
, GetPassByName
)(THIS_ D3DXHANDLE technique
, LPCSTR name
) PURE
;
312 STDMETHOD_(D3DXHANDLE
, GetFunction
)(THIS_ UINT index
);
313 STDMETHOD_(D3DXHANDLE
, GetFunctionByName
)(THIS_ LPCSTR name
);
314 STDMETHOD_(D3DXHANDLE
, GetAnnotation
)(THIS_ D3DXHANDLE object
, UINT index
) PURE
;
315 STDMETHOD_(D3DXHANDLE
, GetAnnotationByName
)(THIS_ D3DXHANDLE object
, LPCSTR name
) PURE
;
316 STDMETHOD(SetValue
)(THIS_ D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
) PURE
;
317 STDMETHOD(GetValue
)(THIS_ D3DXHANDLE parameter
, LPVOID data
, UINT bytes
) PURE
;
318 STDMETHOD(SetBool
)(THIS_ D3DXHANDLE parameter
, BOOL b
) PURE
;
319 STDMETHOD(GetBool
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
) PURE
;
320 STDMETHOD(SetBoolArray
)(THIS_ D3DXHANDLE parameter
, CONST BOOL
* b
, UINT count
) PURE
;
321 STDMETHOD(GetBoolArray
)(THIS_ D3DXHANDLE parameter
, BOOL
* b
, UINT count
) PURE
;
322 STDMETHOD(SetInt
)(THIS_ D3DXHANDLE parameter
, INT n
) PURE
;
323 STDMETHOD(GetInt
)(THIS_ D3DXHANDLE parameter
, INT
* n
) PURE
;
324 STDMETHOD(SetIntArray
)(THIS_ D3DXHANDLE parameter
, CONST INT
* n
, UINT count
) PURE
;
325 STDMETHOD(GetIntArray
)(THIS_ D3DXHANDLE parameter
, INT
* n
, UINT count
) PURE
;
326 STDMETHOD(SetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT f
) PURE
;
327 STDMETHOD(GetFloat
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
) PURE
;
328 STDMETHOD(SetFloatArray
)(THIS_ D3DXHANDLE parameter
, CONST FLOAT
* f
, UINT count
) PURE
;
329 STDMETHOD(GetFloatArray
)(THIS_ D3DXHANDLE parameter
, FLOAT
* f
, UINT count
) PURE
;
330 STDMETHOD(SetVector
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
) PURE
;
331 STDMETHOD(GetVector
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
) PURE
;
332 STDMETHOD(SetVectorArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
, UINT count
) PURE
;
333 STDMETHOD(GetVectorArray
)(THIS_ D3DXHANDLE parameter
, D3DXVECTOR4
* vector
, UINT count
) PURE
;
334 STDMETHOD(SetMatrix
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
335 STDMETHOD(GetMatrix
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
336 STDMETHOD(SetMatrixArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
337 STDMETHOD(GetMatrixArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
338 STDMETHOD(SetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
339 STDMETHOD(GetMatrixPointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
340 STDMETHOD(SetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
) PURE
;
341 STDMETHOD(GetMatrixTranspose
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
) PURE
;
342 STDMETHOD(SetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
* matrix
, UINT count
) PURE
;
343 STDMETHOD(GetMatrixTransposeArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
* matrix
, UINT count
) PURE
;
344 STDMETHOD(SetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, CONST D3DXMATRIX
** matrix
, UINT count
) PURE
;
345 STDMETHOD(GetMatrixTransposePointerArray
)(THIS_ D3DXHANDLE parameter
, D3DXMATRIX
** matrix
, UINT count
) PURE
;
346 STDMETHOD(SetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR string
) PURE
;
347 STDMETHOD(GetString
)(THIS_ D3DXHANDLE parameter
, LPCSTR
* string
) PURE
;
348 STDMETHOD(SetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
*texture
) PURE
;
349 STDMETHOD(GetTexture
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DBaseTexture9
**texture
) PURE
;
350 STDMETHOD(GetPixelShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DPixelShader9
**shader
) PURE
;
351 STDMETHOD(GetVertexShader
)(THIS_ D3DXHANDLE parameter
, struct IDirect3DVertexShader9
**shader
) PURE
;
352 STDMETHOD(SetArrayRange
)(THIS_ D3DXHANDLE parameter
, UINT start
, UINT end
) PURE
;
353 /*** ID3DXEffectCompiler methods ***/
354 STDMETHOD(SetLiteral
)(THIS_ D3DXHANDLE parameter
, BOOL literal
) PURE
;
355 STDMETHOD(GetLiteral
)(THIS_ D3DXHANDLE parameter
, BOOL
* literal
) PURE
;
356 STDMETHOD(CompileEffect
)(THIS_ DWORD flags
, LPD3DXBUFFER
* effect
, LPD3DXBUFFER
* error_msgs
) PURE
;
357 STDMETHOD(CompileShader
)(THIS_ D3DXHANDLE function
, LPCSTR target
, DWORD flags
, LPD3DXBUFFER
* shader
,
358 LPD3DXBUFFER
* error_msgs
, LPD3DXCONSTANTTABLE
* constant_table
) PURE
;
366 HRESULT WINAPI
D3DXCreateEffectPool(LPD3DXEFFECTPOOL
* pool
);
367 HRESULT WINAPI
D3DXCreateEffect(struct IDirect3DDevice9
*device
, const void *srcdata
, UINT srcdatalen
,
368 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, DWORD flags
,
369 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
370 HRESULT WINAPI
D3DXCreateEffectEx(struct IDirect3DDevice9
*device
, const void *srcdata
, UINT srcdatalen
,
371 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, const char *skip_constants
, DWORD flags
,
372 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
373 HRESULT WINAPI
D3DXCreateEffectCompiler(LPCSTR srcdata
,
375 CONST D3DXMACRO
* defines
,
376 LPD3DXINCLUDE include
,
378 LPD3DXEFFECTCOMPILER
* compiler
,
379 LPD3DXBUFFER
* parse_errors
);
380 HRESULT WINAPI
D3DXCreateEffectFromFileExA(struct IDirect3DDevice9
*device
, const char *srcfile
,
381 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, const char *skip_constants
, DWORD flags
,
382 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
383 HRESULT WINAPI
D3DXCreateEffectFromFileExW(struct IDirect3DDevice9
*device
, const WCHAR
*srcfile
,
384 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, const char *skip_constants
, DWORD flags
,
385 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
386 #define D3DXCreateEffectFromFileEx WINELIB_NAME_AW(D3DXCreateEffectFromFileEx)
388 HRESULT WINAPI
D3DXCreateEffectFromFileA(struct IDirect3DDevice9
*device
, const char *srcfile
,
389 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, DWORD flags
,
390 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
391 HRESULT WINAPI
D3DXCreateEffectFromFileW(struct IDirect3DDevice9
*device
, const WCHAR
*srcfile
,
392 const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, DWORD flags
,
393 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
394 #define D3DXCreateEffectFromFile WINELIB_NAME_AW(D3DXCreateEffectFromFile)
396 HRESULT WINAPI
D3DXCreateEffectFromResourceExA(struct IDirect3DDevice9
*device
, HMODULE srcmodule
,
397 const char *srcresource
, const D3DXMACRO
*defines
, struct ID3DXInclude
*include
,
398 const char *skip_constants
, DWORD flags
, struct ID3DXEffectPool
*pool
,
399 struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
400 HRESULT WINAPI
D3DXCreateEffectFromResourceExW(struct IDirect3DDevice9
*device
, HMODULE srcmodule
,
401 const WCHAR
*srcresource
, const D3DXMACRO
*defines
, struct ID3DXInclude
*include
,
402 const char *skip_constants
, DWORD flags
, struct ID3DXEffectPool
*pool
,
403 struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
404 #define D3DXCreateEffectFromResourceEx WINELIB_NAME_AW(D3DXCreateEffectFromResourceEx)
406 HRESULT WINAPI
D3DXCreateEffectFromResourceA(struct IDirect3DDevice9
*device
, HMODULE srcmodule
,
407 const char *srcresource
, const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, DWORD flags
,
408 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
409 HRESULT WINAPI
D3DXCreateEffectFromResourceW(struct IDirect3DDevice9
*device
, HMODULE srcmodule
,
410 const WCHAR
*srcresource
, const D3DXMACRO
*defines
, struct ID3DXInclude
*include
, DWORD flags
,
411 struct ID3DXEffectPool
*pool
, struct ID3DXEffect
**effect
, struct ID3DXBuffer
**compilation_errors
);
412 #define D3DXCreateEffectFromResource WINELIB_NAME_AW(D3DXCreateEffectFromResource)
414 HRESULT WINAPI
D3DXCreateEffectCompilerFromFileA(LPCSTR srcfile
,
415 const D3DXMACRO
*defines
,
416 LPD3DXINCLUDE include
,
418 LPD3DXEFFECTCOMPILER
*effectcompiler
,
419 LPD3DXBUFFER
*parseerrors
);
420 HRESULT WINAPI
D3DXCreateEffectCompilerFromFileW(LPCWSTR srcfile
,
421 const D3DXMACRO
*defines
,
422 LPD3DXINCLUDE include
,
424 LPD3DXEFFECTCOMPILER
*effectcompiler
,
425 LPD3DXBUFFER
*parseerrors
);
426 #define D3DXCreateEffectCompilerFromFile WINELIB_NAME_AW(D3DXCreateEffectCompilerFromFile)
428 HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceA(HMODULE srcmodule
,
430 const D3DXMACRO
*defines
,
431 LPD3DXINCLUDE include
,
433 LPD3DXEFFECTCOMPILER
*effectcompiler
,
434 LPD3DXBUFFER
*parseerrors
);
435 HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule
,
437 const D3DXMACRO
*defines
,
438 LPD3DXINCLUDE include
,
440 LPD3DXEFFECTCOMPILER
*effectcompiler
,
441 LPD3DXBUFFER
*parseerrors
);
442 #define D3DXCreateEffectCompilerFromResource WINELIB_NAME_AW(D3DXCreateEffectCompilerFromResource)
448 #endif /* __D3DX9EFFECT_H__ */