2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
30 public interface struct IEffectStateManager
\r
32 virtual void EnableLight( int index, bool enable ) = 0;
\r
33 virtual void SetFVF( VertexFormat fvf ) = 0;
\r
34 virtual void SetLight( int index, Light light ) = 0;
\r
35 virtual void SetMaterial( Material material ) = 0;
\r
36 virtual void SetNPatchMode( float segments ) = 0;
\r
37 virtual void SetTransform( TransformState state, Matrix value ) = 0;
\r
39 virtual void SetPixelShader( PixelShader^ pixelShader ) = 0;
\r
40 virtual void SetPixelShaderConstant( int startRegister, array<bool>^ data ) = 0;
\r
41 virtual void SetPixelShaderConstant( int startRegister, array<float>^ data ) = 0;
\r
42 virtual void SetPixelShaderConstant( int startRegister, array<int>^ data ) = 0;
\r
44 virtual void SetVertexShader( VertexShader^ vertexShader ) = 0;
\r
45 virtual void SetVertexShaderConstant( int startRegister, array<bool>^ data ) = 0;
\r
46 virtual void SetVertexShaderConstant( int startRegister, array<float>^ data ) = 0;
\r
47 virtual void SetVertexShaderConstant( int startRegister, array<int>^ data ) = 0;
\r
49 virtual void SetRenderState( RenderState state, int value ) = 0;
\r
50 virtual void SetSamplerState( int sampler, SamplerState type, int value ) = 0;
\r
51 virtual void SetTexture( int sampler, BaseTexture^ texture ) = 0;
\r
52 virtual void SetTextureStageState( int stage, TextureStage type, int value ) = 0;
\r
55 class IEffectStateManagerShim : public ID3DXEffectStateManager
\r
59 gcroot<IEffectStateManager^> m_WrappedInterface;
\r
60 gcroot<Effect^> m_Effect;
\r
63 IEffectStateManagerShim( IEffectStateManager^ wrappedInterface, Effect^ effect );
\r
65 IEffectStateManager^ GetManager() { return m_WrappedInterface; }
\r
67 HRESULT WINAPI QueryInterface( const IID &iid, LPVOID *ppv );
\r
68 ULONG WINAPI AddRef();
\r
69 ULONG WINAPI Release();
\r
71 HRESULT WINAPI LightEnable( DWORD Index, BOOL Enable );
\r
72 HRESULT WINAPI SetFVF( DWORD FVF );
\r
73 HRESULT WINAPI SetLight( DWORD index, const D3DLIGHT9* pLight );
\r
74 HRESULT WINAPI SetMaterial( const D3DMATERIAL9* pMaterial );
\r
75 HRESULT WINAPI SetNPatchMode( FLOAT nSegments );
\r
76 HRESULT WINAPI SetTransform( D3DTRANSFORMSTATETYPE State, const D3DMATRIX* pMatrix );
\r
78 HRESULT WINAPI SetPixelShader( LPDIRECT3DPIXELSHADER9 pShader );
\r
79 HRESULT WINAPI SetPixelShaderConstantB( UINT StartRegister, const BOOL* pConstantData, UINT RegisterCount );
\r
80 HRESULT WINAPI SetPixelShaderConstantF( UINT StartRegister, const FLOAT* pConstantData, UINT RegisterCount );
\r
81 HRESULT WINAPI SetPixelShaderConstantI( UINT StartRegister, const INT* pConstantData, UINT RegisterCount );
\r
83 HRESULT WINAPI SetVertexShader( LPDIRECT3DVERTEXSHADER9 pShader );
\r
84 HRESULT WINAPI SetVertexShaderConstantB( UINT StartRegister, const BOOL* pConstantData, UINT RegisterCount );
\r
85 HRESULT WINAPI SetVertexShaderConstantF( UINT StartRegister, const FLOAT* pConstantData, UINT RegisterCount );
\r
86 HRESULT WINAPI SetVertexShaderConstantI( UINT StartRegister, const INT* pConstantData, UINT RegisterCount );
\r
88 HRESULT WINAPI SetRenderState( D3DRENDERSTATETYPE State, DWORD Value );
\r
89 HRESULT WINAPI SetSamplerState( DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value );
\r
90 HRESULT WINAPI SetTexture( DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture );
\r
91 HRESULT WINAPI SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value );
\r