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
24 #include "../ComObject.h"
\r
26 #include "Enums11.h"
\r
30 namespace Direct3D11
\r
32 ref class EffectConstantBuffer;
\r
33 ref class EffectMatrixVariable;
\r
34 ref class EffectResourceVariable;
\r
35 ref class EffectShaderVariable;
\r
36 ref class EffectScalarVariable;
\r
37 ref class EffectVectorVariable;
\r
38 ref class EffectStringVariable;
\r
39 ref class EffectUnorderedAccessViewVariable;
\r
40 ref class EffectBlendVariable;
\r
41 ref class EffectClassInstanceVariable;
\r
42 ref class EffectDepthStencilVariable;
\r
43 ref class EffectDepthStencilViewVariable;
\r
44 ref class EffectInterfaceVariable;
\r
45 ref class EffectRasterizerVariable;
\r
46 ref class EffectRenderTargetViewVariable;
\r
47 ref class EffectSamplerVariable;
\r
48 value class EffectVariableDescription;
\r
49 ref class EffectType;
\r
52 /// Defines a base class for all effect variables.
\r
54 /// <unmanaged>ID3DX11EffectVariable</unmanaged>
\r
55 public ref class EffectVariable
\r
58 ID3DX11EffectVariable* m_Pointer;
\r
61 EffectVariable( ID3DX11EffectVariable* pointer );
\r
65 /// Initializes a new instance of the <see cref="EffectVariable"/> class.
\r
67 /// <param name="pointer">A pointer to the unmanaged interface.</param>
\r
68 EffectVariable( System::IntPtr pointer );
\r
71 /// Gets the effect variable's description.
\r
73 property EffectVariableDescription Description
\r
75 EffectVariableDescription get();
\r
79 /// Indicates whether the data type matches the data stored after casting to a specific interface.
\r
81 property bool IsValid
\r
87 /// Gets the parent constant buffer for this variable.
\r
89 property EffectConstantBuffer^ ParentConstantBuffer
\r
91 EffectConstantBuffer^ get();
\r
95 /// Get an annotation by index.
\r
97 /// <param name="index">The zero-based index of the annotation to retrieve.</param>
\r
98 /// <returns>The annotation at the specified index.</returns>
\r
99 EffectVariable^ GetAnnotationByIndex( int index );
\r
102 /// Get an annotation by name.
\r
104 /// <param name="name">The name of the annotation to retrieve.</param>
\r
105 /// <returns>The annotation with the given name.</returns>
\r
106 EffectVariable^ GetAnnotationByName( System::String^ name );
\r
109 /// Gets an element of an array variable.
\r
111 /// <param name="index">The zero-based index of the element to retrieve.</param>
\r
112 /// <returns>The element at the specified index in the array.</returns>
\r
113 EffectVariable^ GetElement( int index );
\r
116 /// Get a structure member by index.
\r
118 /// <param name="index">The zero-based index of the structure member to retrieve.</param>
\r
119 /// <returns>The structure member at the specified index.</returns>
\r
120 EffectVariable^ GetMemberByIndex( int index );
\r
123 /// Get a structure member by name.
\r
125 /// <param name="name">The name of the structure member to retrieve.</param>
\r
126 /// <returns>The structure member with the given name.</returns>
\r
127 EffectVariable^ GetMemberByName( System::String^ name );
\r
130 /// Get a structure member by semantic.
\r
132 /// <param name="name">The semantic of the structure member to retrieve.</param>
\r
133 /// <returns>The structure member with the given semantic.</returns>
\r
134 EffectVariable^ GetMemberBySemantic( System::String^ name );
\r
137 /// Reinterprets the effect variable as a more specialized blend-state variable.
\r
139 /// <returns>The specialized effect variable.</returns>
\r
140 EffectBlendVariable^ AsBlend();
\r
143 /// Reinterprets the effect variable as a more specialized class instance variable.
\r
145 /// <returns>The specialized effect variable.</returns>
\r
146 EffectClassInstanceVariable^ AsClassInstance();
\r
149 /// Reinterprets the effect variable as a more specialized constant buffer variable.
\r
151 /// <returns>The specialized effect variable.</returns>
\r
152 EffectConstantBuffer^ AsConstantBuffer();
\r
155 /// Reinterprets the effect variable as a more specialized depth-stencil-state variable.
\r
157 /// <returns>The specialized effect variable.</returns>
\r
158 EffectDepthStencilVariable^ AsDepthStencil();
\r
161 /// Reinterprets the effect variable as a more specialized depth-stencil view variable.
\r
163 /// <returns>The specialized effect variable.</returns>
\r
164 EffectDepthStencilViewVariable^ AsDepthStencilView();
\r
167 /// Reinterprets the effect variable as a more specialized interface variable.
\r
169 /// <returns>The specialized effect variable.</returns>
\r
170 EffectInterfaceVariable^ AsInterface();
\r
173 /// Reinterprets the effect variable as a more specialized matrix variable.
\r
175 /// <returns>The specialized effect variable.</returns>
\r
176 EffectMatrixVariable^ AsMatrix();
\r
179 /// Reinterprets the effect variable as a more specialized rasterizer-state variable.
\r
181 /// <returns>The specialized effect variable.</returns>
\r
182 EffectRasterizerVariable^ AsRasterizer();
\r
185 /// Reinterprets the effect variable as a more specialized render target view variable.
\r
187 /// <returns>The specialized effect variable.</returns>
\r
188 EffectRenderTargetViewVariable^ AsRenderTargetView();
\r
191 /// Reinterprets the effect variable as a more specialized sampler state variable.
\r
193 /// <returns>The specialized effect variable.</returns>
\r
194 EffectSamplerVariable^ AsSampler();
\r
197 /// Reinterprets the effect variable as a more specialized shader resource variable.
\r
199 /// <returns>The specialized effect variable.</returns>
\r
200 EffectResourceVariable^ AsResource();
\r
203 /// Reinterprets the effect variable as a more specialized scalar variable.
\r
205 /// <returns>The specialized effect variable.</returns>
\r
206 EffectScalarVariable^ AsScalar();
\r
209 /// Reinterprets the effect variable as a more specialized shader variable.
\r
211 /// <returns>The specialized effect variable.</returns>
\r
212 EffectShaderVariable^ AsShader();
\r
215 /// Reinterprets the effect variable as a more specialized string variable.
\r
217 /// <returns>The specialized effect variable.</returns>
\r
218 EffectStringVariable^ AsString();
\r
221 /// Reinterprets the effect variable as a more specialized unordered access view variable.
\r
223 /// <returns>The specialized effect variable.</returns>
\r
224 EffectUnorderedAccessViewVariable^ AsUnorderedAccessView();
\r
227 /// Reinterprets the effect variable as a more specialized vector variable.
\r
229 /// <returns>The specialized effect variable.</returns>
\r
230 EffectVectorVariable^ AsVector();
\r
233 /// Gets information about the variable type.
\r
235 /// <returns>A type descriptor containing information about the variable type.</returns>
\r
236 EffectType^ GetVariableType();
\r
239 /// Sets the value of the variable using raw bytes.
\r
241 /// <param name="count">The number of bytes to set.</param>
\r
242 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
243 Result SetRawValue(DataStream^ data, int count);
\r
246 /// Gets the value of the variable in raw bytes.
\r
248 /// <param name="count">The number of bytes to retrieve.</param>
\r
249 /// <returns>The raw data representing the value of the variable.</returns>
\r
250 DataStream^ GetRawValue(int count);
\r