Convert WICTextureLoader, DDSTextureLoader12 to strongly typed flags

This commit is contained in:
Chuck Walbourn
2021-06-02 17:13:29 -07:00
parent d694249071
commit 3c9e187d96
8 changed files with 88 additions and 42 deletions

View File

@@ -105,14 +105,13 @@ namespace
//-------------------------------------------------------------------------------------
// WIC Pixel Format nearest conversion table
//-------------------------------------------------------------------------------------
struct WICConvert
{
const GUID& source;
const GUID& target;
const GUID& source;
const GUID& target;
};
constexpr WICConvert g_WICConvert[] =
constexpr WICConvert g_WICConvert [] =
{
// Note target GUID in this conversion table must be one of those directly supported formats (above).
@@ -174,7 +173,7 @@ namespace
bool g_WIC2 = false;
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID* ifactory) noexcept
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID *ifactory) noexcept
{
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
@@ -362,7 +361,7 @@ namespace
_In_ unsigned int bindFlags,
_In_ unsigned int cpuAccessFlags,
_In_ unsigned int miscFlags,
_In_ unsigned int loadFlags,
_In_ WIC_LOADER_FLAGS loadFlags,
_Outptr_opt_ ID3D11Resource** texture,
_Outptr_opt_ ID3D11ShaderResourceView** textureView) noexcept
{
@@ -865,7 +864,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(
unsigned int bindFlags,
unsigned int cpuAccessFlags,
unsigned int miscFlags,
unsigned int loadFlags,
WIC_LOADER_FLAGS loadFlags,
ID3D11Resource** texture,
ID3D11ShaderResourceView** textureView) noexcept
{
@@ -888,7 +887,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(
unsigned int bindFlags,
unsigned int cpuAccessFlags,
unsigned int miscFlags,
unsigned int loadFlags,
WIC_LOADER_FLAGS loadFlags,
ID3D11Resource** texture,
ID3D11ShaderResourceView** textureView) noexcept
{
@@ -1006,7 +1005,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(
unsigned int bindFlags,
unsigned int cpuAccessFlags,
unsigned int miscFlags,
unsigned int loadFlags,
WIC_LOADER_FLAGS loadFlags,
ID3D11Resource** texture,
ID3D11ShaderResourceView** textureView) noexcept
{
@@ -1028,7 +1027,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(
unsigned int bindFlags,
unsigned int cpuAccessFlags,
unsigned int miscFlags,
unsigned int loadFlags,
WIC_LOADER_FLAGS loadFlags,
ID3D11Resource** texture,
ID3D11ShaderResourceView** textureView) noexcept
{