3 * Copyright (c) 2007-2010 SlimDX Group
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
6 * of this software and associated documentation files (the "Software"), to deal
\r
7 * in the Software without restriction, including without limitation the rights
\r
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
9 * copies of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in
\r
13 * all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
26 #include "EffectVariableDescription.h"
\r
28 using namespace System;
\r
32 namespace Direct3D10
\r
34 EffectVariableDescription::EffectVariableDescription( const D3D10_EFFECT_VARIABLE_DESC& native )
\r
36 m_Name = gcnew String( native.Name );
\r
37 m_Semantic = gcnew String( native.Semantic );
\r
38 m_Flags = static_cast<EffectVariableFlags>( native.Flags );
\r
39 m_Annotations = native.Annotations;
\r
40 m_BufferOffset = native.BufferOffset;
\r
41 m_ExplicitBindPoint = native.ExplicitBindPoint;
\r
44 String^ EffectVariableDescription::Name::get()
\r
49 String^ EffectVariableDescription::Semantic::get()
\r
54 EffectVariableFlags EffectVariableDescription::Flags::get()
\r
59 int EffectVariableDescription::AnnotationCount::get()
\r
61 return m_Annotations;
\r
64 int EffectVariableDescription::ConstantBufferOffset::get()
\r
66 return m_BufferOffset;
\r
69 int EffectVariableDescription::ExplicitBindPoint::get()
\r
71 return m_ExplicitBindPoint;
\r
74 bool EffectVariableDescription::operator == ( EffectVariableDescription left, EffectVariableDescription right )
\r
76 return EffectVariableDescription::Equals( left, right );
\r
79 bool EffectVariableDescription::operator != ( EffectVariableDescription left, EffectVariableDescription right )
\r
81 return !EffectVariableDescription::Equals( left, right );
\r
84 int EffectVariableDescription::GetHashCode()
\r
86 return m_Name->GetHashCode() + m_Semantic->GetHashCode() + m_Flags.GetHashCode() + m_Annotations.GetHashCode() + m_BufferOffset.GetHashCode() + m_ExplicitBindPoint.GetHashCode();
\r
89 bool EffectVariableDescription::Equals( Object^ value )
\r
91 if( value == nullptr )
\r
94 if( value->GetType() != GetType() )
\r
97 return Equals( safe_cast<EffectVariableDescription>( value ) );
\r
100 bool EffectVariableDescription::Equals( EffectVariableDescription value )
\r
102 return ( m_Name == value.m_Name && m_Semantic == value.m_Semantic && m_Flags == value.m_Flags && m_Annotations == value.m_Annotations && m_BufferOffset == value.m_BufferOffset && m_ExplicitBindPoint == value.m_ExplicitBindPoint );
\r
105 bool EffectVariableDescription::Equals( EffectVariableDescription% value1, EffectVariableDescription% value2 )
\r
107 return ( value1.m_Name == value2.m_Name && value1.m_Semantic == value2.m_Semantic && value1.m_Flags == value2.m_Flags && value1.m_Annotations == value2.m_Annotations && value1.m_BufferOffset == value2.m_BufferOffset && value1.m_ExplicitBindPoint == value2.m_ExplicitBindPoint );
\r