1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-21 12:00:06 +00:00

Updated WICTextureLoader and ScreenGrab with Windows Phone 8 guards

This commit is contained in:
walbourn_cp 2012-10-30 17:31:19 -07:00
parent 42e9ba96a3
commit 0ef4a78e4a
3 changed files with 19 additions and 1 deletions

View File

@ -28,10 +28,12 @@
#include <dxgiformat.h>
#include <assert.h>
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
#pragma warning(push)
#pragma warning(disable : 4005)
#include <wincodec.h>
#pragma warning(pop)
#endif
#include <memory>
@ -620,6 +622,8 @@ static HRESULT CaptureTexture( _In_ ID3D11DeviceContext* pContext,
//--------------------------------------------------------------------------------------
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
static IWICImagingFactory* _GetWIC()
{
static IWICImagingFactory* s_Factory = nullptr;
@ -644,6 +648,8 @@ static IWICImagingFactory* _GetWIC()
return s_Factory;
}
#endif
//--------------------------------------------------------------------------------------
HRESULT DirectX::SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
@ -793,6 +799,8 @@ HRESULT DirectX::SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
}
//--------------------------------------------------------------------------------------
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
_In_ REFGUID guidContainerFormat,
@ -1005,4 +1013,6 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
return hr;
return S_OK;
}
}
#endif // !WINAPI_FAMILY || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)

View File

@ -36,9 +36,13 @@ namespace DirectX
_In_ ID3D11Resource* pSource,
_In_z_ LPCWSTR fileName );
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
_In_ REFGUID guidContainerFormat,
_In_z_ LPCWSTR fileName,
_In_opt_ const GUID* targetFormat = nullptr );
#endif
}

View File

@ -29,6 +29,10 @@
#pragma once
#endif
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#error WIC is not supported on Windows Phone
#endif
#include <d3d11.h>
#pragma warning(push)