+++ /dev/null
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#pragma once\r
-\r
-#include "Enums11.h"\r
-#include "Resource11.h"\r
-#include "ImageLoadInformation11.h"\r
-\r
-namespace SlimDX\r
-{\r
- ref class DataRectangle;\r
- \r
- namespace Direct3D11\r
- {\r
- ref class Device;\r
- ref class DeviceContext;\r
- value class Texture2DDescription;\r
- \r
- /// <summary>\r
- /// Represents a two-dimensional texture.\r
- /// </summary>\r
- /// <unmanaged>ID3D11Texture2D</unmanaged>\r
- public ref class Texture2D : public Resource\r
- {\r
- COMOBJECT(ID3D11Texture2D, Texture2D);\r
- \r
- private:\r
- static ID3D11Texture2D* Build( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, D3D11_SUBRESOURCE_DATA* data ); \r
- \r
- public:\r
- /// <summary>\r
- /// Gets the texture description.\r
- /// </summary>\r
- property Texture2DDescription Description\r
- {\r
- Texture2DDescription get();\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
- /// </summary>\r
- /// <param name="device">The device with which to associate the texture.</param>\r
- /// <param name="description">The description of the texture.</param>\r
- Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description );\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
- /// </summary>\r
- /// <param name="device">The device with which to associate the texture.</param>\r
- /// <param name="description">The description of the texture.</param>\r
- /// <param name="data">The initial texture data.</param>\r
- Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, DataRectangle^ data );\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
- /// </summary>\r
- /// <param name="device">The device with which to associate the texture.</param>\r
- /// <param name="description">The description of the texture.</param>\r
- /// <param name="data">An array of initial texture data for each subresource.</param>\r
- Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, array<DataRectangle^>^ data );\r
- \r
- /// <summary>\r
- /// Loads a texture from an image file.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="fileName">Path to the file on disk.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName );\r
-\r
- /// <summary>\r
- /// Loads a texture from an image file.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="fileName">Path to the file on disk.</param>\r
- /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName, ImageLoadInformation loadInfo );\r
-\r
- /// <summary>\r
- /// Loads a texture from an image in memory.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="memory">Array of memory containing the image data to load.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory );\r
-\r
- /// <summary>\r
- /// Loads a texture from an image in memory.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="memory">Array of memory containing the image data to load.</param>\r
- /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory, ImageLoadInformation loadInfo );\r
-\r
- /// <summary>\r
- /// Loads a texture from a stream of data.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="stream">A stream containing the image data to load.</param>\r
- /// <param name="sizeInBytes">Size of the image to load.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes );\r
-\r
- /// <summary>\r
- /// Loads a texture from a stream of data.\r
- /// </summary>\r
- /// <param name="device">The device used to load the texture.</param>\r
- /// <param name="stream">A stream containing the image data to load.</param>\r
- /// <param name="sizeInBytes">Size of the image to load.</param>\r
- /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
- /// <returns>The loaded texture object.</returns>\r
- static Texture2D^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes, ImageLoadInformation loadInfo );\r
-\r
- /// <summary>\r
- /// Saves a texture to file.\r
- /// </summary>\r
- /// <param name="context">The device used to save the texture.</param>\r
- /// <param name="texture">The texture to save.</param>\r
- /// <param name="format">The format the texture will be saved as.</param>\r
- /// <param name="fileName">Name of the destination output file where the texture will be saved.</param>\r
- /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
- static Result ToFile( DeviceContext^ context, Texture2D^ texture, ImageFileFormat format, System::String^ fileName );\r
-\r
- /// <summary>\r
- /// Saves a texture to a stream.\r
- /// </summary>\r
- /// <param name="context">The device used to save the texture.</param>\r
- /// <param name="texture">The texture to save.</param>\r
- /// <param name="format">The format the texture will be saved as.</param>\r
- /// <param name="stream">Destination memory stream where the image will be saved.</param>\r
- /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
- static Result ToStream( DeviceContext^ context, Texture2D^ texture, ImageFileFormat format, System::IO::Stream^ stream );\r
-\r
- /// <summary>\r
- /// Converts a height map into a normal map. The (x,y,z) components of each normal are mapped to the (r,g,b) channels of the output texture.\r
- /// </summary>\r
- /// <param name="context">The device used to create the normal map.</param>\r
- /// <param name="source">The source height map texture.</param>\r
- /// <param name="destination">The destination texture.</param>\r
- /// <param name="flags">One or more flags that control generation of normal maps.</param>\r
- /// <param name="channel">One or more flag specifying the source of height information.</param>\r
- /// <param name="amplitude">Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.</param>\r
- /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
- static Result ComputeNormalMap(DeviceContext^ context, Texture2D^ source, Texture2D^ destination, NormalMapFlags flags, Channel channel, float amplitude);\r
- };\r
- }\r
-};
\ No newline at end of file