Skip to content

Commit

Permalink
Modify arguments and Change Submodule to Direct
Browse files Browse the repository at this point in the history
  • Loading branch information
W298 committed Nov 27, 2023
1 parent e3e073a commit e4ccf75
Show file tree
Hide file tree
Showing 163 changed files with 67,547 additions and 55 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

34 changes: 21 additions & 13 deletions Common/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ DeviceResources::DeviceResources(
// Destructor for DeviceResources.
DeviceResources::~DeviceResources()
{
ThrowIfFailed(m_swapChain->SetFullscreenState(FALSE, NULL));
// Ensure that the GPU is no longer referencing resources that are about to be destroyed.
// Ensure that the GPU is no longer referencing resources that are about to be destroyed.
WaitForGpu();

if (m_fullScreenMode) ThrowIfFailed(m_swapChain->SetFullscreenState(FALSE, nullptr));
}

// Configures the Direct3D device, and stores handles to it and the device context.
void DeviceResources::CreateDeviceResources()
void DeviceResources::CreateDeviceResources(BOOL fullScreenMode)
{
#if defined(_DEBUG)
// Enable the debug layer (requires the Graphics Tools "optional feature").
Expand Down Expand Up @@ -123,6 +124,10 @@ void DeviceResources::CreateDeviceResources()

ThrowIfFailed(CreateDXGIFactory2(m_dxgiFactoryFlags, IID_PPV_ARGS(m_dxgiFactory.ReleaseAndGetAddressOf())));

m_fullScreenMode = fullScreenMode;
if (m_fullScreenMode)
m_options = 0x0;

// Determines whether tearing support is available for fullscreen borderless windows.
if (m_options & c_AllowTearing)
{
Expand Down Expand Up @@ -337,7 +342,7 @@ void DeviceResources::CreateWindowSizeDependentResources()
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
swapChainDesc.Flags = m_options;
swapChainDesc.Flags = (m_options & c_AllowTearing) ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0u;

DXGI_SWAP_CHAIN_FULLSCREEN_DESC fsSwapChainDesc = {};
fsSwapChainDesc.Windowed = TRUE;
Expand All @@ -357,15 +362,18 @@ void DeviceResources::CreateWindowSizeDependentResources()

// This class does not support exclusive full-screen mode and prevents DXGI from responding to the ALT+ENTER shortcut
ThrowIfFailed(m_dxgiFactory->MakeWindowAssociation(m_window, DXGI_MWA_NO_ALT_ENTER));
ThrowIfFailed(m_swapChain->SetFullscreenState(TRUE, NULL));

ThrowIfFailed(m_swapChain->ResizeBuffers(
m_backBufferCount,
backBufferWidth,
backBufferHeight,
backBufferFormat,
m_options
));
if (m_fullScreenMode)
{
ThrowIfFailed(m_swapChain->SetFullscreenState(TRUE, NULL));
ThrowIfFailed(m_swapChain->ResizeBuffers(
m_backBufferCount,
backBufferWidth,
backBufferHeight,
backBufferFormat,
m_options
));
}
}

// Handle color space settings for HDR
Expand Down Expand Up @@ -512,7 +520,7 @@ void DeviceResources::HandleDeviceLost()
m_d3dDevice.Reset();
m_dxgiFactory.Reset();

CreateDeviceResources();
CreateDeviceResources(m_fullScreenMode);
CreateWindowSizeDependentResources();

if (m_deviceNotify)
Expand Down
4 changes: 3 additions & 1 deletion Common/DeviceResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace DX
DeviceResources(DeviceResources const&) = delete;
DeviceResources& operator= (DeviceResources const&) = delete;

void CreateDeviceResources();
void CreateDeviceResources(BOOL fullScreenMode);
void CreateWindowSizeDependentResources();
void SetWindow(HWND window, int width, int height) noexcept;
bool WindowSizeChanged(int width, int height);
Expand Down Expand Up @@ -147,5 +147,7 @@ namespace DX

// The IDeviceNotify can be held directly as it owns the DeviceResources.
IDeviceNotify* m_deviceNotify;

BOOL m_fullScreenMode;
};
}
29 changes: 29 additions & 0 deletions Common/DirectXTK12/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*.psess
*.vsp
*.log
*.err
*.wrn
*.suo
*.sdf
*.user
*.i
*.vspscc
*.opensdf
*.opendb
*.ipch
*.cache
*.tlog
*.lastbuildstate
*.ilk
*.VC.db
*.nupkg
.vs
Bin
/Src/Shaders/Compiled/*.inc
/Src/Shaders/Compiled/*.pdb
/ipch
/Tests
/Testing
/wiki
/out
/CMakeUserPresets.json
77 changes: 77 additions & 0 deletions Common/DirectXTK12/.nuget/directxtk12_desktop_2019.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.8.6">
<id>directxtk12_desktop_2019</id>
<version>0.0.0-SpecifyVersionOnCommandline</version>
<title>DirectX Tool Kit for DirectX 12 (VS 2019/2022 Win32 for Windows 10/11)</title>
<authors>Microsoft</authors>
<owners>microsoft,directxtk</owners>
<summary>The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing Direct3D 12 code in C++.</summary>
<description>This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022.

Features:
Audio - low-level audio API using XAudio2
BufferHelpers - C++ helpers for creating D3D resources from CPU data
CommonStates - common D3D state combinations
DDSTextureLoader - light-weight DDS file texture loader
DescriptorHeap - helper for managing DX12 descriptor heaps
DirectXHelpers - misc C++ helpers for D3D programming
Effects - set of built-in shaders for common rendering tasks
EffectPipelineStateDescription - helper for creating PSOs
GamePad - gamepad controller helper using Windows.Gaming.Input
GeometricPrimitive - draws basic shapes such as cubes and spheres
GraphicsMemory - helper for managing graphics memory allocation
Keyboard - keyboard state tracking helper
Model - draws meshes loaded from .CMO, .SDKMESH, or .VBO files
Mouse - mouse helper
PostProcess - set of built-in shaders for common post-processing operations
PrimitiveBatch - simple and efficient way to draw user primitives
RenderTargetState - helper for communicating render target requirements when creating PSOs
ResourceUploadBatch - helper for managing texture resource upload to the GPU
ScreenGrab - light-weight screen shot saver
SimpleMath - simplified C++ wrapper for DirectXMath
SpriteBatch - simple &amp; efficient 2D sprite rendering
SpriteFont - bitmap based text rendering
VertexTypes - structures for commonly used vertex data formats
WICTextureLoader - WIC-based image file texture loader</description>
<releaseNotes>Matches the October 28, 2023 release on GitHub.</releaseNotes>
<projectUrl>http://go.microsoft.com/fwlink/?LinkID=615561</projectUrl>
<repository type="git" url="https://github.com/microsoft/DirectXTK12.git" />
<icon>images\icon.jpg</icon>
<readme>docs\README.md</readme>
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>DirectX DirectXTK DirectXTK12 native nativepackage</tags>
</metadata>

<files>

<file target="docs" src="*.md" />

<file target="include" src="Inc\*" exclude="Inc\XboxDDSTextureLoader.h" />

<file target="native\lib\x86\Debug" src="Bin\Desktop_2019_Win10\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="Bin\Desktop_2019_Win10\Win32\Debug\*.pdb" />

<file target="native\lib\x86\Release" src="Bin\Desktop_2019_Win10\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="Bin\Desktop_2019_Win10\Win32\Release\*.pdb" />

<file target="native\lib\x64\Debug" src="Bin\Desktop_2019_Win10\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="Bin\Desktop_2019_Win10\x64\Debug\*.pdb" />

<file target="native\lib\x64\Release" src="Bin\Desktop_2019_Win10\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="Bin\Desktop_2019_Win10\x64\Release\*.pdb" />

<file target="native\lib\ARM64\Debug" src="Bin\Desktop_2019_Win10\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="Bin\Desktop_2019_Win10\ARM64\Debug\*.pdb" />

<file target="native\lib\ARM64\Release" src="Bin\Desktop_2019_Win10\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="Bin\Desktop_2019_Win10\ARM64\Release\*.pdb" />

<file src=".nuget/directxtk12_desktop_2019.targets" target="build\native" />

<file src=".nuget/icon.jpg" target="images\" />

</files>
</package>
35 changes: 35 additions & 0 deletions Common/DirectXTK12/.nuget/directxtk12_desktop_2019.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Debug" Condition="'$(Configuration.ToLower())' == 'debug'">
<NuGetConfiguration>Debug</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Label="Non_Debug" Condition="'$(Configuration.ToLower())' == 'profile'">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Label="Non_Debug" Condition="'$(Configuration.ToLower())' == 'release'">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Condition="'$(NuGetConfiguration)' == ''">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>

<PropertyGroup>
<directxtk12-LibPath>$(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration)</directxtk12-LibPath>
</PropertyGroup>

<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories>$(directxtk12-LibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>DirectXTK12.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>HAS_DIRECTXTK12;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>

</Project>
77 changes: 77 additions & 0 deletions Common/DirectXTK12/.nuget/directxtk12_uwp.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.8.6">
<id>directxtk12_uwp</id>
<version>0.0.0-SpecifyVersionOnCommandline</version>
<title>DirectX Tool Kit for DirectX 12 (UWP)</title>
<authors>Microsoft</authors>
<owners>microsoft,directxtk</owners>
<summary>The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing Direct3D 12 code in C++.</summary>
<description>This version is for Universal Windows Platform apps on Windows 10 / Windows 11 using Visual Studio 2019 (16.11) or Visual Studio 2022.

Features:
Audio - low-level audio API using XAudio2
BufferHelpers - C++ helpers for creating D3D resources from CPU data
CommonStates - common D3D state combinations
DDSTextureLoader - light-weight DDS file texture loader
DescriptorHeap - helper for managing DX12 descriptor heaps
DirectXHelpers - misc C++ helpers for D3D programming
Effects - set of built-in shaders for common rendering tasks
EffectPipelineStateDescription - helper for creating PSOs
GamePad - gamepad controller helper using Windows.Gaming.Input
GeometricPrimitive - draws basic shapes such as cubes and spheres
GraphicsMemory - helper for managing graphics memory allocation
Keyboard - keyboard state tracking helper
Model - draws meshes loaded from .CMO, .SDKMESH, or .VBO files
Mouse - mouse helper
PostProcess - set of built-in shaders for common post-processing operations
PrimitiveBatch - simple and efficient way to draw user primitives
RenderTargetState - helper for communicating render target requirements when creating PSOs
ResourceUploadBatch - helper for managing texture resource upload to the GPU
ScreenGrab - light-weight screen shot saver
SimpleMath - simplified C++ wrapper for DirectXMath
SpriteBatch - simple &amp; efficient 2D sprite rendering
SpriteFont - bitmap based text rendering
VertexTypes - structures for commonly used vertex data formats
WICTextureLoader - WIC-based image file texture loader</description>
<releaseNotes>Matches the October 28, 2023 release on GitHub.</releaseNotes>
<projectUrl>http://go.microsoft.com/fwlink/?LinkID=615561</projectUrl>
<repository type="git" url="https://github.com/microsoft/DirectXTK12.git" />
<icon>images\icon.jpg</icon>
<readme>docs\README.md</readme>
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>DirectX DirectXTK DirectXTK12 native nativepackage</tags>
</metadata>

<files>

<file target="docs" src="*.md" />

<file target="include" src="Inc\*" exclude="Inc\XboxDDSTextureLoader.h" />

<file target="native\lib\ARM64\Debug" src="Bin\Windows10_2019\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="Bin\Windows10_2019\ARM64\Debug\*.pdb" />

<file target="native\lib\ARM64\Release" src="Bin\Windows10_2019\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="Bin\Windows10_2019\ARM64\Release\*.pdb" />

<file target="native\lib\x86\Debug" src="Bin\Windows10_2019\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="Bin\Windows10_2019\Win32\Debug\*.pdb" />

<file target="native\lib\x86\Release" src="Bin\Windows10_2019\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="Bin\Windows10_2019\Win32\Release\*.pdb" />

<file target="native\lib\x64\Debug" src="Bin\Windows10_2019\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="Bin\Windows10_2019\x64\Debug\*.pdb" />

<file target="native\lib\x64\Release" src="Bin\Windows10_2019\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="Bin\Windows10_2019\x64\Release\*.pdb" />

<file src=".nuget/directxtk12_uwp.targets" target="build\native" />

<file src=".nuget/icon.jpg" target="images\" />

</files>
</package>
35 changes: 35 additions & 0 deletions Common/DirectXTK12/.nuget/directxtk12_uwp.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Debug" Condition="'$(Configuration.ToLower())' == 'debug'">
<NuGetConfiguration>Debug</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Label="Non_Debug" Condition="'$(Configuration.ToLower())' == 'profile'">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Label="Non_Debug" Condition="'$(Configuration.ToLower())' == 'release'">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup Condition="'$(NuGetConfiguration)' == ''">
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>

<PropertyGroup>
<directxtk12-LibPath>$(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration)</directxtk12-LibPath>
</PropertyGroup>

<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories>$(directxtk12-LibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>DirectXTK12.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>HAS_DIRECTXTK12;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>

</Project>
Binary file added Common/DirectXTK12/.nuget/icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e4ccf75

Please sign in to comment.