OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / EffectStateManager.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\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
10\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
13\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
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 namespace SlimDX\r
25 {\r
26         namespace Direct3D9\r
27         {\r
28                 ref class Effect;\r
29 \r
30                 public interface struct IEffectStateManager\r
31                 {\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
38 \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
43 \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
48 \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
53                 };\r
54 \r
55                 class IEffectStateManagerShim : public ID3DXEffectStateManager\r
56                 {\r
57                 private:\r
58                         int refCount;\r
59                         gcroot<IEffectStateManager^> m_WrappedInterface;\r
60                         gcroot<Effect^> m_Effect;\r
61 \r
62                 public:\r
63                         IEffectStateManagerShim( IEffectStateManager^ wrappedInterface, Effect^ effect );\r
64 \r
65                         IEffectStateManager^ GetManager() { return m_WrappedInterface; }\r
66 \r
67                         HRESULT WINAPI QueryInterface( const IID &iid, LPVOID *ppv );\r
68                         ULONG   WINAPI AddRef();\r
69                         ULONG   WINAPI Release();\r
70 \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
77 \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
82 \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
87 \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
92                 };\r
93         }\r
94 }\r