mirror of
https://github.com/microsoft/DirectXTex
synced 2025-01-14 11:30:18 +00:00
WICTextureLoader: Added overloads that do not take a D3D11DeviceContext (i.e. no autogen mips) to be consistent with DDSTextureLoader
This commit is contained in:
parent
cff826adad
commit
b22fa640b4
@ -668,6 +668,19 @@ static HRESULT CreateTextureFromWIC( _In_ ID3D11Device* d3dDevice,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromMemory( ID3D11Device* d3dDevice,
|
||||
const uint8_t* wicData,
|
||||
size_t wicDataSize,
|
||||
ID3D11Resource** texture,
|
||||
ID3D11ShaderResourceView** textureView,
|
||||
size_t maxsize )
|
||||
{
|
||||
return CreateWICTextureFromMemoryEx( d3dDevice, nullptr, wicData, wicDataSize, maxsize,
|
||||
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromMemory( ID3D11Device* d3dDevice,
|
||||
ID3D11DeviceContext* d3dContext,
|
||||
@ -682,6 +695,24 @@ HRESULT DirectX::CreateWICTextureFromMemory( ID3D11Device* d3dDevice,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
||||
const uint8_t* wicData,
|
||||
size_t wicDataSize,
|
||||
size_t maxsize,
|
||||
D3D11_USAGE usage,
|
||||
unsigned int bindFlags,
|
||||
unsigned int cpuAccessFlags,
|
||||
unsigned int miscFlags,
|
||||
bool forceSRGB,
|
||||
ID3D11Resource** texture,
|
||||
ID3D11ShaderResourceView** textureView )
|
||||
{
|
||||
return CreateWICTextureFromMemoryEx( d3dDevice, nullptr, wicData, wicDataSize, maxsize,
|
||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
||||
ID3D11DeviceContext* d3dContext,
|
||||
@ -761,6 +792,18 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromFile( ID3D11Device* d3dDevice,
|
||||
const wchar_t* fileName,
|
||||
ID3D11Resource** texture,
|
||||
ID3D11ShaderResourceView** textureView,
|
||||
size_t maxsize )
|
||||
{
|
||||
return CreateWICTextureFromFileEx( d3dDevice, nullptr, fileName, maxsize,
|
||||
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromFile( ID3D11Device* d3dDevice,
|
||||
ID3D11DeviceContext* d3dContext,
|
||||
@ -774,6 +817,23 @@ HRESULT DirectX::CreateWICTextureFromFile( ID3D11Device* d3dDevice,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
const wchar_t* fileName,
|
||||
size_t maxsize,
|
||||
D3D11_USAGE usage,
|
||||
unsigned int bindFlags,
|
||||
unsigned int cpuAccessFlags,
|
||||
unsigned int miscFlags,
|
||||
bool forceSRGB,
|
||||
ID3D11Resource** texture,
|
||||
ID3D11ShaderResourceView** textureView )
|
||||
{
|
||||
return CreateWICTextureFromFileEx( d3dDevice, nullptr, fileName, maxsize,
|
||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||
texture, textureView );
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
ID3D11DeviceContext* d3dContext,
|
||||
|
@ -52,6 +52,23 @@
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Standard version
|
||||
HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(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_z_ const wchar_t* szFileName,
|
||||
_Out_opt_ ID3D11Resource** texture,
|
||||
_Out_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0
|
||||
);
|
||||
|
||||
// Standard version with optional auto-gen mipmap support
|
||||
HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
|
||||
@ -69,6 +86,33 @@ namespace DirectX
|
||||
_In_ size_t maxsize = 0
|
||||
);
|
||||
|
||||
// Extended version
|
||||
HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
|
||||
_In_ size_t wicDataSize,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Out_opt_ ID3D11Resource** texture,
|
||||
_Out_opt_ ID3D11ShaderResourceView** textureView
|
||||
);
|
||||
|
||||
HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Out_opt_ ID3D11Resource** texture,
|
||||
_Out_opt_ ID3D11ShaderResourceView** textureView
|
||||
);
|
||||
|
||||
// Extended version with optional auto-gen mipmap support
|
||||
HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
|
||||
|
Loading…
Reference in New Issue
Block a user