summaryrefslogtreecommitdiff
path: root/src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h')
-rw-r--r--src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h b/src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h
new file mode 100644
index 0000000..5448daf
--- /dev/null
+++ b/src/mesh/assimp-master/samples/SimpleTexturedDirectx11/SimpleTexturedDirectx11/TextureLoader.h
@@ -0,0 +1,61 @@
+//--------------------------------------------------------------------------------------
+// File: WICTextureLoader.h
+//
+// Function for loading a WIC image and creating a Direct3D 11 runtime texture for it
+// (auto-generating mipmaps if possible)
+//
+// Note: Assumes application has already called CoInitializeEx
+//
+// Warning: CreateWICTexture* functions are not thread-safe if given a d3dContext instance for
+// auto-gen mipmap support.
+//
+// Note these functions are useful for images created as simple 2D textures. For
+// more complex resources, DDSTextureLoader is an excellent light-weight runtime loader.
+// For a full-featured DDS file reader, writer, and texture processing pipeline see
+// the 'Texconv' sample and the 'DirectXTex' library.
+//
+// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
+// PARTICULAR PURPOSE.
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// http://go.microsoft.com/fwlink/?LinkId=248926
+// http://go.microsoft.com/fwlink/?LinkId=248929
+//--------------------------------------------------------------------------------------
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <d3d11.h>
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4005)
+#endif // _MSC_VER
+
+#include <stdint.h>
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif // _MSC_VER
+
+HRESULT CreateWICTextureFromMemory(_In_ ID3D11Device* d3dDevice,
+ _In_opt_ ID3D11DeviceContext* d3dContext,
+ _In_bytecount_(wicDataSize) const uint8_t* wicData,
+ _In_ size_t wicDataSize,
+ _Out_opt_ ID3D11Resource** texture,
+ _Out_opt_ ID3D11ShaderResourceView** textureView,
+ _In_ size_t maxsize = 0
+);
+
+HRESULT CreateWICTextureFromFile(_In_ ID3D11Device* d3dDevice,
+ _In_opt_ ID3D11DeviceContext* d3dContext,
+ _In_z_ const wchar_t* szFileName,
+ _Out_opt_ ID3D11Resource** texture,
+ _Out_opt_ ID3D11ShaderResourceView** textureView,
+ _In_ size_t maxsize = 0
+);
+