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 "ResourceView11.h"
\r
25 #include "ImageLoadInformation11.h"
\r
29 namespace Direct3D11
\r
33 value class ShaderResourceViewDescription;
\r
35 /// <summary>Specifies the subresources that a shader can access during rendering.</summary>
\r
36 /// <unmanaged>ID3D11ShaderResourceView</unmanaged>
\r
37 public ref class ShaderResourceView : public ResourceView
\r
39 COMOBJECT(ID3D11ShaderResourceView, ShaderResourceView);
\r
41 static ID3D11ShaderResourceView* ConstructFromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName, D3DX11_IMAGE_LOAD_INFO* loadInformation );
\r
42 static ID3D11ShaderResourceView* ConstructFromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory, D3DX11_IMAGE_LOAD_INFO* loadInformation );
\r
43 static ID3D11ShaderResourceView* ConstructFromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes, D3DX11_IMAGE_LOAD_INFO* loadInformation );
\r
46 /// <summary>Creates a <see cref="ShaderResourceView" /> for accessing resource data.</summary>
\r
47 /// <param name="device">The device to use when creating this <see cref="ShaderResourceView" />.</param>
\r
48 /// <param name="resource">The resource that will serve as input to a shader. This resource must have been created with the <see cref="BindFlags">ShaderResource</see> flag.</param>
\r
49 /// <unmanaged>ID3D11Device::CreateShaderResourceView</unmanaged>
\r
50 ShaderResourceView( SlimDX::Direct3D11::Device^ device, SlimDX::Direct3D11::Resource^ resource );
\r
52 /// <summary>Creates a <see cref="ShaderResourceView" /> for accessing resource data.</summary>
\r
53 /// <param name="device">The device to use when creating this <see cref="ShaderResourceView" />.</param>
\r
54 /// <param name="resource">The resource that will serve as input to a shader. This resource must have been created with the <see cref="BindFlags">ShaderResource</see> flag.</param>
\r
55 /// <param name="description">A structure describing the <see cref="ShaderResourceView" /> to be created.</param>
\r
56 /// <unmanaged>ID3D11Device::CreateShaderResourceView</unmanaged>
\r
57 ShaderResourceView( SlimDX::Direct3D11::Device^ device, SlimDX::Direct3D11::Resource^ resource, ShaderResourceViewDescription description );
\r
59 /// <summary>Gets a structure describing this <see cref="ShaderResourceView" />.</summary>
\r
60 /// <unmanaged>ID3D11ShaderResourceView::GetDesc</unmanaged>
\r
61 property ShaderResourceViewDescription Description
\r
63 ShaderResourceViewDescription get();
\r
67 /// Creates a shader resource view from a file.
\r
69 /// <param name="device">The device that will own the resource.</param>
\r
70 /// <param name="fileName">The name of the file that contains the shader resource view.</param>
\r
71 /// <returns>The created resource view.</returns>
\r
72 static ShaderResourceView^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName );
\r
75 /// Creates a shader resource view from a file.
\r
77 /// <param name="device">The device that will own the resource.</param>
\r
78 /// <param name="fileName">The name of the file that contains the shader resource view.</param>
\r
79 /// <param name="loadInformation">Identifies characteristics of the texture to be loaded.</param>
\r
80 /// <returns>The created resource view.</returns>
\r
81 static ShaderResourceView^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName, ImageLoadInformation loadInformation );
\r
84 /// Creates a shader resource view from memory.
\r
86 /// <param name="device">The device that will own the resource.</param>
\r
87 /// <param name="memory">The block of memory that contains the shader resource view.</param>
\r
88 /// <returns>The created resource view.</returns>
\r
89 static ShaderResourceView^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory );
\r
92 /// Creates a shader resource view from memory.
\r
94 /// <param name="device">The device that will own the resource.</param>
\r
95 /// <param name="memory">The block of memory that contains the shader resource view.</param>
\r
96 /// <param name="loadInfo">Identifies characteristics of the texture to be loaded.</param>
\r
97 /// <returns>The created resource view.</returns>
\r
98 static ShaderResourceView^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory, ImageLoadInformation loadInfo );
\r
101 /// Creates a shader resource view from a stream.
\r
103 /// <param name="device">The device that will own the resource.</param>
\r
104 /// <param name="stream">The stream that contains the shader resource view.</param>
\r
105 /// <param name="sizeInBytes">Size of the shader resource, in bytes.</param>
\r
106 /// <returns>The created resource view.</returns>
\r
107 static ShaderResourceView^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes );
\r
110 /// Creates a shader resource view from a stream.
\r
112 /// <param name="device">The device that will own the resource.</param>
\r
113 /// <param name="stream">The stream that contains the shader resource view.</param>
\r
114 /// <param name="sizeInBytes">Size of the shader resource, in bytes.</param>
\r
115 /// <param name="loadInfo">Identifies characteristics of the texture to be loaded.</param>
\r
116 /// <returns>The created resource view.</returns>
\r
117 static ShaderResourceView^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes, ImageLoadInformation loadInfo );
\r