// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; namespace SharpDX.Direct3D10 { public partial class EffectVariable { /// /// Set data. /// /// A reference to the variable. /// size in bytes of data to write. /// /// Returns one of the following {{Direct3D 10 Return Codes}}. /// /// /// This method does no conversion or type checking; it is therefore a very quick way to access array items. /// /// HRESULT ID3D10EffectVariable::SetRawValue([None] void* pData,[None] int Offset,[None] int Count) public void SetRawValue(DataStream data, int count) { SetRawValue(data.PositionPointer, 0, count); } /// /// Get data. /// /// /// This method does no conversion or type checking; it is therefore a very quick way to access array items. /// /// The number of bytes to get. /// Returns a filled with the value. /// HRESULT ID3D10EffectVariable::GetRawValue([None] void* pData,[None] int Offset,[None] int Count) public DataStream GetRawValue(int count) { DataStream stream = new DataStream(count, true, true); GetRawValue(stream.DataPointer, 0, count); return stream; } /// /// Get a scalar variable. /// /// /// AsScalar returns a version of the effect variable that has been specialized to a scalar variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain scalar data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a scalar variable. See . /// ID3D10EffectScalarVariable* ID3D10EffectVariable::AsScalar() public SharpDX.Direct3D10.EffectScalarVariable AsScalar() { var temp = AsScalar_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a vector variable. /// /// /// AsVector returns a version of the effect variable that has been specialized to a vector variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain vector data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a vector variable. See . /// ID3D10EffectVectorVariable* ID3D10EffectVariable::AsVector() public SharpDX.Direct3D10.EffectVectorVariable AsVector() { var temp = AsVector_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a matrix variable. /// /// /// AsMatrix returns a version of the effect variable that has been specialized to a matrix variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain matrix data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a matrix variable. See . /// ID3D10EffectMatrixVariable* ID3D10EffectVariable::AsMatrix() public SharpDX.Direct3D10.EffectMatrixVariable AsMatrix() { var temp = AsMatrix_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a string variable. /// /// /// AsString returns a version of the effect variable that has been specialized to a string variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain string data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a string variable. See . /// ID3D10EffectStringVariable* ID3D10EffectVariable::AsString() public SharpDX.Direct3D10.EffectStringVariable AsString() { var temp = AsString_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a shader-resource variable. /// /// /// AsShaderResource returns a version of the effect variable that has been specialized to a shader-resource variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain shader-resource data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a shader-resource variable. See . /// ID3D10EffectShaderResourceVariable* ID3D10EffectVariable::AsShaderResource() public SharpDX.Direct3D10.EffectShaderResourceVariable AsShaderResource() { var temp = AsShaderResource_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a render-target-view variable. /// /// /// This method returns a version of the effect variable that has been specialized to a render-target-view variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain render-target-view data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a render-target-view variable. See . /// ID3D10EffectRenderTargetViewVariable* ID3D10EffectVariable::AsRenderTargetView() public SharpDX.Direct3D10.EffectRenderTargetViewVariable AsRenderTargetView() { var temp = AsRenderTargetView_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a depth-stencil-view variable. /// /// /// This method returns a version of the effect variable that has been specialized to a depth-stencil-view variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain depth-stencil-view data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a depth-stencil-view variable. See . /// ID3D10EffectDepthStencilViewVariable* ID3D10EffectVariable::AsDepthStencilView() public SharpDX.Direct3D10.EffectDepthStencilViewVariable AsDepthStencilView() { var temp = AsDepthStencilView_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a constant buffer. /// /// /// AsConstantBuffer returns a version of the effect variable that has been specialized to a constant buffer. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain constant buffer data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a constant buffer. See . /// ID3D10EffectConstantBuffer* ID3D10EffectVariable::AsConstantBuffer() public SharpDX.Direct3D10.EffectConstantBuffer AsConstantBuffer() { var temp = AsConstantBuffer_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a shader variable. /// /// /// AsShader returns a version of the effect variable that has been specialized to a shader variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain shader data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a shader variable. See . /// ID3D10EffectShaderVariable* ID3D10EffectVariable::AsShader() public SharpDX.Direct3D10.EffectShaderVariable AsShader() { var temp = AsShader_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a effect-blend variable. /// /// /// AsBlend returns a version of the effect variable that has been specialized to an effect-blend variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain effect-blend data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to an effect blend variable. See . /// ID3D10EffectBlendVariable* ID3D10EffectVariable::AsBlend() public SharpDX.Direct3D10.EffectBlendVariable AsBlend() { var temp = AsBlend_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a depth-stencil variable. /// /// /// AsDepthStencil returns a version of the effect variable that has been specialized to a depth-stencil variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain depth-stencil data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a depth-stencil variable. See . /// ID3D10EffectDepthStencilVariable* ID3D10EffectVariable::AsDepthStencil() public SharpDX.Direct3D10.EffectDepthStencilVariable AsDepthStencil() { var temp = AsDepthStencil_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a rasterizer variable. /// /// /// AsRasterizer returns a version of the effect variable that has been specialized to a rasterizer variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain rasterizer data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a rasterizer variable. See . /// ID3D10EffectRasterizerVariable* ID3D10EffectVariable::AsRasterizer() public SharpDX.Direct3D10.EffectRasterizerVariable AsRasterizer() { var temp = AsRasterizer_(); if (temp == null || !temp.IsValid) return null; return temp; } /// /// Get a sampler variable. /// /// /// AsSampler returns a version of the effect variable that has been specialized to a sampler variable. Similar to a cast, this specialization will return an invalid object if the effect variable does not contain sampler data. Applications can test the returned object for validity by calling {{IsValid}}. /// /// A reference to a sampler variable. See . /// ID3D10EffectSamplerVariable* ID3D10EffectVariable::AsSampler() public SharpDX.Direct3D10.EffectSamplerVariable AsSampler() { var temp = AsSampler_(); if (temp == null || !temp.IsValid) return null; return temp; } } }