mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-09 22:40:06 +00:00
Sync with latest DirectXTK versions of DDSTextureLoader, ScreenGrab, and WICTextureLoader
This commit is contained in:
parent
b2f914f26d
commit
3b396e2303
@ -18,14 +18,13 @@
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include <dxgiformat.h>
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "DDSTextureLoader.h"
|
||||
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#pragma comment(lib,"dxguid.lib")
|
||||
#endif
|
||||
|
||||
@ -1777,7 +1776,7 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
if (texture != 0 || textureView != 0)
|
||||
{
|
||||
CHAR strFileA[MAX_PATH];
|
||||
|
@ -22,7 +22,13 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <d3d11.h>
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC
|
||||
#include <d3d11_x.h>
|
||||
#define DCOMMON_H_INCLUDED
|
||||
#define NO_D3D11_DEBUG_NAME
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
|
@ -25,10 +25,10 @@
|
||||
|
||||
// For 2D array textures and cubemaps, it captures only the first image in the array
|
||||
|
||||
#include <dxgiformat.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (_WIN32_WINNT > _WIN32_WINNT_WIN8)
|
||||
|
||||
// VS 2010's stdint.h conflicts with intsafe.h
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
@ -669,7 +669,7 @@ static HRESULT CaptureTexture( _In_ ID3D11DeviceContext* pContext,
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (_WIN32_WINNT > _WIN32_WINNT_WIN8)
|
||||
|
||||
static bool g_WIC2 = false;
|
||||
|
||||
@ -885,7 +885,7 @@ HRESULT DirectX::SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (_WIN32_WINNT > _WIN32_WINNT_WIN8)
|
||||
|
||||
HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
@ -1162,4 +1162,4 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif // !WINAPI_FAMILY || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#endif // !WINAPI_FAMILY || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (_WIN32_WINNT > _WIN32_WINNT_WIN8)
|
||||
|
@ -23,7 +23,13 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <d3d11.h>
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC
|
||||
#include <d3d11_x.h>
|
||||
#define DCOMMON_H_INCLUDED
|
||||
#define NO_D3D11_DEBUG_NAME
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <ocidl.h>
|
||||
|
||||
@ -40,7 +46,7 @@ namespace DirectX
|
||||
_In_ ID3D11Resource* pSource,
|
||||
_In_z_ LPCWSTR fileName );
|
||||
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (_WIN32_WINNT > _WIN32_WINNT_WIN8)
|
||||
|
||||
HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
|
@ -28,7 +28,6 @@
|
||||
// We could load multi-frame images (TIFF/GIF) into a texture array.
|
||||
// For now, we just load the first frame (note: DirectXTex supports multi-frame images)
|
||||
|
||||
#include <dxgiformat.h>
|
||||
#include <assert.h>
|
||||
|
||||
// VS 2010's stdint.h conflicts with intsafe.h
|
||||
@ -42,7 +41,7 @@
|
||||
|
||||
#include "WICTextureLoader.h"
|
||||
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#pragma comment(lib,"dxguid.lib")
|
||||
#endif
|
||||
|
||||
@ -53,7 +52,7 @@ using Microsoft::WRL::ComPtr;
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength])
|
||||
{
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
@ -878,7 +877,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||
texture, textureView );
|
||||
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
if (texture != 0 || textureView != 0)
|
||||
|
@ -29,11 +29,17 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
#error WIC is not supported on Windows Phone
|
||||
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (_WIN32_WINNT <= _WIN32_WINNT_WIN8)
|
||||
#error WIC is not supported on Windows Phone 8.0
|
||||
#endif
|
||||
|
||||
#include <d3d11.h>
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC
|
||||
#include <d3d11_x.h>
|
||||
#define DCOMMON_H_INCLUDED
|
||||
#define NO_D3D11_DEBUG_NAME
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
|
Loading…
Reference in New Issue
Block a user