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
24 #include "Buffer11.h"
\r
25 #include "VertexBufferBinding11.h"
\r
27 using namespace System;
\r
31 namespace Direct3D11
\r
33 VertexBufferBinding::VertexBufferBinding( Direct3D11::Buffer^ buffer, int stride, int offset )
\r
34 : m_Buffer( buffer ), m_Stride( stride ), m_Offset( offset )
\r
38 Direct3D11::Buffer^ VertexBufferBinding::Buffer::get()
\r
43 void VertexBufferBinding::Buffer::set( Direct3D11::Buffer^ value )
\r
48 int VertexBufferBinding::Stride::get()
\r
53 void VertexBufferBinding::Stride::set( int value )
\r
58 int VertexBufferBinding::Offset::get()
\r
63 void VertexBufferBinding::Offset::set( int value )
\r
68 bool VertexBufferBinding::operator == ( VertexBufferBinding left, VertexBufferBinding right )
\r
70 return VertexBufferBinding::Equals( left, right );
\r
73 bool VertexBufferBinding::operator != ( VertexBufferBinding left, VertexBufferBinding right )
\r
75 return !VertexBufferBinding::Equals( left, right );
\r
78 int VertexBufferBinding::GetHashCode()
\r
80 return m_Buffer->GetHashCode() + m_Stride.GetHashCode() + m_Offset.GetHashCode();
\r
83 bool VertexBufferBinding::Equals( Object^ value )
\r
85 if( value == nullptr )
\r
88 if( value->GetType() != GetType() )
\r
91 return Equals( safe_cast<VertexBufferBinding>( value ) );
\r
94 bool VertexBufferBinding::Equals( VertexBufferBinding value )
\r
96 return ( m_Buffer == value.m_Buffer && m_Stride == value.m_Stride && m_Offset == value.m_Offset );
\r
99 bool VertexBufferBinding::Equals( VertexBufferBinding% value1, VertexBufferBinding% value2 )
\r
101 return ( value1.m_Buffer == value2.m_Buffer && value1.m_Stride == value2.m_Stride && value1.m_Offset == value2.m_Offset );
\r