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 "AdapterDescription1.h"
\r
28 using namespace System;
\r
34 AdapterDescription1::AdapterDescription1( const DXGI_ADAPTER_DESC1& native )
\r
36 m_Description = gcnew String( native.Description );
\r
37 m_VendorId = native.VendorId;
\r
38 m_DeviceId = native.DeviceId;
\r
39 m_SubSysId = native.SubSysId;
\r
40 m_Revision = native.Revision;
\r
41 m_DedicatedVideoMemory = native.DedicatedVideoMemory;
\r
42 m_DedicatedSystemMemory = native.DedicatedSystemMemory;
\r
43 m_SharedSystemMemory = native.SharedSystemMemory;
\r
44 m_Luid = (static_cast<Int64>(native.AdapterLuid.HighPart) << 32) | native.AdapterLuid.LowPart;
\r
45 m_Flags = static_cast<AdapterFlags>(native.Flags);
\r
48 String^ AdapterDescription1::Description::get()
\r
50 return m_Description;
\r
53 int AdapterDescription1::VendorId::get()
\r
58 int AdapterDescription1::DeviceId::get()
\r
63 int AdapterDescription1::SubsystemId::get()
\r
68 int AdapterDescription1::Revision::get()
\r
73 System::Int64 AdapterDescription1::DedicatedVideoMemory::get()
\r
75 return m_DedicatedVideoMemory;
\r
78 System::Int64 AdapterDescription1::DedicatedSystemMemory::get()
\r
80 return m_DedicatedSystemMemory;
\r
83 System::Int64 AdapterDescription1::SharedSystemMemory::get()
\r
85 return m_SharedSystemMemory;
\r
88 Int64 AdapterDescription1::Luid::get()
\r
93 AdapterFlags AdapterDescription1::Flags::get()
\r
98 bool AdapterDescription1::operator == ( AdapterDescription1 left, AdapterDescription1 right )
\r
100 return AdapterDescription1::Equals( left, right );
\r
103 bool AdapterDescription1::operator != ( AdapterDescription1 left, AdapterDescription1 right )
\r
105 return !AdapterDescription1::Equals( left, right );
\r
108 int AdapterDescription1::GetHashCode()
\r
110 return m_Description->GetHashCode() + m_VendorId.GetHashCode() + m_DeviceId.GetHashCode()
\r
111 + m_SubSysId.GetHashCode() + m_Revision.GetHashCode() + m_DedicatedVideoMemory.GetHashCode()
\r
112 + m_DedicatedSystemMemory.GetHashCode() + m_SharedSystemMemory.GetHashCode() + m_Luid.GetHashCode()
\r
113 + m_Flags.GetHashCode();
\r
116 bool AdapterDescription1::Equals( Object^ value )
\r
118 if( value == nullptr )
\r
121 if( value->GetType() != GetType() )
\r
124 return Equals( safe_cast<AdapterDescription1>( value ) );
\r
127 bool AdapterDescription1::Equals( AdapterDescription1 value )
\r
129 return ( m_Description == value.m_Description && m_VendorId == value.m_VendorId && m_DeviceId == value.m_DeviceId
\r
130 && m_SubSysId == value.m_SubSysId && m_Revision == value.m_Revision && m_DedicatedVideoMemory == value.m_DedicatedVideoMemory
\r
131 && m_DedicatedSystemMemory == value.m_DedicatedSystemMemory && m_SharedSystemMemory == value.m_SharedSystemMemory && m_Luid == value.m_Luid
\r
132 && m_Flags == value.m_Flags );
\r
135 bool AdapterDescription1::Equals( AdapterDescription1% value1, AdapterDescription1% value2 )
\r
137 return ( value1.m_Description == value2.m_Description && value1.m_VendorId == value2.m_VendorId && value1.m_DeviceId == value2.m_DeviceId
\r
138 && value1.m_SubSysId == value2.m_SubSysId && value1.m_Revision == value2.m_Revision && value1.m_DedicatedVideoMemory == value2.m_DedicatedVideoMemory
\r
139 && value1.m_DedicatedSystemMemory == value2.m_DedicatedSystemMemory && value1.m_SharedSystemMemory == value2.m_SharedSystemMemory && value1.m_Luid == value2.m_Luid
\r
140 && value1.m_Flags == value2.m_Flags );
\r