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 "SurfaceDescription.h"
\r
32 SurfaceDescription::SurfaceDescription( const DXGI_SURFACE_DESC& native )
\r
34 m_Width = native.Width;
\r
35 m_Height = native.Height;
\r
36 m_Format = static_cast<DXGI::Format>( native.Format );
\r
37 m_SampleDesc = DXGI::SampleDescription( native.SampleDesc );
\r
40 int SurfaceDescription::Width::get()
\r
45 int SurfaceDescription::Height::get()
\r
50 DXGI::Format SurfaceDescription::Format::get()
\r
55 DXGI::SampleDescription SurfaceDescription::SampleDescription::get()
\r
57 return m_SampleDesc;
\r
60 bool SurfaceDescription::operator == ( SurfaceDescription left, SurfaceDescription right )
\r
62 return SurfaceDescription::Equals( left, right );
\r
65 bool SurfaceDescription::operator != ( SurfaceDescription left, SurfaceDescription right )
\r
67 return !SurfaceDescription::Equals( left, right );
\r
70 int SurfaceDescription::GetHashCode()
\r
72 return m_Width.GetHashCode() + m_Height.GetHashCode() + m_Format.GetHashCode()
\r
73 + m_SampleDesc.GetHashCode();
\r
76 bool SurfaceDescription::Equals( Object^ value )
\r
78 if( value == nullptr )
\r
81 if( value->GetType() != GetType() )
\r
84 return Equals( safe_cast<SurfaceDescription>( value ) );
\r
87 bool SurfaceDescription::Equals( SurfaceDescription value )
\r
89 return ( m_Width == value.m_Width && m_Height == value.m_Height && m_Format == value.m_Format
\r
90 && m_SampleDesc == value.m_SampleDesc );
\r
93 bool SurfaceDescription::Equals( SurfaceDescription% value1, SurfaceDescription% value2 )
\r
95 return ( value1.m_Width == value2.m_Width && value1.m_Height == value2.m_Height && value1.m_Format == value2.m_Format
\r
96 && value1.m_SampleDesc == value2.m_SampleDesc );
\r