Loading Kits/ATGTK/RenderTexture.h +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ namespace DX DirectX::XMStoreFloat4(reinterpret_cast<DirectX::XMFLOAT4*>(m_clearColor), color); } ID3D12Resource* GetResource() const { return m_resource.Get(); } private: Microsoft::WRL::ComPtr<ID3D12Device> m_device; Microsoft::WRL::ComPtr<ID3D12Resource> m_resource; Loading Kits/DirectXTK/Readme.txt +8 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ DirectXTK - the DirectX Tool Kit for DirectX 11 Copyright (c) Microsoft Corporation. All rights reserved. July 28, 2017 September 22, 2017 This package contains the "DirectX Tool Kit", a collection of helper classes for writing Direct3D 11 C++ code for Universal Windows Platform (UWP) apps for Windows 10, Loading Loading @@ -82,6 +82,13 @@ https://opensource.microsoft.com/codeofconduct/ RELEASE HISTORY --------------- September 22, 2017 Updated for VS 2017 15.3 update /permissive- changes ScreenGrab updated to use non-sRGB metadata for PNG Mouse use of WM_INPUT updated for Remote Desktop scenarios Fix for CMO load issue when no materials are defined xwbtool: added -flist option July 28, 2017 Fix for WIC writer when codec target format requires a palette Code cleanup Loading Kits/DirectXTK/Src/ModelLoadCMO.cpp +24 −3 Original line number Diff line number Diff line Loading @@ -159,6 +159,18 @@ namespace VSD3DStarter #pragma pack(pop) const Material s_defMaterial = { { 0.2f, 0.2f, 0.2f, 1.f }, { 0.8f, 0.8f, 0.8f, 1.f }, { 0.0f, 0.0f, 0.0f, 1.f }, 1.f, { 0.0f, 0.0f, 0.0f, 1.0f }, { 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f }, }; }; // namespace static_assert( sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect" ); Loading Loading @@ -346,6 +358,15 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c assert( materials.size() == *nMats ); if (materials.empty()) { // Add default material if none defined MaterialRecordCMO m; m.pMaterial = &VSD3DStarter::s_defMaterial; m.name = L"Default"; materials.emplace_back(m); } // Skeletal data? auto bSkeleton = reinterpret_cast<const BYTE*>( meshData + usedSize ); usedSize += sizeof(BYTE); Loading Loading @@ -682,7 +703,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c continue; if ( (sm.IndexBufferIndex >= *nIBs) || (sm.MaterialIndex >= *nMats) ) || (sm.MaterialIndex >= materials.size()) ) throw std::exception("Invalid submesh found\n"); XMMATRIX uvTransform = XMLoadFloat4x4( &materials[ sm.MaterialIndex ].pMaterial->UVTransform ); Loading Loading @@ -744,7 +765,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c assert( vbs.size() == *nVBs ); // Create Effects for( UINT j = 0; j < *nMats; ++j ) for( size_t j = 0; j < materials.size(); ++j ) { auto& m = materials[ j ]; Loading Loading @@ -803,7 +824,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c if ( (sm.IndexBufferIndex >= *nIBs) || (sm.VertexBufferIndex >= *nVBs) || (sm.MaterialIndex >= *nMats) ) || (sm.MaterialIndex >= materials.size()) ) throw std::exception("Invalid submesh found\n"); auto& mat = materials[ sm.MaterialIndex ]; Loading Kits/DirectXTK/Src/Mouse.cpp +32 −5 Original line number Diff line number Diff line Loading @@ -547,6 +547,8 @@ public: mMode(MODE_ABSOLUTE), mLastX(0), mLastY(0), mRelativeX(INT32_MAX), mRelativeY(INT32_MAX), mInFocus(true) { if ( s_mouse ) Loading Loading @@ -676,6 +678,8 @@ private: int mLastX; int mLastY; int mRelativeX; int mRelativeY; bool mInFocus; Loading Loading @@ -761,6 +765,8 @@ void Mouse::ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) pImpl->mMode = MODE_RELATIVE; pImpl->mState.x = pImpl->mState.y = 0; pImpl->mRelativeX = INT32_MAX; pImpl->mRelativeY = INT32_MAX; ShowCursor(FALSE); Loading Loading @@ -819,9 +825,30 @@ void Mouse::ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) ResetEvent(pImpl->mRelativeRead.get()); } else if (raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP) { // This is used to make Remote Desktop sessons work const int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); const int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); int x = static_cast<int>((float(raw.data.mouse.lLastX) / 65535.0f) * width); int y = static_cast<int>((float(raw.data.mouse.lLastY) / 65535.0f) * height); if (pImpl->mRelativeX == INT32_MAX) { pImpl->mState.x = pImpl->mState.y = 0; } else { pImpl->mState.x = x - pImpl->mRelativeX; pImpl->mState.y = y - pImpl->mRelativeY; } // Note that with Remote Desktop input comes through as MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP, // so this imlementation doesn't suport relative mode via remote desktop. pImpl->mRelativeX = x; pImpl->mRelativeY = y; ResetEvent(pImpl->mRelativeRead.get()); } } } return; Loading Kits/DirectXTK/Src/ScreenGrab.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -531,6 +531,16 @@ HRESULT DirectX::SaveWICTextureToFile( ID3D11DeviceContext* pContext, value.bVal = 0; (void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value); } else { // add gAMA chunk with gamma 1.0 value.vt = VT_UI4; value.uintVal = 100000; // gama value * 100,000 -- i.e. gamma 1.0 (void)metawriter->SetMetadataByName(L"/gAMA/ImageGamma", &value); // remove sRGB chunk which is added by default. (void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent"); } } #if defined(_XBOX_ONE) && defined(_TITLE) else if ( memcmp( &guidContainerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID) ) == 0 ) Loading Loading
Kits/ATGTK/RenderTexture.h +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ namespace DX DirectX::XMStoreFloat4(reinterpret_cast<DirectX::XMFLOAT4*>(m_clearColor), color); } ID3D12Resource* GetResource() const { return m_resource.Get(); } private: Microsoft::WRL::ComPtr<ID3D12Device> m_device; Microsoft::WRL::ComPtr<ID3D12Resource> m_resource; Loading
Kits/DirectXTK/Readme.txt +8 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ DirectXTK - the DirectX Tool Kit for DirectX 11 Copyright (c) Microsoft Corporation. All rights reserved. July 28, 2017 September 22, 2017 This package contains the "DirectX Tool Kit", a collection of helper classes for writing Direct3D 11 C++ code for Universal Windows Platform (UWP) apps for Windows 10, Loading Loading @@ -82,6 +82,13 @@ https://opensource.microsoft.com/codeofconduct/ RELEASE HISTORY --------------- September 22, 2017 Updated for VS 2017 15.3 update /permissive- changes ScreenGrab updated to use non-sRGB metadata for PNG Mouse use of WM_INPUT updated for Remote Desktop scenarios Fix for CMO load issue when no materials are defined xwbtool: added -flist option July 28, 2017 Fix for WIC writer when codec target format requires a palette Code cleanup Loading
Kits/DirectXTK/Src/ModelLoadCMO.cpp +24 −3 Original line number Diff line number Diff line Loading @@ -159,6 +159,18 @@ namespace VSD3DStarter #pragma pack(pop) const Material s_defMaterial = { { 0.2f, 0.2f, 0.2f, 1.f }, { 0.8f, 0.8f, 0.8f, 1.f }, { 0.0f, 0.0f, 0.0f, 1.f }, 1.f, { 0.0f, 0.0f, 0.0f, 1.0f }, { 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f }, }; }; // namespace static_assert( sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect" ); Loading Loading @@ -346,6 +358,15 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c assert( materials.size() == *nMats ); if (materials.empty()) { // Add default material if none defined MaterialRecordCMO m; m.pMaterial = &VSD3DStarter::s_defMaterial; m.name = L"Default"; materials.emplace_back(m); } // Skeletal data? auto bSkeleton = reinterpret_cast<const BYTE*>( meshData + usedSize ); usedSize += sizeof(BYTE); Loading Loading @@ -682,7 +703,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c continue; if ( (sm.IndexBufferIndex >= *nIBs) || (sm.MaterialIndex >= *nMats) ) || (sm.MaterialIndex >= materials.size()) ) throw std::exception("Invalid submesh found\n"); XMMATRIX uvTransform = XMLoadFloat4x4( &materials[ sm.MaterialIndex ].pMaterial->UVTransform ); Loading Loading @@ -744,7 +765,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c assert( vbs.size() == *nVBs ); // Create Effects for( UINT j = 0; j < *nMats; ++j ) for( size_t j = 0; j < materials.size(); ++j ) { auto& m = materials[ j ]; Loading Loading @@ -803,7 +824,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, c if ( (sm.IndexBufferIndex >= *nIBs) || (sm.VertexBufferIndex >= *nVBs) || (sm.MaterialIndex >= *nMats) ) || (sm.MaterialIndex >= materials.size()) ) throw std::exception("Invalid submesh found\n"); auto& mat = materials[ sm.MaterialIndex ]; Loading
Kits/DirectXTK/Src/Mouse.cpp +32 −5 Original line number Diff line number Diff line Loading @@ -547,6 +547,8 @@ public: mMode(MODE_ABSOLUTE), mLastX(0), mLastY(0), mRelativeX(INT32_MAX), mRelativeY(INT32_MAX), mInFocus(true) { if ( s_mouse ) Loading Loading @@ -676,6 +678,8 @@ private: int mLastX; int mLastY; int mRelativeX; int mRelativeY; bool mInFocus; Loading Loading @@ -761,6 +765,8 @@ void Mouse::ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) pImpl->mMode = MODE_RELATIVE; pImpl->mState.x = pImpl->mState.y = 0; pImpl->mRelativeX = INT32_MAX; pImpl->mRelativeY = INT32_MAX; ShowCursor(FALSE); Loading Loading @@ -819,9 +825,30 @@ void Mouse::ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) ResetEvent(pImpl->mRelativeRead.get()); } else if (raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP) { // This is used to make Remote Desktop sessons work const int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); const int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); int x = static_cast<int>((float(raw.data.mouse.lLastX) / 65535.0f) * width); int y = static_cast<int>((float(raw.data.mouse.lLastY) / 65535.0f) * height); if (pImpl->mRelativeX == INT32_MAX) { pImpl->mState.x = pImpl->mState.y = 0; } else { pImpl->mState.x = x - pImpl->mRelativeX; pImpl->mState.y = y - pImpl->mRelativeY; } // Note that with Remote Desktop input comes through as MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP, // so this imlementation doesn't suport relative mode via remote desktop. pImpl->mRelativeX = x; pImpl->mRelativeY = y; ResetEvent(pImpl->mRelativeRead.get()); } } } return; Loading
Kits/DirectXTK/Src/ScreenGrab.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -531,6 +531,16 @@ HRESULT DirectX::SaveWICTextureToFile( ID3D11DeviceContext* pContext, value.bVal = 0; (void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value); } else { // add gAMA chunk with gamma 1.0 value.vt = VT_UI4; value.uintVal = 100000; // gama value * 100,000 -- i.e. gamma 1.0 (void)metawriter->SetMetadataByName(L"/gAMA/ImageGamma", &value); // remove sRGB chunk which is added by default. (void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent"); } } #if defined(_XBOX_ONE) && defined(_TITLE) else if ( memcmp( &guidContainerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID) ) == 0 ) Loading