Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Updated DXUT, FX11 for July 12, 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Jul 12, 2018
1 parent d9356e9 commit c959120
Show file tree
Hide file tree
Showing 14 changed files with 236 additions and 95 deletions.
4 changes: 2 additions & 2 deletions DXUT/Core/DDSTextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ namespace
{
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };

typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
typedef std::unique_ptr<void, handle_closer> 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<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength])
Expand Down
2 changes: 1 addition & 1 deletion DXUT/Core/DXUT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions DXUT/Core/ScreenGrab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ namespace
//-----------------------------------------------------------------------------
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };

typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
typedef std::unique_ptr<void, handle_closer> 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
{
Expand Down Expand Up @@ -703,15 +703,15 @@ 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(
CLSID_WICImagingFactory2,
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory2),
factory
ifactory
);

if ( SUCCEEDED(hr) )
Expand All @@ -727,7 +727,7 @@ namespace
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
factory
ifactory
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
Expand All @@ -737,7 +737,7 @@ namespace
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
factory) ) ? TRUE : FALSE;
ifactory) ) ? TRUE : FALSE;
#endif
}, nullptr, reinterpret_cast<LPVOID*>(&factory));

Expand Down Expand Up @@ -988,7 +988,7 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
auto_delete_file_wic delonfail(stream, fileName);

ComPtr<IWICBitmapEncoder> encoder;
hr = pWIC->CreateEncoder( guidContainerFormat, 0, encoder.GetAddressOf() );
hr = pWIC->CreateEncoder( guidContainerFormat, nullptr, encoder.GetAddressOf() );
if ( FAILED(hr) )
return hr;

Expand Down
20 changes: 10 additions & 10 deletions DXUT/Core/WICTextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ 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(
CLSID_WICImagingFactory2,
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory2),
factory
ifactory
);

if (SUCCEEDED(hr))
Expand All @@ -196,7 +196,7 @@ namespace
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
factory
ifactory
);
return SUCCEEDED(hr) ? TRUE : FALSE;
}
Expand All @@ -206,7 +206,7 @@ namespace
nullptr,
CLSCTX_INPROC_SERVER,
__uuidof(IWICImagingFactory),
factory)) ? TRUE : FALSE;
ifactory)) ? TRUE : FALSE;
#endif
}, nullptr, reinterpret_cast<LPVOID*>(&factory));

Expand Down Expand Up @@ -507,7 +507,7 @@ namespace
&& theight == height)
{
// No format conversion or resize needed
hr = frame->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
hr = frame->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
if (FAILED(hr))
return hr;
}
Expand Down Expand Up @@ -535,7 +535,7 @@ namespace
if (memcmp(&convertGUID, &pfScaler, sizeof(GUID)) == 0)
{
// No format conversion needed
hr = scaler->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
hr = scaler->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
if (FAILED(hr))
return hr;
}
Expand All @@ -557,7 +557,7 @@ namespace
if (FAILED(hr))
return hr;

hr = FC->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
hr = FC->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
if (FAILED(hr))
return hr;
}
Expand Down Expand Up @@ -585,7 +585,7 @@ namespace
if (FAILED(hr))
return hr;

hr = FC->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
hr = FC->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), temp.get());
if (FAILED(hr))
return hr;
}
Expand Down Expand Up @@ -766,7 +766,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(ID3D11Device* d3dDevice,

// Initialize WIC
ComPtr<IWICBitmapDecoder> decoder;
hr = pWIC->CreateDecoderFromStream(stream.Get(), 0, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf());
hr = pWIC->CreateDecoderFromStream(stream.Get(), nullptr, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf());
if (FAILED(hr))
return hr;

Expand Down Expand Up @@ -868,7 +868,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(ID3D11Device* d3dDevice,

// Initialize WIC
ComPtr<IWICBitmapDecoder> 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;

Expand Down
6 changes: 3 additions & 3 deletions DXUT/Optional/DXUTLockFreePipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ template <BYTE cbBufferSizeLog2> 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& );
Expand Down
4 changes: 2 additions & 2 deletions DXUT/Optional/SDKmisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ namespace

struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };

typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
typedef std::unique_ptr<void, handle_closer> 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
Expand Down
5 changes: 4 additions & 1 deletion DXUT/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions Effects11/EffectAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ using namespace D3DX11Effects;

struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };

typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
typedef std::unique_ptr<void, handle_closer> 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; }

//-------------------------------------------------------------------------------------

Expand Down
77 changes: 56 additions & 21 deletions Effects11/Effects11_2015.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,34 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns:atg="http://atg.xbox.com" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{8e114980-c1a3-4ada-ad7c-83caadf5daeb}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
<Filter Include="Inc">
<UniqueIdentifier>{cdbb4066-89f4-4f59-b5c0-67f60b8e0c09}</UniqueIdentifier>
</Filter>
<Filter Include="Src">
<UniqueIdentifier>{48f2cc16-4ce6-4796-823b-f346f8997fde}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<CLInclude Include="pchfx.h" />
<CLInclude Include=".\Inc\d3dx11effect.h" />
<CLInclude Include=".\Inc\d3dxglobal.h" />
<CLInclude Include=".\Binary\EffectBinaryFormat.h" />
<CLInclude Include=".\Binary\EffectStateBase11.h" />
<CLInclude Include=".\Binary\EffectStates11.h" />
<CLInclude Include=".\Binary\SOParser.h" />
<ClCompile Include="d3dxGlobal.cpp" />
<CLInclude Include="Effect.h" />
<ClCompile Include="EffectAPI.cpp" />
<ClCompile Include="EffectLoad.cpp" />
<CLInclude Include="EffectLoad.h" />
<ClCompile Include="EffectNonRuntime.cpp" />
<ClCompile Include="EffectReflection.cpp" />
<ClCompile Include="EffectRuntime.cpp" />
<None Include="EffectVariable.inl" />
<CLInclude Include="IUnknownImp.h" />
<CLInclude Include=".\Inc\d3dx11effect.h">
<Filter>Inc</Filter>
</CLInclude>
<CLInclude Include=".\Inc\d3dxglobal.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include="Effect.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include=".\Binary\EffectBinaryFormat.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include="EffectLoad.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include=".\Binary\EffectStateBase11.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include=".\Binary\EffectStates11.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include="IUnknownImp.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include="pchfx.h">
<Filter>Src</Filter>
</CLInclude>
<CLInclude Include=".\Binary\SOParser.h">
<Filter>Src</Filter>
</CLInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="d3dxGlobal.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="EffectAPI.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="EffectLoad.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="EffectNonRuntime.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="EffectReflection.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="EffectRuntime.cpp">
<Filter>Src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="EffectVariable.inl">
<Filter>Src</Filter>
</None>
</ItemGroup>
<ItemGroup>
</ItemGroup>
Expand Down
Loading

0 comments on commit c959120

Please sign in to comment.