2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "../dxgi/Enums.h"
\r
25 #include "../dxgi/SampleDescription.h"
\r
27 #include "Enums11.h"
\r
31 namespace Direct3D11
\r
34 /// Describes a two-dimensional texture.
\r
36 /// <unmanaged>D3D11_TEXTURE2D_DESC</unmanaged>
\r
37 public value class Texture2DDescription : System::IEquatable<Texture2DDescription>
\r
44 DXGI::Format m_Format;
\r
45 DXGI::SampleDescription m_SampleDesc;
\r
46 ResourceUsage m_Usage;
\r
47 BindFlags m_BindFlags;
\r
48 CpuAccessFlags m_CPUAccessFlags;
\r
49 ResourceOptionFlags m_MiscFlags;
\r
52 Texture2DDescription( const D3D11_TEXTURE2D_DESC& native );
\r
54 D3D11_TEXTURE2D_DESC CreateNativeVersion();
\r
58 /// Texture width (in texels).
\r
63 void set( int value );
\r
67 /// Texture height (in texels).
\r
72 void set( int value );
\r
76 /// The maximum number of mipmap levels in the texture. Use 1 for a multisampled texture; or 0 to generate a full set of subtextures.
\r
78 property int MipLevels
\r
81 void set( int value );
\r
85 /// Number of textures in the array.
\r
87 property int ArraySize
\r
90 void set( int value );
\r
94 /// Format of the data in the texture.
\r
96 property DXGI::Format Format
\r
99 void set( DXGI::Format value );
\r
103 /// Gets or sets multisampling parameters for the texture.
\r
105 property DXGI::SampleDescription SampleDescription
\r
107 DXGI::SampleDescription get();
\r
108 void set( DXGI::SampleDescription value );
\r
112 /// Value that identifies how the texture is to be read from and written to.
\r
114 property ResourceUsage Usage
\r
116 ResourceUsage get();
\r
117 void set( ResourceUsage value );
\r
121 /// Flags that describe how the texture can be bound to the pipeline.
\r
123 property Direct3D11::BindFlags BindFlags
\r
125 Direct3D11::BindFlags get();
\r
126 void set( Direct3D11::BindFlags value );
\r
130 /// Flags that specify how the CPU may access the texture.
\r
132 property Direct3D11::CpuAccessFlags CpuAccessFlags
\r
134 Direct3D11::CpuAccessFlags get();
\r
135 void set( Direct3D11::CpuAccessFlags value );
\r
139 /// Flags that identifies other, less common resource options.
\r
141 property ResourceOptionFlags OptionFlags
\r
143 ResourceOptionFlags get();
\r
144 void set( ResourceOptionFlags value );
\r
148 /// Tests for equality between two objects.
\r
150 /// <param name="left">The first value to compare.</param>
\r
151 /// <param name="right">The second value to compare.</param>
\r
152 /// <returns><c>true</c> if <paramref name="left"/> has the same value as <paramref name="right"/>; otherwise, <c>false</c>.</returns>
\r
153 static bool operator == ( Texture2DDescription left, Texture2DDescription right );
\r
156 /// Tests for inequality between two objects.
\r
158 /// <param name="left">The first value to compare.</param>
\r
159 /// <param name="right">The second value to compare.</param>
\r
160 /// <returns><c>true</c> if <paramref name="left"/> has a different value than <paramref name="right"/>; otherwise, <c>false</c>.</returns>
\r
161 static bool operator != ( Texture2DDescription left, Texture2DDescription right );
\r
164 /// Returns the hash code for this instance.
\r
166 /// <returns>A 32-bit signed integer hash code.</returns>
\r
167 virtual int GetHashCode() override;
\r
170 /// Returns a value that indicates whether the current instance is equal to a specified object.
\r
172 /// <param name="obj">Object to make the comparison with.</param>
\r
173 /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>
\r
174 virtual bool Equals( System::Object^ obj ) override;
\r
177 /// Returns a value that indicates whether the current instance is equal to the specified object.
\r
179 /// <param name="other">Object to make the comparison with.</param>
\r
180 /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>
\r
181 virtual bool Equals( Texture2DDescription other );
\r
184 /// Determines whether the specified object instances are considered equal.
\r
186 /// <param name="value1">The first value to compare.</param>
\r
187 /// <param name="value2">The second value to compare.</param>
\r
188 /// <returns><c>true</c> if <paramref name="value1"/> is the same instance as <paramref name="value2"/> or
\r
189 /// if both are <c>null</c> references or if <c>value1.Equals(value2)</c> returns <c>true</c>; otherwise, <c>false</c>.</returns>
\r
190 static bool Equals( Texture2DDescription% value1, Texture2DDescription% value2 );
\r