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