diff --git a/DXUT/Core/DDSTextureLoader.cpp b/DXUT/Core/DDSTextureLoader.cpp index 3d72d9e4..fad01411 100644 --- a/DXUT/Core/DDSTextureLoader.cpp +++ b/DXUT/Core/DDSTextureLoader.cpp @@ -121,9 +121,9 @@ namespace { struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; - typedef public std::unique_ptr ScopedHandle; + typedef std::unique_ptr ScopedHandle; - inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; } + inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } template inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength]) diff --git a/DXUT/Core/DXUT.h b/DXUT/Core/DXUT.h index a55e71d8..76242392 100644 --- a/DXUT/Core/DXUT.h +++ b/DXUT/Core/DXUT.h @@ -131,7 +131,7 @@ ((DWORD)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) #endif -#define DXUT_VERSION 1120 +#define DXUT_VERSION 1121 //-------------------------------------------------------------------------------------- // Structs diff --git a/DXUT/Core/ScreenGrab.cpp b/DXUT/Core/ScreenGrab.cpp index deb693c4..4296091c 100644 --- a/DXUT/Core/ScreenGrab.cpp +++ b/DXUT/Core/ScreenGrab.cpp @@ -197,9 +197,9 @@ namespace //----------------------------------------------------------------------------- struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; - typedef public std::unique_ptr ScopedHandle; + typedef std::unique_ptr ScopedHandle; - inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; } + inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } class auto_delete_file { @@ -703,7 +703,7 @@ namespace IWICImagingFactory* factory = nullptr; InitOnceExecuteOnce(&s_initOnce, - [](PINIT_ONCE, PVOID, LPVOID *factory) -> BOOL + [](PINIT_ONCE, PVOID, LPVOID *ifactory) -> BOOL { #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE) HRESULT hr = CoCreateInstance( @@ -711,7 +711,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory2), - factory + ifactory ); if ( SUCCEEDED(hr) ) @@ -727,7 +727,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), - factory + ifactory ); return SUCCEEDED(hr) ? TRUE : FALSE; } @@ -737,7 +737,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), - factory) ) ? TRUE : FALSE; + ifactory) ) ? TRUE : FALSE; #endif }, nullptr, reinterpret_cast(&factory)); @@ -988,7 +988,7 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, auto_delete_file_wic delonfail(stream, fileName); ComPtr encoder; - hr = pWIC->CreateEncoder( guidContainerFormat, 0, encoder.GetAddressOf() ); + hr = pWIC->CreateEncoder( guidContainerFormat, nullptr, encoder.GetAddressOf() ); if ( FAILED(hr) ) return hr; diff --git a/DXUT/Core/WICTextureLoader.cpp b/DXUT/Core/WICTextureLoader.cpp index a5960f26..f74bee45 100644 --- a/DXUT/Core/WICTextureLoader.cpp +++ b/DXUT/Core/WICTextureLoader.cpp @@ -172,7 +172,7 @@ namespace IWICImagingFactory* factory = nullptr; InitOnceExecuteOnce(&s_initOnce, - [](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL + [](PINIT_ONCE, PVOID, PVOID *ifactory) -> BOOL { #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE) HRESULT hr = CoCreateInstance( @@ -180,7 +180,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory2), - factory + ifactory ); if (SUCCEEDED(hr)) @@ -196,7 +196,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), - factory + ifactory ); return SUCCEEDED(hr) ? TRUE : FALSE; } @@ -206,7 +206,7 @@ namespace nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), - factory)) ? TRUE : FALSE; + ifactory)) ? TRUE : FALSE; #endif }, nullptr, reinterpret_cast(&factory)); @@ -507,7 +507,7 @@ namespace && theight == height) { // No format conversion or resize needed - hr = frame->CopyPixels(0, static_cast(rowPitch), static_cast(imageSize), temp.get()); + hr = frame->CopyPixels(nullptr, static_cast(rowPitch), static_cast(imageSize), temp.get()); if (FAILED(hr)) return hr; } @@ -535,7 +535,7 @@ namespace if (memcmp(&convertGUID, &pfScaler, sizeof(GUID)) == 0) { // No format conversion needed - hr = scaler->CopyPixels(0, static_cast(rowPitch), static_cast(imageSize), temp.get()); + hr = scaler->CopyPixels(nullptr, static_cast(rowPitch), static_cast(imageSize), temp.get()); if (FAILED(hr)) return hr; } @@ -557,7 +557,7 @@ namespace if (FAILED(hr)) return hr; - hr = FC->CopyPixels(0, static_cast(rowPitch), static_cast(imageSize), temp.get()); + hr = FC->CopyPixels(nullptr, static_cast(rowPitch), static_cast(imageSize), temp.get()); if (FAILED(hr)) return hr; } @@ -585,7 +585,7 @@ namespace if (FAILED(hr)) return hr; - hr = FC->CopyPixels(0, static_cast(rowPitch), static_cast(imageSize), temp.get()); + hr = FC->CopyPixels(nullptr, static_cast(rowPitch), static_cast(imageSize), temp.get()); if (FAILED(hr)) return hr; } @@ -766,7 +766,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(ID3D11Device* d3dDevice, // Initialize WIC ComPtr decoder; - hr = pWIC->CreateDecoderFromStream(stream.Get(), 0, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf()); + hr = pWIC->CreateDecoderFromStream(stream.Get(), nullptr, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf()); if (FAILED(hr)) return hr; @@ -868,7 +868,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(ID3D11Device* d3dDevice, // Initialize WIC ComPtr decoder; - HRESULT hr = pWIC->CreateDecoderFromFilename(fileName, 0, GENERIC_READ, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf()); + HRESULT hr = pWIC->CreateDecoderFromFilename(fileName, nullptr, GENERIC_READ, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf()); if (FAILED(hr)) return hr; diff --git a/DXUT/Optional/DXUTLockFreePipe.h b/DXUT/Optional/DXUTLockFreePipe.h index b41d34a9..7e947597 100644 --- a/DXUT/Optional/DXUTLockFreePipe.h +++ b/DXUT/Optional/DXUTLockFreePipe.h @@ -203,9 +203,9 @@ template class DXUTLockFreePipe private: // Values derived from the buffer size template parameter // - const static BYTE c_cbBufferSizeLog2 = __min( cbBufferSizeLog2, 31 ); - const static DWORD c_cbBufferSize = ( 1 << c_cbBufferSizeLog2 ); - const static DWORD c_sizeMask = c_cbBufferSize - 1; + static const BYTE c_cbBufferSizeLog2 = __min( cbBufferSizeLog2, 31 ); + static const DWORD c_cbBufferSize = ( 1 << c_cbBufferSizeLog2 ); + static const DWORD c_sizeMask = c_cbBufferSize - 1; // Leave these private and undefined to prevent their use DXUTLockFreePipe( const DXUTLockFreePipe& ); diff --git a/DXUT/Optional/SDKmisc.cpp b/DXUT/Optional/SDKmisc.cpp index 47ed247b..943af474 100644 --- a/DXUT/Optional/SDKmisc.cpp +++ b/DXUT/Optional/SDKmisc.cpp @@ -467,9 +467,9 @@ namespace struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; -typedef public std::unique_ptr ScopedHandle; +typedef std::unique_ptr ScopedHandle; -inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; } +inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } class CIncludeHandler : public ID3DInclude // Not as robust as D3D_COMPILE_STANDARD_FILE_INCLUDE, but it works in most cases diff --git a/DXUT/ReadMe.txt b/DXUT/ReadMe.txt index cc888f0d..8f214928 100644 --- a/DXUT/ReadMe.txt +++ b/DXUT/ReadMe.txt @@ -3,7 +3,7 @@ DXUT FOR DIRECT3D 11 Copyright (c) Microsoft Corporation. All rights reserved. -May 31, 2018 +July 12, 2018 DXUT is a "GLUT"-like framework for Direct3D 11.x Win32 desktop applications; primarily samples, demos, and prototypes. @@ -68,6 +68,9 @@ RELEASE NOTES RELEASE HISTORY --------------- +July 12, 2018 + Code cleanup + May 31, 2018 VS 2017 updated for Windows 10 April 2018 Update SDK (17134) diff --git a/Effects11/EffectAPI.cpp b/Effects11/EffectAPI.cpp index c25f337b..4c67e046 100644 --- a/Effects11/EffectAPI.cpp +++ b/Effects11/EffectAPI.cpp @@ -19,9 +19,9 @@ using namespace D3DX11Effects; struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; -typedef public std::unique_ptr ScopedHandle; +typedef std::unique_ptr ScopedHandle; -inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; } +inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } //------------------------------------------------------------------------------------- diff --git a/Effects11/Effects11_2015.vcxproj.filters b/Effects11/Effects11_2015.vcxproj.filters index c49ec9df..66376893 100644 --- a/Effects11/Effects11_2015.vcxproj.filters +++ b/Effects11/Effects11_2015.vcxproj.filters @@ -1,34 +1,69 @@  - - {8e114980-c1a3-4ada-ad7c-83caadf5daeb} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + {cdbb4066-89f4-4f59-b5c0-67f60b8e0c09} + + + {48f2cc16-4ce6-4796-823b-f346f8997fde} - - - - - - - - - - - - - - - - - - + + Inc + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + diff --git a/Effects11/Effects11_2015_Win10.vcxproj.filters b/Effects11/Effects11_2015_Win10.vcxproj.filters index c49ec9df..6c2bc802 100644 --- a/Effects11/Effects11_2015_Win10.vcxproj.filters +++ b/Effects11/Effects11_2015_Win10.vcxproj.filters @@ -1,34 +1,69 @@  - - {8e114980-c1a3-4ada-ad7c-83caadf5daeb} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + {fa7b6da8-7a7f-4eec-baf0-aebc714f4872} + + + {3adc343c-8398-4bba-9b7d-2c9a5d191b46} - - - - - - - - - - - - - - - - - - + + Inc + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + diff --git a/Effects11/Effects11_2017_Win10.vcxproj.filters b/Effects11/Effects11_2017_Win10.vcxproj.filters index c49ec9df..4594ca66 100644 --- a/Effects11/Effects11_2017_Win10.vcxproj.filters +++ b/Effects11/Effects11_2017_Win10.vcxproj.filters @@ -1,34 +1,69 @@  - - {8e114980-c1a3-4ada-ad7c-83caadf5daeb} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + {b7f31db2-7730-4979-b0dd-660e7862c8d1} + + + {19d240df-a29a-45ca-a238-448ade961d0e} - - - - - - - - - - - - - - - - - - + + Inc + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + + + Src + diff --git a/Effects11/ReadMe.txt b/Effects11/ReadMe.txt index 72939a09..639387fd 100644 --- a/Effects11/ReadMe.txt +++ b/Effects11/ReadMe.txt @@ -3,7 +3,7 @@ EFFECTS FOR DIRECT3D 11 (FX11) Copyright (c) Microsoft Corporation. All rights reserved. -May 31, 2018 +July 12, 2018 Effects for Direct3D 11 (FX11) is a management runtime for authoring HLSL shaders, render state, and runtime variables together. @@ -62,6 +62,10 @@ in a future update. RELEASE HISTORY --------------- +July 12, 2018 (11.25) + Added D3DX11DebugMute function + Minor project and code cleanup + May 31, 2018 (11.24) VS 2017 updated for Windows 10 April 2018 Update SDK (17134) diff --git a/Effects11/d3dxGlobal.cpp b/Effects11/d3dxGlobal.cpp index dd3574d6..3cca34fd 100644 --- a/Effects11/d3dxGlobal.cpp +++ b/Effects11/d3dxGlobal.cpp @@ -367,14 +367,26 @@ uint32_t CDataBlockStore::GetSize() ////////////////////////////////////////////////////////////////////////// +static bool s_mute = false; + +bool D3DX11DebugMute(bool mute) +{ + bool previous = s_mute; + s_mute = mute; + return previous; +} + #ifdef _DEBUG _Use_decl_annotations_ void __cdecl D3DXDebugPrintf(UINT lvl, LPCSTR szFormat, ...) { + if (s_mute) + return; + UNREFERENCED_PARAMETER(lvl); - char strA[4096]; - char strB[4096]; + char strA[4096] = {}; + char strB[4096] = {}; va_list ap; va_start(ap, szFormat); diff --git a/Effects11/inc/d3dx11effect.h b/Effects11/inc/d3dx11effect.h index c83b5c52..0cc3c36c 100644 --- a/Effects11/inc/d3dx11effect.h +++ b/Effects11/inc/d3dx11effect.h @@ -11,7 +11,7 @@ #pragma once -#define D3DX11_EFFECTS_VERSION 1124 +#define D3DX11_EFFECTS_VERSION 1125 #if defined(_XBOX_ONE) && defined(_TITLE) #include @@ -1191,6 +1191,23 @@ HRESULT D3DX11CompileEffectFromFile( _In_z_ LPCWSTR pFileName, _Out_ ID3DX11Effect **ppEffect, _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors ); + +//---------------------------------------------------------------------------- +// D3DX11DebugMute +// +// Controls the output of diagnostic information in DEBUG builds. No effect +// in RELEASE builds. +// +// Returns the previous state so you can do temporary suppression like: +// +// bool oldmute = D3DX11DebugMute(true); +// ... +// D3DX11DebugMute(oldmute); +// +//---------------------------------------------------------------------------- + +bool D3DX11DebugMute(bool mute); + #ifdef __cplusplus } #endif //__cplusplus