From d1ffc769ed71362d34a740d8661afff59ab4a5f7 Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Wed, 26 Sep 2012 17:29:15 -0700 Subject: [PATCH] Put DDSTextureLoader and WICTextureLoader functions in the DirectX namespace --- Inc/DDSTextureLoader.h | 29 ++++++++++++++++------------- Inc/WICTextureLoader.h | 33 ++++++++++++++++++--------------- Src/DDSTextureLoader.cpp | 22 +++++++++++----------- Src/WICTextureLoader.cpp | 26 +++++++++++++------------- 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/Inc/DDSTextureLoader.h b/Inc/DDSTextureLoader.h index 633923d..67fad57 100644 --- a/Inc/DDSTextureLoader.h +++ b/Inc/DDSTextureLoader.h @@ -29,17 +29,20 @@ #include #pragma warning(pop) -HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize = 0 - ); +namespace DirectX +{ + HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize = 0 + ); -HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* szFileName, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize = 0 - ); + HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* szFileName, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize = 0 + ); +} \ No newline at end of file diff --git a/Inc/WICTextureLoader.h b/Inc/WICTextureLoader.h index ab56abc..19cbfac 100644 --- a/Inc/WICTextureLoader.h +++ b/Inc/WICTextureLoader.h @@ -36,19 +36,22 @@ #include #pragma warning(pop) -HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _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 - ); +namespace DirectX +{ + HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _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_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* szFileName, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize = 0 - ); + HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* szFileName, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize = 0 + ); +} \ No newline at end of file diff --git a/Src/DDSTextureLoader.cpp b/Src/DDSTextureLoader.cpp index bd7bb26..1e0c108 100644 --- a/Src/DDSTextureLoader.cpp +++ b/Src/DDSTextureLoader.cpp @@ -1247,12 +1247,12 @@ static HRESULT CreateTextureFromDDS( _In_ ID3D11Device* d3dDevice, } //-------------------------------------------------------------------------------------- -HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, - _In_ size_t ddsDataSize, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize ) +HRESULT DirectX::CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, + _In_ size_t ddsDataSize, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize ) { if (!d3dDevice || !ddsData || (!texture && !textureView)) { @@ -1329,11 +1329,11 @@ HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice, } //-------------------------------------------------------------------------------------- -HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_z_ const wchar_t* fileName, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize ) +HRESULT DirectX::CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_z_ const wchar_t* fileName, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize ) { if (!d3dDevice || !fileName || (!texture && !textureView)) { diff --git a/Src/WICTextureLoader.cpp b/Src/WICTextureLoader.cpp index 727ee49..7fcfae4 100644 --- a/Src/WICTextureLoader.cpp +++ b/Src/WICTextureLoader.cpp @@ -555,13 +555,13 @@ static HRESULT CreateTextureFromWIC( _In_ ID3D11Device* d3dDevice, } //-------------------------------------------------------------------------------------- -HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_reads_bytes_(wicDataSize) const uint8_t* wicData, - _In_ size_t wicDataSize, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize +HRESULT DirectX::CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_reads_bytes_(wicDataSize) const uint8_t* wicData, + _In_ size_t wicDataSize, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize ) { if (!d3dDevice || !wicData || (!texture && !textureView)) @@ -630,12 +630,12 @@ HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice, } //-------------------------------------------------------------------------------------- -HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, - _In_opt_ ID3D11DeviceContext* d3dContext, - _In_z_ const wchar_t* fileName, - _Out_opt_ ID3D11Resource** texture, - _Out_opt_ ID3D11ShaderResourceView** textureView, - _In_ size_t maxsize ) +HRESULT DirectX::CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice, + _In_opt_ ID3D11DeviceContext* d3dContext, + _In_z_ const wchar_t* fileName, + _Out_opt_ ID3D11Resource** texture, + _Out_opt_ ID3D11ShaderResourceView** textureView, + _In_ size_t maxsize ) { if (!d3dDevice || !fileName || (!texture && !textureView)) {