mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-09 22:40:06 +00:00
Added WIC_LOADER_FORCE_RGBA32 to WICTextureLoader
This commit is contained in:
parent
e169033b60
commit
90cc562f9c
@ -448,6 +448,13 @@ namespace
|
||||
}
|
||||
#endif
|
||||
|
||||
if (loadFlags & WIC_LOADER_FORCE_RGBA32)
|
||||
{
|
||||
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat32bppRGBA, sizeof(GUID));
|
||||
format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
bpp = 32;
|
||||
}
|
||||
|
||||
if (!bpp)
|
||||
return E_FAIL;
|
||||
|
||||
|
@ -36,6 +36,7 @@ namespace DirectX
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_FORCE_RGBA32 = 0x4,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -358,6 +358,13 @@ namespace
|
||||
bpp = _WICBitsPerPixel(pixelFormat);
|
||||
}
|
||||
|
||||
if (loadFlags & WIC_LOADER_FORCE_RGBA32)
|
||||
{
|
||||
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat32bppRGBA, sizeof(GUID));
|
||||
format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
bpp = 32;
|
||||
}
|
||||
|
||||
if (!bpp)
|
||||
return E_FAIL;
|
||||
|
||||
|
@ -37,6 +37,7 @@ namespace DirectX
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_MIP_AUTOGEN = 0x4,
|
||||
WIC_LOADER_MIP_RESERVE = 0x8,
|
||||
WIC_LOADER_FORCE_RGBA32 = 0x10,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user