Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDSTextureLoader.h
Go to the documentation of this file.
1 // The copyright in this software is being made available under the BSD License, included below.
2 // This software may be subject to other third party and contributor rights, including patent rights,
3 // and no such rights are granted under this license.
4 //
5 // Copyright (c) 2013, Microsoft Open Technologies, Inc.
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without modification,
9 // are permitted provided that the following conditions are met:
10 //
11 // - Redistributions of source code must retain the above copyright notice,
12 // this list of conditions and the following disclaimer.
13 // - Redistributions in binary form must reproduce the above copyright notice,
14 // this list of conditions and the following disclaimer in the documentation
15 // and/or other materials provided with the distribution.
16 // - Neither the name of Microsoft Open Technologies, Inc. nor the names of its contributors
17 // may be used to endorse or promote products derived from this software
18 // without specific prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 //--------------------------------------------------------------------------------------
30 // File: DDSTextureLoader.h
31 //
32 // Function for loading a DDS texture and creating a Direct3D 11 runtime resource for it
33 //
34 // Note these functions are useful as a light-weight runtime loader for DDS files. For
35 // a full-featured DDS file reader, writer, and texture processing pipeline see
36 // the 'Texconv' sample and the 'DirectXTex' library.
37 //
38 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
39 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
40 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
41 // PARTICULAR PURPOSE.
42 //
43 // Copyright (c) Microsoft Corporation. All rights reserved.
44 //
45 // http://go.microsoft.com/fwlink/?LinkId=248926
46 // http://go.microsoft.com/fwlink/?LinkId=248929
47 //--------------------------------------------------------------------------------------
48 
49 #ifdef _MSC_VER
50 #pragma once
51 #endif
52 
53 #include <d3d11.h>
54 
55 #pragma warning(push)
56 #pragma warning(disable : 4005)
57 #include <stdint.h>
58 #pragma warning(pop)
59 
60 namespace DirectX
61 {
62  HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
63  _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
64  _In_ size_t ddsDataSize,
65  _Out_opt_ ID3D11Resource** texture,
66  _Out_opt_ ID3D11ShaderResourceView** textureView,
67  _In_ size_t maxsize = 0
68  );
69 
70  HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
71  _In_z_ const wchar_t* szFileName,
72  _Out_opt_ ID3D11Resource** texture,
73  _Out_opt_ ID3D11ShaderResourceView** textureView,
74  _In_ size_t maxsize = 0
75  );
76 
77  HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
78  _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
79  _In_ size_t ddsDataSize,
80  _In_ size_t maxsize,
81  _In_ D3D11_USAGE usage,
82  _In_ unsigned int bindFlags,
83  _In_ unsigned int cpuAccessFlags,
84  _In_ unsigned int miscFlags,
85  _In_ bool forceSRGB,
86  _Out_opt_ ID3D11Resource** texture,
87  _Out_opt_ ID3D11ShaderResourceView** textureView
88  );
89 
90  HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
91  _In_z_ const wchar_t* szFileName,
92  _In_ size_t maxsize,
93  _In_ D3D11_USAGE usage,
94  _In_ unsigned int bindFlags,
95  _In_ unsigned int cpuAccessFlags,
96  _In_ unsigned int miscFlags,
97  _In_ bool forceSRGB,
98  _Out_opt_ ID3D11Resource** texture,
99  _Out_opt_ ID3D11ShaderResourceView** textureView
100  );
101 }
HRESULT CreateDDSTextureFromMemory(_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _Out_opt_ ID3D11Resource **texture, _Out_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0)
GLenum GLenum GLuint texture
Definition: GLee.h:5383
HRESULT CreateDDSTextureFromFileEx(_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Out_opt_ ID3D11Resource **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)
GLsizeiptr const GLvoid GLenum usage
Definition: GLee.h:2089
HRESULT CreateDDSTextureFromFile(_In_ ID3D11Device *d3dDevice, _In_z_ const wchar_t *szFileName, _Out_opt_ ID3D11Resource **texture, _Out_opt_ ID3D11ShaderResourceView **textureView, _In_ size_t maxsize=0)
HRESULT CreateDDSTextureFromMemoryEx(_In_ ID3D11Device *d3dDevice, _In_reads_bytes_(ddsDataSize) const uint8_t *ddsData, _In_ size_t ddsDataSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Out_opt_ ID3D11Resource **texture, _Out_opt_ ID3D11ShaderResourceView **textureView)