+++ /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 "../ComObject.h"\r
-\r
-#include "../dxgi/Enums.h"\r
-\r
-#include "DeviceChild10.h"\r
-#include "Enums.h"\r
-#include "../dxgi/SwapChainDxgi.h"\r
-#include "../dxgi/SurfaceDxgi.h"\r
-\r
-#include "TextureLoadInformation10.h"\r
-\r
-namespace SlimDX\r
-{\r
- namespace Direct3D10\r
- {\r
- /// <summary>\r
- /// A resource object.\r
- /// </summary>\r
- /// <unmanaged>ID3D10Resource</unmanaged>\r
- public ref class Resource abstract : public DeviceChild\r
- {\r
- COMOBJECT_BASE(ID3D10Resource);\r
-\r
- internal:\r
- static int GetMipSize( int mipSlice, int baseSliceSize );\r
- \r
- static ID3D10Resource* ConstructFromFile( SlimDX::Direct3D10::Device^ device, System::String^ fileName, D3DX10_IMAGE_LOAD_INFO* info );\r
- static ID3D10Resource* ConstructFromMemory( SlimDX::Direct3D10::Device^ device, array<System::Byte>^ memory, D3DX10_IMAGE_LOAD_INFO* info );\r
- static ID3D10Resource* ConstructFromStream( SlimDX::Direct3D10::Device^ device, System::IO::Stream^ stream, int sizeInBytes, D3DX10_IMAGE_LOAD_INFO* info );\r
- \r
- static Resource^ FromPointer( ID3D10Resource* pointer );\r
-\r
- protected:\r
- Resource() { }\r
-\r
- public:\r
- /// <summary>\r
- /// Returns a DXGI Surface for this resource.\r
- /// </summary>\r
- /// <returns>The buffer interface, or <c>null</c> on failure.</returns>\r
- SlimDX::DXGI::Surface^ AsSurface();\r
-\r
- /// <summary>\r
- /// Gets a swap chain back buffer.\r
- /// </summary>\r
- /// <typeparam name="T">The type of the buffer.</typeparam>\r
- /// <param name="swapChain">The swap chain to get the buffer from.</param>\r
- /// <param name="index">The index of the desired buffer.</param>\r
- /// <returns>The buffer interface, or <c>null</c> on failure.</returns>\r
- generic< class T > where T : Resource, ref class\r
- static T FromSwapChain( SlimDX::DXGI::SwapChain^ swapChain, int index );\r
-\r
- static Resource^ FromPointer( System::IntPtr pointer );\r
-\r
- /// <summary>\r
- /// Gets or sets the resource's eviction priority.\r
- /// </summary>\r
- property DXGI::ResourcePriority EvictionPriority\r
- {\r
- DXGI::ResourcePriority get();\r
- void set(DXGI::ResourcePriority value);\r
- }\r
- \r
- /// <summary>\r
- /// Gets the resource's dimension (type).\r
- /// </summary>\r
- property ResourceDimension Dimension\r
- {\r
- ResourceDimension get();\r
- }\r
-\r
- static Result LoadTextureFromTexture(Resource^ source, Resource^ destination, TextureLoadInformation loadInformation);\r
- static Result FilterTexture(Resource^ texture, int sourceLevel, FilterFlags mipFilter);\r
- \r
- /// <summary>\r
- /// Calculates a subresource index.\r
- /// </summary>\r
- /// <param name="mipSlice">The index of the desired mip slice.</param>\r
- /// <param name="arraySlice">The index of the desired array slice.</param>\r
- /// <param name="mipLevels">The total number of mip levels.</param>\r
- /// <returns>The subresource index (equivalent to mipSlice + (arraySlice * mipLevels)).</returns>\r
- static int CalculateSubresourceIndex( int mipSlice, int arraySlice, int mipLevels );\r
-\r
- literal int MaximumMipLevels = D3D10_REQ_MIP_LEVELS;\r
- literal int ResourceSizeInMegabytes = D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES;\r
- literal int MaximumTexture1DArraySize = D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION;\r
- literal int MaximumTexture2DArraySize = D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION;\r
- literal int MaximumTexture1DSize = D3D10_REQ_TEXTURE1D_U_DIMENSION;\r
- literal int MaximumTexture2DSize = D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION;\r
- literal int MaximumTexture3DSize = D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION;\r
- literal int MaximumTextureCubeSize = D3D10_REQ_TEXTURECUBE_DIMENSION;\r
- };\r
- }\r
-};
\ No newline at end of file