├── .azuredevops └── pipelines │ ├── DXUT-GitHub-CMake-Dev17.yml │ ├── DXUT-GitHub-CMake.yml │ ├── DXUT-GitHub-Dev17.yml │ ├── DXUT-GitHub-MinGW.yml │ ├── DXUT-GitHub.yml │ └── DXUT-SDL.yml ├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml ├── linters │ ├── .editorconfig-checker.json │ ├── .markdown-lint.yml │ └── .yaml-lint.yml └── workflows │ ├── codeql.yml │ ├── lint.yml │ ├── main.yml │ ├── msbuild.yml │ └── msvc.yml ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── CMakePresets.json ├── CODE_OF_CONDUCT.md ├── Core ├── DDSTextureLoader.cpp ├── DDSTextureLoader.h ├── DXUT.cpp ├── DXUT.h ├── DXUTDevice11.cpp ├── DXUTDevice11.h ├── DXUT_2019_Win10.vcxproj ├── DXUT_2019_Win10.vcxproj.filters ├── DXUT_2022_Win10.vcxproj ├── DXUT_2022_Win10.vcxproj.filters ├── DXUT_DirectXTK_2019_Win10.vcxproj ├── DXUT_DirectXTK_2019_Win10.vcxproj.filters ├── DXUT_DirectXTK_2022_Win10.vcxproj ├── DXUT_DirectXTK_2022_Win10.vcxproj.filters ├── DXUTmisc.cpp ├── DXUTmisc.h ├── ScreenGrab.cpp ├── ScreenGrab.h ├── WICTextureLoader.cpp ├── WICTextureLoader.h ├── dxerr.cpp └── dxerr.h ├── DXUT_2019_Win10.sln ├── DXUT_2022_Win10.sln ├── DXUT_DirectXTK_2019_Win10.sln ├── DXUT_DirectXTK_2022_Win10.sln ├── LICENSE ├── Media └── UI │ ├── Font.dds │ └── dxutcontrols.dds ├── Optional ├── DXUTLockFreePipe.h ├── DXUTOpt_2019_Win10.vcxproj ├── DXUTOpt_2019_Win10.vcxproj.filters ├── DXUTOpt_2022_Win10.vcxproj ├── DXUTOpt_2022_Win10.vcxproj.filters ├── DXUTOpt_DirectXTK_2019_Win10.vcxproj ├── DXUTOpt_DirectXTK_2019_Win10.vcxproj.filters ├── DXUTOpt_DirectXTK_2022_Win10.vcxproj ├── DXUTOpt_DirectXTK_2022_Win10.vcxproj.filters ├── DXUTcamera.cpp ├── DXUTcamera.h ├── DXUTgui.cpp ├── DXUTgui.h ├── DXUTguiIME.cpp ├── DXUTguiIME.h ├── DXUTres.cpp ├── DXUTres.h ├── DXUTsettingsdlg.cpp ├── DXUTsettingsdlg.h ├── ImeUi.cpp ├── ImeUi.h ├── SDKmesh.cpp ├── SDKmesh.h ├── SDKmisc.cpp ├── SDKmisc.h └── directx.ico ├── README.md ├── SECURITY.md └── build ├── CompilerAndLinker.cmake └── DXUT-config.cmake.in /.azuredevops/pipelines/DXUT-GitHub-CMake-Dev17.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | # Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). 7 | 8 | trigger: 9 | branches: 10 | include: 11 | - main 12 | paths: 13 | exclude: 14 | - '*.md' 15 | - LICENSE 16 | - '.github/**' 17 | 18 | pr: 19 | branches: 20 | include: 21 | - main 22 | paths: 23 | exclude: 24 | - '*.md' 25 | - LICENSE 26 | - '.github/**' 27 | drafts: false 28 | 29 | resources: 30 | repositories: 31 | - repository: self 32 | type: git 33 | ref: refs/heads/main 34 | 35 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 36 | 37 | variables: 38 | Codeql.Enabled: false 39 | VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' 40 | VS_GENERATOR: 'Visual Studio 17 2022' 41 | WIN11_SDK: '10.0.22000.0' 42 | 43 | pool: 44 | vmImage: windows-2022 45 | 46 | jobs: 47 | - job: CMAKE_BUILD 48 | displayName: CMake using VS Generator 49 | steps: 50 | - checkout: self 51 | clean: true 52 | fetchTags: false 53 | - task: CMake@1 54 | displayName: 'CMake (MSVC): Config x64' 55 | inputs: 56 | cwd: '$(Build.SourcesDirectory)' 57 | cmakeArgs: > 58 | -G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 59 | - task: CMake@1 60 | displayName: 'CMake (MSVC): Build x64 Debug' 61 | inputs: 62 | cwd: '$(Build.SourcesDirectory)' 63 | cmakeArgs: --build out -v --config Debug 64 | - task: CMake@1 65 | displayName: 'CMake (MSVC): Build x64 Release' 66 | inputs: 67 | cwd: '$(Build.SourcesDirectory)' 68 | cmakeArgs: --build out -v --config RelWithDebInfo 69 | - task: CMake@1 70 | displayName: 'CMake (MSVC): Config x86' 71 | inputs: 72 | cwd: '$(Build.SourcesDirectory)' 73 | cmakeArgs: > 74 | -G "$(VS_GENERATOR)" -A Win32 -B out2 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 75 | - task: CMake@1 76 | displayName: 'CMake (MSVC): Build x86 Debug' 77 | inputs: 78 | cwd: '$(Build.SourcesDirectory)' 79 | cmakeArgs: --build out2 -v --config Debug 80 | - task: CMake@1 81 | displayName: 'CMake (MSVC): Build x86 Release' 82 | inputs: 83 | cwd: '$(Build.SourcesDirectory)' 84 | cmakeArgs: --build out2 -v --config RelWithDebInfo 85 | - task: CMake@1 86 | displayName: 'CMake (MSVC): Config ARM64' 87 | inputs: 88 | cwd: '$(Build.SourcesDirectory)' 89 | cmakeArgs: > 90 | -G "$(VS_GENERATOR)" -A ARM64 -B out3 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 91 | - task: CMake@1 92 | displayName: 'CMake (MSVC): Build ARM64 Debug' 93 | inputs: 94 | cwd: '$(Build.SourcesDirectory)' 95 | cmakeArgs: --build out3 -v --config Debug 96 | - task: CMake@1 97 | displayName: 'CMake (MSVC): Build ARM64 Release' 98 | inputs: 99 | cwd: '$(Build.SourcesDirectory)' 100 | cmakeArgs: --build out3 -v --config RelWithDebInfo 101 | - task: CMake@1 102 | displayName: 'CMake (ClangCl): Config x64' 103 | inputs: 104 | cwd: '$(Build.SourcesDirectory)' 105 | cmakeArgs: > 106 | -G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 107 | - task: CMake@1 108 | displayName: 'CMake (ClangCl): Build x64 Debug' 109 | inputs: 110 | cwd: '$(Build.SourcesDirectory)' 111 | cmakeArgs: --build out4 -v --config Debug 112 | - task: CMake@1 113 | displayName: 'CMake (ClangCl): Build x64 Release' 114 | inputs: 115 | cwd: '$(Build.SourcesDirectory)' 116 | cmakeArgs: --build out4 -v --config RelWithDebInfo 117 | - task: CMake@1 118 | displayName: 'CMake (MSVC Spectre): Config ARM64' 119 | inputs: 120 | cwd: '$(Build.SourcesDirectory)' 121 | cmakeArgs: > 122 | -G "$(VS_GENERATOR)" -A x64 -B out5 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 123 | - task: CMake@1 124 | displayName: 'CMake (MSVC Spectre): Build x64 Debug' 125 | inputs: 126 | cwd: '$(Build.SourcesDirectory)' 127 | cmakeArgs: --build out5 -v --config Debug 128 | - task: CMake@1 129 | displayName: 'CMake (MSVC Spectre): Build x64 Release' 130 | inputs: 131 | cwd: '$(Build.SourcesDirectory)' 132 | cmakeArgs: --build out5 -v --config RelWithDebInfo 133 | - task: CMake@1 134 | displayName: 'CMake (MSVC Spectre): Config ARM64' 135 | inputs: 136 | cwd: '$(Build.SourcesDirectory)' 137 | cmakeArgs: > 138 | -G "$(VS_GENERATOR)" -A ARM64 -B out6 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 139 | - task: CMake@1 140 | displayName: 'CMake (MSVC Spectre): Build ARM64 Debug' 141 | inputs: 142 | cwd: '$(Build.SourcesDirectory)' 143 | cmakeArgs: --build out6 -v --config Debug 144 | - task: CMake@1 145 | displayName: 'CMake (MSVC Spectre): Build ARM64 Release' 146 | inputs: 147 | cwd: '$(Build.SourcesDirectory)' 148 | cmakeArgs: --build out6 -v --config RelWithDebInfo 149 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DXUT-GitHub-CMake.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | # Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). 7 | 8 | trigger: 9 | branches: 10 | include: 11 | - main 12 | paths: 13 | exclude: 14 | - '*.md' 15 | - LICENSE 16 | - '.github/**' 17 | 18 | pr: 19 | branches: 20 | include: 21 | - main 22 | paths: 23 | exclude: 24 | - '*.md' 25 | - LICENSE 26 | - '.github/**' 27 | drafts: false 28 | 29 | resources: 30 | repositories: 31 | - repository: self 32 | type: git 33 | ref: refs/heads/main 34 | 35 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 36 | 37 | variables: 38 | Codeql.Enabled: false 39 | VS_GENERATOR: 'Visual Studio 16 2019' 40 | WIN10_SDK: '10.0.19041.0' 41 | WIN11_SDK: '10.0.22000.0' 42 | 43 | pool: 44 | vmImage: windows-2019 45 | 46 | jobs: 47 | - job: CMAKE_BUILD 48 | displayName: CMake using VS Generator 49 | steps: 50 | - checkout: self 51 | clean: true 52 | fetchTags: false 53 | - task: CMake@1 54 | displayName: 'CMake (MSVC): Config x64' 55 | inputs: 56 | cwd: '$(Build.SourcesDirectory)' 57 | cmakeArgs: > 58 | -G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) 59 | - task: CMake@1 60 | displayName: 'CMake (MSVC): Build x64 Debug' 61 | inputs: 62 | cwd: '$(Build.SourcesDirectory)' 63 | cmakeArgs: --build out -v --config Debug 64 | - task: CMake@1 65 | displayName: 'CMake (MSVC): Build x64 Release' 66 | inputs: 67 | cwd: '$(Build.SourcesDirectory)' 68 | cmakeArgs: --build out -v --config RelWithDebInfo 69 | - task: CMake@1 70 | displayName: 'CMake (MSVC): Config x86' 71 | inputs: 72 | cwd: '$(Build.SourcesDirectory)' 73 | cmakeArgs: > 74 | -G "$(VS_GENERATOR)" -A Win32 -B out2 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) 75 | - task: CMake@1 76 | displayName: 'CMake (MSVC): Build x86 Debug' 77 | inputs: 78 | cwd: '$(Build.SourcesDirectory)' 79 | cmakeArgs: --build out2 -v --config Debug 80 | - task: CMake@1 81 | displayName: 'CMake (MSVC): Build x86 Release' 82 | inputs: 83 | cwd: '$(Build.SourcesDirectory)' 84 | cmakeArgs: --build out2 -v --config RelWithDebInfo 85 | - task: CMake@1 86 | displayName: 'CMake (MSVC): Config ARM64' 87 | inputs: 88 | cwd: '$(Build.SourcesDirectory)' 89 | cmakeArgs: > 90 | -G "$(VS_GENERATOR)" -A ARM64 -B out3 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 91 | - task: CMake@1 92 | displayName: 'CMake (MSVC): Build ARM64 Debug' 93 | inputs: 94 | cwd: '$(Build.SourcesDirectory)' 95 | cmakeArgs: --build out3 -v --config Debug 96 | - task: CMake@1 97 | displayName: 'CMake (MSVC): Build ARM64 Release' 98 | inputs: 99 | cwd: '$(Build.SourcesDirectory)' 100 | cmakeArgs: --build out3 -v --config RelWithDebInfo 101 | - task: CMake@1 102 | displayName: 'CMake (ClangCl): Config x64' 103 | inputs: 104 | cwd: '$(Build.SourcesDirectory)' 105 | cmakeArgs: > 106 | -G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) 107 | - task: CMake@1 108 | displayName: 'CMake (ClangCl): Build x64 Debug' 109 | inputs: 110 | cwd: '$(Build.SourcesDirectory)' 111 | cmakeArgs: --build out4 -v --config Debug 112 | - task: CMake@1 113 | displayName: 'CMake (ClangCl): Build x64 Release' 114 | inputs: 115 | cwd: '$(Build.SourcesDirectory)' 116 | cmakeArgs: --build out4 -v --config RelWithDebInfo 117 | - task: CMake@1 118 | displayName: 'CMake (MSVC Spectre): Config x64' 119 | inputs: 120 | cwd: '$(Build.SourcesDirectory)' 121 | cmakeArgs: > 122 | -G "$(VS_GENERATOR)" -A x64 -B out5 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) 123 | - task: CMake@1 124 | displayName: 'CMake (MSVC Spectre): Build x64 Debug' 125 | inputs: 126 | cwd: '$(Build.SourcesDirectory)' 127 | cmakeArgs: --build out5 -v --config Debug 128 | - task: CMake@1 129 | displayName: 'CMake (MSVC Spectre): Build x64 Release' 130 | inputs: 131 | cwd: '$(Build.SourcesDirectory)' 132 | cmakeArgs: --build out5 -v --config RelWithDebInfo 133 | - task: CMake@1 134 | displayName: 'CMake (MSVC Spectre): Config ARM64' 135 | inputs: 136 | cwd: '$(Build.SourcesDirectory)' 137 | cmakeArgs: > 138 | -G "$(VS_GENERATOR)" -A ARM64 -B out6 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 139 | - task: CMake@1 140 | displayName: 'CMake (MSVC Spectre): Build ARM64 Debug' 141 | inputs: 142 | cwd: '$(Build.SourcesDirectory)' 143 | cmakeArgs: --build out6 -v --config Debug 144 | - task: CMake@1 145 | displayName: 'CMake (MSVC Spectre): Build ARM64 Release' 146 | inputs: 147 | cwd: '$(Build.SourcesDirectory)' 148 | cmakeArgs: --build out6 -v --config RelWithDebInfo 149 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DXUT-GitHub-Dev17.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | # Builds the library for Windows Desktop. 7 | 8 | schedules: 9 | - cron: "0 4 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | # GitHub Actions handles MSBuild for CI/PR 16 | trigger: none 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DXUT-GitHub-Dev17.yml' 24 | 25 | resources: 26 | repositories: 27 | - repository: self 28 | type: git 29 | ref: refs/heads/main 30 | 31 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 32 | 33 | variables: 34 | Codeql.Enabled: false 35 | 36 | pool: 37 | vmImage: windows-2022 38 | 39 | jobs: 40 | - job: DESKTOP_BUILD 41 | displayName: 'Windows Desktop' 42 | timeoutInMinutes: 60 43 | strategy: 44 | maxParallel: 4 45 | matrix: 46 | Release_x64: 47 | BuildPlatform: x64 48 | BuildConfiguration: Release 49 | SpectreMitigation: false 50 | Debug_x64: 51 | BuildPlatform: x64 52 | BuildConfiguration: Debug 53 | SpectreMitigation: false 54 | Release_x86: 55 | BuildPlatform: Win32 56 | BuildConfiguration: Release 57 | SpectreMitigation: false 58 | Debug_x86: 59 | BuildPlatform: Win32 60 | BuildConfiguration: Debug 61 | SpectreMitigation: false 62 | Release_x64_SpectreMitigated: 63 | BuildPlatform: x64 64 | BuildConfiguration: Release 65 | SpectreMitigation: 'Spectre' 66 | Debug_x64_SpectreMitigated: 67 | BuildPlatform: x64 68 | BuildConfiguration: Debug 69 | SpectreMitigation: 'Spectre' 70 | Release_x86_SpectreMitigated: 71 | BuildPlatform: Win32 72 | BuildConfiguration: Release 73 | SpectreMitigation: 'Spectre' 74 | Debug_x86_SpectreMitigated: 75 | BuildPlatform: Win32 76 | BuildConfiguration: Debug 77 | SpectreMitigation: 'Spectre' 78 | steps: 79 | - checkout: self 80 | clean: true 81 | fetchTags: false 82 | - task: VSBuild@1 83 | displayName: Build solution DXUT_2022_Win10.sln 84 | inputs: 85 | solution: DXUT_2022_Win10.sln 86 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 87 | platform: '$(BuildPlatform)' 88 | configuration: '$(BuildConfiguration)' 89 | msbuildArchitecture: x64 90 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DXUT-GitHub-MinGW.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | # Builds the library using the MinGW compiler. 7 | 8 | trigger: 9 | branches: 10 | include: 11 | - main 12 | paths: 13 | exclude: 14 | - '*.md' 15 | - LICENSE 16 | - '.github/**' 17 | 18 | pr: 19 | branches: 20 | include: 21 | - main 22 | paths: 23 | exclude: 24 | - '*.md' 25 | - LICENSE 26 | - '.github/**' 27 | drafts: false 28 | 29 | resources: 30 | repositories: 31 | - repository: self 32 | type: git 33 | ref: refs/heads/main 34 | 35 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 36 | 37 | pool: 38 | vmImage: windows-2022 39 | 40 | variables: 41 | Codeql.Enabled: false 42 | VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake' 43 | GITHUB_PAT: $(GITHUBPUBLICTOKEN) 44 | BASE_URL: https://github.com/brechtsanders/winlibs_mingw/releases/download 45 | URL_MINGW32: $(BASE_URL)/12.2.0-14.0.6-10.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2.zip 46 | HASH_MINGW32: 'fcd1e11b896190da01c83d5b5fb0d37b7c61585e53446c2dab0009debc3915e757213882c35e35396329338de6f0222ba012e23a5af86932db45186a225d1272' 47 | 48 | jobs: 49 | - job: MINGW32_BUILD 50 | displayName: 'Minimalist GNU for Windows (MinGW32)' 51 | steps: 52 | - checkout: self 53 | clean: true 54 | fetchTags: false 55 | - task: CmdLine@2 56 | # We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers 57 | displayName: Fetch VCPKG 58 | inputs: 59 | script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git 60 | workingDirectory: $(Build.SourcesDirectory) 61 | - task: CmdLine@2 62 | displayName: VCPKG Bootstrap 63 | inputs: 64 | script: | 65 | call bootstrap-vcpkg.bat 66 | echo ##vso[task.setvariable variable=VCPKG_DEFAULT_TRIPLET;]x86-mingw-static 67 | echo ##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x86-mingw-static 68 | 69 | workingDirectory: $(Build.SourcesDirectory)\vcpkg 70 | - task: PowerShell@2 71 | displayName: Install MinGW32 72 | inputs: 73 | targetType: inline 74 | script: | 75 | $ProgressPreference = 'SilentlyContinue' 76 | Write-Host "Downloading winlibs..." 77 | Invoke-WebRequest -Uri "$(URL_MINGW32)" -OutFile "gw32.zip" 78 | Write-Host "Downloaded." 79 | $fileHash = Get-FileHash -Algorithm SHA512 gw32.zip | ForEach { $_.Hash} | Out-String 80 | $filehash = $fileHash.Trim() 81 | Write-Host "##[debug]SHA512: " $fileHash 82 | if ($fileHash -ne '$(HASH_MINGW32)') { 83 | Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop 84 | } 85 | Write-Host "Extracting winlibs..." 86 | Expand-Archive -LiteralPath 'gw32.zip' 87 | Write-Host "Extracted." 88 | Write-Host "Added to path: $env:BUILD_SOURCESDIRECTORY\gw32\mingw32\bin" 89 | Write-Host "##vso[task.prependpath]$env:BUILD_SOURCESDIRECTORY\gw32\mingw32\bin" 90 | 91 | workingDirectory: $(Build.SourcesDirectory) 92 | - task: CmdLine@2 93 | displayName: GCC version 94 | inputs: 95 | script: g++ --version 96 | - task: CmdLine@2 97 | # The error checks are commented out due to a bug with vcpkg not returning 0 on success. 98 | displayName: VCPKG install headers 99 | inputs: 100 | script: | 101 | call vcpkg install directxmath 102 | REM @if ERRORLEVEL 1 goto error 103 | :finish 104 | @echo --- VCPKG COMPLETE --- 105 | exit /b 0 106 | :error 107 | @echo --- ERROR: VCPKG FAILED --- 108 | exit /b 1 109 | 110 | workingDirectory: $(Build.SourcesDirectory)\vcpkg 111 | - task: CMake@1 112 | displayName: CMake (MinGW32) 113 | inputs: 114 | cwd: '$(Build.SourcesDirectory)' 115 | cmakeArgs: > 116 | -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86 117 | -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" 118 | -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" 119 | -DVCPKG_TARGET_TRIPLET=x86-mingw-static 120 | - task: CMake@1 121 | displayName: CMake (MinGW32) Build 122 | inputs: 123 | cwd: '$(Build.SourcesDirectory)' 124 | cmakeArgs: --build out 125 | 126 | - job: MINGW64_BUILD 127 | displayName: 'Minimalist GNU for Windows (MinGW-W64) BUILD_TESTING=ON' 128 | steps: 129 | - checkout: self 130 | clean: true 131 | fetchTags: false 132 | - task: CmdLine@2 133 | displayName: Fetch VCPKG 134 | inputs: 135 | script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git 136 | workingDirectory: $(Build.SourcesDirectory) 137 | - task: CmdLine@2 138 | displayName: VCPKG Bootstrap 139 | inputs: 140 | script: | 141 | call bootstrap-vcpkg.bat 142 | echo ##vso[task.setvariable variable=VCPKG_DEFAULT_TRIPLET;]x64-mingw-static 143 | echo ##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x64-mingw-static 144 | 145 | workingDirectory: $(Build.SourcesDirectory)\vcpkg 146 | - task: CmdLine@2 147 | displayName: GCC version 148 | inputs: 149 | script: g++ --version 150 | - task: CmdLine@2 151 | displayName: VCPKG install headers 152 | inputs: 153 | script: | 154 | call vcpkg install directxmath 155 | REM @if ERRORLEVEL 1 goto error 156 | :finish 157 | @echo --- VCPKG COMPLETE --- 158 | exit /b 0 159 | :error 160 | @echo --- ERROR: VCPKG FAILED --- 161 | exit /b 1 162 | 163 | workingDirectory: $(Build.SourcesDirectory)\vcpkg 164 | - task: CMake@1 165 | displayName: CMake (MinGW-W64) 166 | inputs: 167 | cwd: '$(Build.SourcesDirectory)' 168 | cmakeArgs: > 169 | -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64 170 | -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" 171 | -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" 172 | -DVCPKG_TARGET_TRIPLET=x64-mingw-static 173 | - task: CMake@1 174 | displayName: CMake (MinGW-W64) Build 175 | inputs: 176 | cwd: '$(Build.SourcesDirectory)' 177 | cmakeArgs: --build out 178 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DXUT-GitHub.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | # Builds the library for Windows Desktop. 7 | 8 | schedules: 9 | - cron: "30 5 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | # GitHub Actions handles MSBuild for CI/PR 16 | trigger: none 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DXUT-GitHub.yml' 24 | 25 | resources: 26 | repositories: 27 | - repository: self 28 | type: git 29 | ref: refs/heads/main 30 | 31 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 32 | 33 | variables: 34 | Codeql.Enabled: false 35 | 36 | pool: 37 | vmImage: windows-2019 38 | 39 | jobs: 40 | - job: DESKTOP_BUILD 41 | displayName: 'Windows Desktop' 42 | timeoutInMinutes: 60 43 | strategy: 44 | maxParallel: 4 45 | matrix: 46 | Release_x64: 47 | BuildPlatform: x64 48 | BuildConfiguration: Release 49 | SpectreMitigation: false 50 | Debug_x64: 51 | BuildPlatform: x64 52 | BuildConfiguration: Debug 53 | SpectreMitigation: false 54 | Release_x86: 55 | BuildPlatform: Win32 56 | BuildConfiguration: Release 57 | SpectreMitigation: false 58 | Debug_x86: 59 | BuildPlatform: Win32 60 | BuildConfiguration: Debug 61 | SpectreMitigation: false 62 | Release_x64_SpectreMitigated: 63 | BuildPlatform: x64 64 | BuildConfiguration: Release 65 | SpectreMitigation: 'Spectre' 66 | Debug_x64_SpectreMitigated: 67 | BuildPlatform: x64 68 | BuildConfiguration: Debug 69 | SpectreMitigation: 'Spectre' 70 | Release_x86_SpectreMitigated: 71 | BuildPlatform: Win32 72 | BuildConfiguration: Release 73 | SpectreMitigation: 'Spectre' 74 | Debug_x86_SpectreMitigated: 75 | BuildPlatform: Win32 76 | BuildConfiguration: Debug 77 | SpectreMitigation: 'Spectre' 78 | steps: 79 | - checkout: self 80 | clean: true 81 | fetchTags: false 82 | - task: VSBuild@1 83 | displayName: Build solution DXUT_2019_Win10.sln 84 | inputs: 85 | solution: DXUT_2019_Win10.sln 86 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 87 | platform: '$(BuildPlatform)' 88 | configuration: '$(BuildConfiguration)' 89 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DXUT-SDL.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=32043 5 | 6 | # Runs various SDL recommended tools on the code. 7 | 8 | schedules: 9 | - cron: "0 3 * * 0,3,5" 10 | displayName: 'Three times a week' 11 | branches: 12 | include: 13 | - main 14 | always: true 15 | 16 | # GitHub Actions handles CodeQL and PREFAST for CI/PR 17 | trigger: none 18 | pr: 19 | branches: 20 | include: 21 | - main 22 | paths: 23 | include: 24 | - '.azuredevops/pipelines/DXUT-SDL.yml' 25 | 26 | resources: 27 | repositories: 28 | - repository: self 29 | type: git 30 | ref: refs/heads/main 31 | 32 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 33 | 34 | variables: 35 | Codeql.Enabled: true 36 | Codeql.Language: cpp 37 | VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' 38 | VS_GENERATOR: 'Visual Studio 17 2022' 39 | 40 | pool: 41 | vmImage: windows-2022 42 | 43 | jobs: 44 | - job: SDL_BUILD 45 | displayName: 'Build using required SDL tools' 46 | workspace: 47 | clean: all 48 | steps: 49 | - checkout: self 50 | clean: true 51 | fetchTags: false 52 | - task: NodeTool@0 53 | displayName: 'NPM install' 54 | inputs: 55 | versionSpec: 14.x 56 | - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 57 | displayName: 'Run Credential Scanner' 58 | inputs: 59 | debugMode: false 60 | folderSuppression: false 61 | - task: PoliCheck@2 62 | displayName: 'Run PoliCheck' 63 | inputs: 64 | result: PoliCheck.xml 65 | - task: Armory@2 66 | displayName: Run ARMory 67 | - task: CMake@1 68 | displayName: 'CMake (MSVC): Config x64' 69 | inputs: 70 | cwd: '$(Build.SourcesDirectory)' 71 | cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DENABLE_SPECTRE_MITIGATION=ON' 72 | - task: CodeQL3000Init@0 73 | inputs: 74 | Enabled: true 75 | - task: VSBuild@1 76 | displayName: 'Build C++ with CodeQL' 77 | inputs: 78 | solution: '$(Build.SourcesDirectory)/out/DXUT.sln' 79 | vsVersion: 17.0 80 | platform: x64 81 | configuration: Release 82 | msbuildArchitecture: x64 83 | - task: CodeQL3000Finalize@0 84 | condition: always() 85 | - task: CMake@1 86 | displayName: 'CMake (MSVC): Build x64 Release' 87 | inputs: 88 | cwd: '$(Build.SourcesDirectory)' 89 | cmakeArgs: --build out -v --config RelWithDebInfo 90 | - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@4 91 | displayName: 'Run AntiMalware' 92 | inputs: 93 | InputType: 'Basic' 94 | ScanType: 'CustomScan' 95 | FileDirPath: $(Agent.BuildDirectory) 96 | EnableSERVICEs: true 97 | SupportLogOnError: false 98 | TreatSignatureUpdateFailureAs: 'Warning' 99 | SignatureFreshness: 'OneDay' 100 | TreatStaleSignatureAs: 'Error' 101 | condition: always() 102 | - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2 103 | displayName: 'Post Analysis' 104 | inputs: 105 | GdnBreakAllTools: true 106 | GdnBreakPolicy: 'Microsoft' 107 | GdnBreakPolicyMinSev: 'Error' 108 | - task: ComponentGovernanceComponentDetection@0 109 | displayName: Component Detection 110 | 111 | - job: VC_PREFAST 112 | displayName: 'Build using /analyze (PREFAST)' 113 | workspace: 114 | clean: all 115 | steps: 116 | - checkout: self 117 | clean: true 118 | fetchTags: false 119 | - task: CmdLine@2 120 | displayName: Setup environment for CMake to use VS 121 | inputs: 122 | script: | 123 | call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" 124 | echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% 125 | echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja 126 | echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin 127 | echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 128 | echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 129 | echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64 130 | echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE% 131 | echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE% 132 | echo ##vso[task.setvariable variable=LIB;]%LIB% 133 | 134 | - task: CMake@1 135 | displayName: CMake Config 136 | inputs: 137 | cwd: '$(Build.SourcesDirectory)' 138 | cmakeArgs: --preset=x64-Debug -DENABLE_CODE_ANALYSIS=ON 139 | - task: CMake@1 140 | displayName: CMake Build 141 | inputs: 142 | cwd: '$(Build.SourcesDirectory)' 143 | cmakeArgs: --build out/build/x64-Debug 144 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{yml}] 4 | indent_size = 2 5 | indent_style = space 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | end_of_line = crlf 9 | charset = latin1 10 | 11 | [*.{cpp,h,inl}] 12 | indent_size = 4 13 | indent_style = space 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | end_of_line = crlf 17 | charset = latin1 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Explicitly declare code/VS files as CRLF 5 | *.cpp eol=crlf 6 | *.h eol=crlf 7 | *.hlsl eol=crlf 8 | *.hlsli eol=crlf 9 | *.fx eol=crlf 10 | *.fxh eol=crlf 11 | *.inc eol=crlf 12 | *.vcxproj eol=crlf 13 | *.filters eol=crlf 14 | *.sln eol=crlf 15 | *.props eol=crlf 16 | *.yml eol=crlf 17 | 18 | # Explicitly declare resource files as binary 19 | *.pdb binary 20 | *.dds binary 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: monthly 7 | -------------------------------------------------------------------------------- /.github/linters/.editorconfig-checker.json: -------------------------------------------------------------------------------- 1 | { 2 | "Format": "github-actions", 3 | "exclude": [ 4 | ".git", 5 | "LICENSE" 6 | ], 7 | "Disable": { 8 | "Indentation": true, 9 | "IndentSize": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | # line-length 5 | MD013: false 6 | 7 | # blanks-around-headings 8 | MD022: false 9 | 10 | # blanks-around-lists 11 | MD032: false 12 | 13 | # no-inline-html 14 | MD033: false 15 | 16 | # no-bare-urls 17 | MD034: false 18 | 19 | # first-line-heading 20 | MD041: false 21 | -------------------------------------------------------------------------------- /.github/linters/.yaml-lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | ignore-from-file: .gitignore 5 | 6 | extends: default 7 | 8 | rules: 9 | truthy: 10 | check-keys: false 11 | document-start: disable 12 | line-length: 13 | max: 160 14 | comments: 15 | min-spaces-from-content: 1 16 | new-lines: 17 | type: dos 18 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | name: "CodeQL" 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | pull_request: 17 | branches: "main" 18 | paths-ignore: 19 | - '*.md' 20 | - LICENSE 21 | - '.azuredevops/**' 22 | - '.nuget/*' 23 | schedule: 24 | - cron: '38 2 * * 3' 25 | 26 | permissions: 27 | contents: read 28 | 29 | jobs: 30 | analyze: 31 | name: Analyze (C/C++) 32 | runs-on: windows-latest 33 | timeout-minutes: 360 34 | permissions: 35 | actions: read # for github/codeql-action/init to get workflow details 36 | contents: read # for actions/checkout to fetch code 37 | security-events: write # for github/codeql-action/autobuild to send a status report 38 | packages: read 39 | 40 | steps: 41 | - name: Checkout repository 42 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 43 | 44 | - name: 'Install Ninja' 45 | run: choco install ninja 46 | 47 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 48 | 49 | - name: Initialize CodeQL 50 | uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 51 | with: 52 | languages: c-cpp 53 | build-mode: manual 54 | 55 | - name: 'Configure CMake' 56 | working-directory: ${{ github.workspace }} 57 | run: cmake --preset=x64-Debug 58 | 59 | - name: 'Build' 60 | working-directory: ${{ github.workspace }} 61 | run: cmake --build out\build\x64-Debug 62 | 63 | - name: Perform CodeQL Analysis 64 | uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 65 | with: 66 | category: "/language:c-cpp" 67 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | name: Lint 7 | 8 | on: 9 | pull_request: 10 | branches: "main" 11 | paths-ignore: 12 | - LICENSE 13 | - build/*.in 14 | 15 | permissions: {} 16 | 17 | jobs: 18 | analyze: 19 | permissions: 20 | contents: read 21 | packages: read 22 | statuses: write 23 | name: Lint 24 | runs-on: ubuntu-latest 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 29 | with: 30 | fetch-depth: 0 31 | 32 | - name: Lint Code Base 33 | uses: super-linter/super-linter/slim@12150456a73e248bdc94d0794898f94e23127c88 # v7.4.0 34 | env: 35 | DEFAULT_BRANCH: origin/main 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | IGNORE_GITIGNORED_FILES: true 38 | VALIDATE_ALL_CODEBASE: true 39 | VALIDATE_CHECKOV: true 40 | VALIDATE_EDITORCONFIG: true 41 | VALIDATE_GITHUB_ACTIONS: true 42 | VALIDATE_JSON: true 43 | VALIDATE_MARKDOWN: true 44 | VALIDATE_GITLEAKS: true 45 | VALIDATE_YAML: true 46 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | name: 'CMake (Windows)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | pull_request: 17 | branches: "main" 18 | paths-ignore: 19 | - '*.md' 20 | - LICENSE 21 | - '.azuredevops/**' 22 | - '.nuget/*' 23 | 24 | permissions: 25 | contents: read 26 | 27 | jobs: 28 | build: 29 | runs-on: windows-2022 30 | 31 | strategy: 32 | fail-fast: false 33 | 34 | matrix: 35 | toolver: ['14.29', '14'] 36 | build_type: [x64-Debug, x64-Release] 37 | arch: [amd64] 38 | include: 39 | - toolver: '14.29' 40 | build_type: x86-Debug 41 | arch: amd64_x86 42 | - toolver: '14.29' 43 | build_type: x86-Release 44 | arch: amd64_x86 45 | - toolver: '14' 46 | build_type: x86-Debug 47 | arch: amd64_x86 48 | - toolver: '14' 49 | build_type: x86-Release 50 | arch: amd64_x86 51 | - toolver: '14' 52 | build_type: arm64-Debug 53 | arch: amd64_arm64 54 | - toolver: '14' 55 | build_type: arm64-Release 56 | arch: amd64_arm64 57 | - toolver: '14' 58 | build_type: arm64ec-Debug 59 | arch: amd64_arm64 60 | - toolver: '14' 61 | build_type: arm64ec-Release 62 | arch: amd64_arm64 63 | - toolver: '14' 64 | build_type: x64-Debug-Clang 65 | arch: amd64 66 | - toolver: '14' 67 | build_type: x64-Release-Clang 68 | arch: amd64 69 | - toolver: '14' 70 | build_type: x86-Debug-Clang 71 | arch: amd64_x86 72 | - toolver: '14' 73 | build_type: x86-Release-Clang 74 | arch: amd64_x86 75 | - toolver: '14' 76 | build_type: arm64-Debug-Clang 77 | arch: amd64_arm64 78 | - toolver: '14' 79 | build_type: arm64-Release-Clang 80 | arch: amd64_arm64 81 | 82 | steps: 83 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 84 | 85 | - name: 'Install Ninja' 86 | run: choco install ninja 87 | 88 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 89 | with: 90 | arch: ${{ matrix.arch }} 91 | toolset: ${{ matrix.toolver }} 92 | 93 | - name: 'Configure CMake' 94 | working-directory: ${{ github.workspace }} 95 | run: cmake --preset=${{ matrix.build_type }} 96 | 97 | - name: 'Build' 98 | working-directory: ${{ github.workspace }} 99 | run: cmake --build out\build\${{ matrix.build_type }} 100 | -------------------------------------------------------------------------------- /.github/workflows/msbuild.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | name: MSBuild 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | pull_request: 17 | branches: "main" 18 | paths-ignore: 19 | - '*.md' 20 | - LICENSE 21 | - '.azuredevops/**' 22 | - '.nuget/*' 23 | 24 | permissions: 25 | contents: read 26 | 27 | jobs: 28 | build: 29 | runs-on: windows-2022 30 | 31 | strategy: 32 | fail-fast: false 33 | 34 | matrix: 35 | vs: [2019, 2022] 36 | build_type: [Debug, Release] 37 | platform: [Win32, x64] 38 | 39 | steps: 40 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 41 | 42 | - name: Add MSBuild to PATH 43 | uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 44 | 45 | - name: Build 46 | working-directory: ${{ github.workspace }} 47 | run: > 48 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 49 | DXUT_${{ matrix.vs }}_Win10.sln 50 | -------------------------------------------------------------------------------- /.github/workflows/msvc.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=320437 5 | 6 | name: Microsoft C++ Code Analysis 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | pull_request: 17 | branches: "main" 18 | paths-ignore: 19 | - '*.md' 20 | - LICENSE 21 | - '.azuredevops/**' 22 | - '.nuget/*' 23 | schedule: 24 | - cron: '20 21 * * 2' 25 | 26 | permissions: 27 | contents: read 28 | 29 | jobs: 30 | analyze: 31 | permissions: 32 | contents: read 33 | security-events: write 34 | actions: read 35 | name: Analyze 36 | runs-on: windows-latest 37 | 38 | steps: 39 | - name: Checkout repository 40 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 41 | 42 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 43 | with: 44 | arch: amd64 45 | 46 | - name: Configure CMake 47 | working-directory: ${{ github.workspace }} 48 | run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON 49 | 50 | - name: Initialize MSVC Code Analysis 51 | uses: microsoft/msvc-code-analysis-action@24c285ab36952c9e9182f4b78dfafbac38a7e5ee # v0.1.1 52 | id: run-analysis 53 | with: 54 | cmakeBuildDirectory: ./out 55 | buildConfiguration: Debug 56 | ruleset: NativeRecommendedRules.ruleset 57 | 58 | # Upload SARIF file to GitHub Code Scanning Alerts 59 | - name: Upload SARIF to GitHub 60 | uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 61 | with: 62 | sarif_file: ${{ steps.run-analysis.outputs.sarif }} 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.psess 2 | *.vsp 3 | *.log 4 | *.err 5 | *.wrn 6 | *.suo 7 | *.sdf 8 | *.user 9 | *.i 10 | *.vspscc 11 | *.opensdf 12 | *.opendb 13 | *.ipch 14 | *.cache 15 | *.tlog 16 | *.lastbuildstate 17 | *.ilk 18 | *.VC.db 19 | .vs 20 | /ipch 21 | Bin 22 | /wiki 23 | /out 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # DXUT for Direct3D 11 2 | 3 | http://go.microsoft.com/fwlink/?LinkId=320437 4 | 5 | ## Release History 6 | 7 | ### August 14, 2024 (11.32) 8 | * Added missing Win32 messages to DXUTTraceWindowsMessage 9 | * Minor code cleanup 10 | * CMake project updates, refactor, and added ARM64EC support 11 | * Added GitHub Action Pipeline YAML files 12 | 13 | ### June 13, 2023 14 | * CMake project updates 15 | 16 | ### February 12, 2023 (11.31) 17 | * Additional checks added to DDSTextureLoader for planar video formats. 18 | * CMake project update 19 | 20 | ### December 10, 2022 (11.30) 21 | * CMake project updated to require 3.20 or later 22 | * Fixed MinGW compat issue in DXERR.H 23 | * Minor code review 24 | * Added Azure Dev Ops Pipeline YAML files 25 | 26 | ### October 24, 2022 (11.29) 27 | * Fix for build failure `-Wnarrowing` with MinGW GNU 12.2 28 | 29 | ### August 17, 2022 (11.28) 30 | * *breaking change* DDSTextureLoader ``Ex`` functions now use ``DDS_LOADER_FLAGS`` instead of ``bool forceSRGB`` parameter. 31 | * CMake and MSBuild project updates 32 | 33 | ### May 23, 2022 (11.27) 34 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 35 | * Add VS 2022 projects, retired VS 2017 projects 36 | * Update build switches for SDL recommendations 37 | * CMake project cleanup, added CMakePresets.json 38 | * Minor code review 39 | 40 | ### December 2, 2021 41 | * Minor project update 42 | 43 | ### June 2, 2021 (11.26) 44 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 45 | * Minor code review 46 | 47 | ### February 7, 2021 48 | * Added CMake project 49 | * Removed Windows Vista support 50 | * No code changes 51 | 52 | ### November 17, 2020 (11.25) 53 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 54 | 55 | ### June 3, 2020 (11.24) 56 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 57 | * Retired VS 2015 projects 58 | 59 | ### January 16, 2020 (11.23) 60 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 61 | 62 | ### April 26, 2019 (11.22) 63 | * Added VS 2019 desktop projects 64 | * VS 2017 updated for Windows 10 October 2018 Update SDK (17763) 65 | * Minor code cleanup 66 | 67 | ### July 12, 2018 (11.21) 68 | * Code cleanup 69 | 70 | ### May 31, 2018 (11.20) 71 | * VS 2017 updated for Windows 10 April 2018 Update SDK (17134) 72 | 73 | ### May 11, 2018 (11.19) 74 | * Support for Direct3D 11.2 no longer requires define ``USE_DIRECT3D11_2`` 75 | * Retired VS 2013 projects 76 | * Code cleanup 77 | 78 | ### February 27, 2018 (11.18) 79 | * Fixed array length mismatch issue with ``TOTAL_FEATURE_LEVELS`` 80 | * Fixed optional Direct3D 11.4 support in VS 2013/2015 projects 81 | * Minor code cleanup 82 | 83 | ### November 2, 2017 (11.17) 84 | * VS 2017 updated for Windows 10 Fall Creators Update SDK (16299) 85 | * Optional support for Direct3D 11.4 (define ``USE_DIRECT3D11_4`` in projects using the 14393 or later Windows 10 SDK) 86 | 87 | ### October 13, 2017 (11.16) 88 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 89 | * Updated for VS 2017 update 15.1 - 15.3 and Windows 10 SDK (15063) 90 | 91 | ### March 10, 2017 (11.15) 92 | * Add VS 2017 projects 93 | * Minor code cleanup 94 | 95 | ### September 15, 2016 (11.14) 96 | * Updated WICTextureLoader and ScreenGrab 97 | 98 | ### August 2, 2016 (11.13) 99 | * Updated for VS 2015 Update 3 and Windows 10 SDK (14393) 100 | 101 | ### April 26, 2016 (11.12) 102 | * Updated DDSTextureLoader, WICTextureLoader, and ScreenGrab 103 | * Retired VS 2012 projects and obsolete adapter code 104 | * Minor code and project file cleanup 105 | 106 | ### November 30, 2015 (11.11) 107 | * Updated DDSTextureLoader, ScreenGrab, DXERR 108 | * Updated for VS 2015 Update 1 and Windows 10 SDK (10586) 109 | 110 | ### July 29, 2015 (11.10) 111 | * Updated for VS 2015 and Windows 10 SDK RTM 112 | * Retired VS 2010 projects 113 | 114 | ### June 16, 2015 (11.09) 115 | * Optional support for Direct3D 11.3 (define ``USE_DIRECT3D11_3`` in VS 2015 projects) 116 | 117 | ### April 14, 2015 (11.08) 118 | * Fix for auto-gen of volume textures 119 | * More updates for VS 2015 120 | 121 | ### November 24, 2014 (11.07) 122 | * Minor fix for Present usage 123 | * Minor fix for CBaseCamera::GetInput 124 | * Minor fix for WIC usage of IWICFormatConverter 125 | * Updates for Visual Studio 2015 Technical Preview 126 | 127 | ### July 28, 2014 (11.06) 128 | * Optional support for Direct3D 11.2 (define ``USE_DIRECT3D11_2`` in VS 2013 projects) 129 | * Fixes for various UI and F2 device settings dialog issues 130 | * Fixes for device and format enumeration 131 | * Changed default resolution to 800x600 132 | * Code review fixes 133 | 134 | ### January 24, 2014 (11.05) 135 | * Added use of DXGI debugging when available 136 | * Resolved CRT heap leak report 137 | * Fixed compile bug in DXUTLockFreePipe 138 | * Fixed bug reported in DXUT's sprite implementation 139 | * Code cleanup (removed ``DXGI_1_2_FORMATS`` control define; ScopedObject typedef removed) 140 | 141 | ### October 21, 2013 (11.04) 142 | * Updated for Visual Studio 2013 and Windows 8.1 SDK RTM 143 | * Minor fixes for systems which only have a "Microsoft Basic Renderer" device 144 | 145 | ### September 2013 (11.03) 146 | * Removed dependencies on the D3DX9 and D3DX11 libraries, so DXUT no longer requires the legacy DirectX SDK to build. 147 | * It does require the d3dcompiler.h header from the Windows 8.x SDK. 148 | * Includes standalone DDSTextureLoader, WICTexureLoader, ScreenGrab, and DxErr modules. 149 | * Removed support for Direct3D 9 and Windows XP 150 | * Deleted the DXUTDevice9.h/.cpp, SDKSound.h/.cpp, and SDKWaveFile.h/.cpp files 151 | * Deleted legacy support for MCE relaunch 152 | * General C++ code cleanups (nullptr, auto keyword, C++ style casting, Safer CRT, etc.) which are compatible with Visual C++ 2010 and 2012 153 | * SAL2 annotation and /analyze cleanup 154 | * Added DXUTCompileFromFile, DXUTCreateShaderResourceViewFromFile, DXUTCreateTextureFromFile, DXUTSaveTextureToFile helpers 155 | * Added ``-forcewarp`` command-line switch 156 | * Added support for DXGI 1.1 and 1.2 formats 157 | * Added Direct3D 11.1 Device/Context state 158 | * Support Feature Level 11.1 when available 159 | 160 | ### June 2010 (11.02) 161 | * The DirectX SDK (June 2010) included an update to DXUT11. This is the last version to support Visual Studio 2008, Windows XP, or Direct3D 9. The source code is located in ``Samples\C++\DXUT11``. 162 | 163 | ### February 2010 (11.01) 164 | * An update was shipped with the DirectX SDK (February 2010). This is the last version to support Visual Studio 2005. The source code is located in ``Samples\C++\DXUT11``. 165 | 166 | ### August 2009 (11.00) 167 | * The initial release of DXUT11 was in DirectX SDK (August 2009). The source code is located in Samples\C++\DXUT11. This was a port of the original DXUT which supported Direct3D 10 / Direct3D 9 applications on Windows XP and Windows Vista. 168 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | cmake_minimum_required (VERSION 3.20) 5 | 6 | set(DXUT_VERSION 11.32) 7 | 8 | if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET)) 9 | message(FATAL "DXUT does not support UWP or Xbox") 10 | endif() 11 | 12 | project (DXUT 13 | VERSION ${DXUT_VERSION} 14 | DESCRIPTION "DXUT for DirectX 11" 15 | HOMEPAGE_URL "http://go.microsoft.com/fwlink/?LinkId=320437" 16 | LANGUAGES CXX) 17 | 18 | # https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/ 19 | option(ENABLE_SPECTRE_MITIGATION "Build using /Qspectre for MSVC" OFF) 20 | 21 | option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug configurations with the MSVC CRT" OFF) 22 | 23 | option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF) 24 | 25 | option(DIRECTXTK_INTEGRATION "Support mixing with DirectX Tool Kit" OFF) 26 | 27 | set(CMAKE_CXX_STANDARD 17) 28 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 29 | set(CMAKE_CXX_EXTENSIONS OFF) 30 | 31 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 32 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 33 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 34 | 35 | include(GNUInstallDirs) 36 | 37 | #--- Core Library 38 | set(CORE_LIBRARY_HEADERS 39 | Core/dxerr.h 40 | Core/DXUT.h 41 | Core/DXUTDevice11.h 42 | Core/DXUTmisc.h 43 | ) 44 | 45 | set(CORE_LIBRARY_SOURCES 46 | Core/dxerr.cpp 47 | Core/DXUT.cpp 48 | Core/DXUTDevice11.cpp 49 | Core/DXUTmisc.cpp 50 | ) 51 | 52 | if(NOT DIRECTXTK_INTEGRATION) 53 | list(APPEND CORE_LIBRARY_HEADERS 54 | Core/DDSTextureLoader.h 55 | Core/ScreenGrab.h 56 | Core/WICTextureLoader.h 57 | ) 58 | list(APPEND CORE_LIBRARY_SOURCES 59 | Core/DDSTextureLoader.cpp 60 | Core/ScreenGrab.cpp 61 | Core/WICTextureLoader.cpp 62 | ) 63 | endif() 64 | 65 | add_library(${PROJECT_NAME} STATIC ${CORE_LIBRARY_SOURCES} ${CORE_LIBRARY_HEADERS}) 66 | 67 | #--- Optional Library 68 | set(OPT_LIBRARY_HEADERS 69 | Optional/DXUTcamera.h 70 | Optional/DXUTgui.h 71 | Optional/DXUTLockFreePipe.h 72 | Optional/DXUTres.h 73 | Optional/DXUTsettingsdlg.h 74 | Optional/SDKmesh.h 75 | Optional/SDKmisc.h 76 | ) 77 | 78 | set(OPT_LIBRARY_SOURCES 79 | Optional/DXUTcamera.cpp 80 | Optional/DXUTgui.cpp 81 | Optional/DXUTres.cpp 82 | Optional/DXUTsettingsdlg.cpp 83 | Optional/SDKmesh.cpp 84 | Optional/SDKmisc.cpp 85 | ) 86 | 87 | if(NOT MINGW) 88 | set(OPT_LIBRARY_HEADERS 89 | ${OPT_LIBRARY_HEADERS} 90 | Optional/DXUTguiIME.h 91 | Optional/ImeUi.h 92 | ) 93 | 94 | set(OPT_LIBRARY_SOURCES 95 | ${OPT_LIBRARY_SOURCES} 96 | Optional/DXUTguiIME.cpp 97 | Optional/ImeUi.cpp 98 | ) 99 | endif() 100 | 101 | add_library(${PROJECT_NAME}Opt STATIC ${OPT_LIBRARY_SOURCES} ${OPT_CORE_LIBRARY_HEADERS}) 102 | 103 | if(NOT MINGW) 104 | target_precompile_headers(${PROJECT_NAME} PRIVATE Core/DXUT.h) 105 | target_precompile_headers(${PROJECT_NAME}Opt PRIVATE Core/DXUT.h) 106 | endif() 107 | 108 | source_group(DXUT REGULAR_EXPRESSION Core/*.*) 109 | source_group(DXUTOpt REGULAR_EXPRESSION Optional/*.*) 110 | 111 | target_include_directories(${PROJECT_NAME} PUBLIC 112 | $ 113 | $) 114 | 115 | target_include_directories(${PROJECT_NAME}Opt PUBLIC 116 | $ 117 | $ 118 | PRIVATE Core/) 119 | 120 | if(DIRECTXTK_INTEGRATION) 121 | target_compile_definitions(${PROJECT_NAME} PRIVATE USE_DIRECTXTK) 122 | target_compile_definitions(${PROJECT_NAME}Opt PRIVATE USE_DIRECTXTK) 123 | 124 | find_package(directxtk REQUIRED) 125 | target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXTK) 126 | target_link_libraries(${PROJECT_NAME}Opt PRIVATE Microsoft::DirectXTK) 127 | endif() 128 | 129 | target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) 130 | target_compile_features(${PROJECT_NAME}Opt PUBLIC cxx_std_11) 131 | 132 | if(MINGW) 133 | find_package(directxmath CONFIG REQUIRED) 134 | else() 135 | find_package(directxmath CONFIG QUIET) 136 | endif() 137 | 138 | if(directxmath_FOUND) 139 | message(STATUS "Using DirectXMath package") 140 | target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath) 141 | target_link_libraries(${PROJECT_NAME}Opt PRIVATE Microsoft::DirectXMath) 142 | endif() 143 | 144 | #--- Package 145 | include(CMakePackageConfigHelpers) 146 | 147 | string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME) 148 | 149 | write_basic_package_version_file( 150 | ${PACKAGE_NAME}-config-version.cmake 151 | VERSION ${DXUT_VERSION} 152 | COMPATIBILITY AnyNewerVersion) 153 | 154 | install(TARGETS ${PROJECT_NAME} 155 | EXPORT ${PROJECT_NAME}-targets 156 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 157 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 158 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 159 | 160 | install(TARGETS ${PROJECT_NAME}Opt 161 | EXPORT ${PROJECT_NAME}Opt-targets 162 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 163 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 164 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 165 | 166 | configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/build/${PROJECT_NAME}-config.cmake.in 167 | ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake 168 | INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}) 169 | 170 | install(EXPORT ${PROJECT_NAME}-targets 171 | FILE ${PROJECT_NAME}-targets.cmake 172 | NAMESPACE Microsoft:: 173 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}) 174 | 175 | install(EXPORT ${PROJECT_NAME}Opt-targets 176 | FILE ${PROJECT_NAME}Opt-targets.cmake 177 | NAMESPACE Microsoft:: 178 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}) 179 | 180 | install(FILES ${CORE_LIBRARY_HEADERS} ${OPT_LIBRARY_HEADERS} 181 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) 182 | 183 | install(FILES 184 | ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake 185 | ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake 186 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}) 187 | 188 | if(MSVC) 189 | target_compile_options(${PROJECT_NAME} PRIVATE /W4 /EHsc /GR-) 190 | target_compile_options(${PROJECT_NAME}Opt PRIVATE /W4 /EHsc /GR-) 191 | endif() 192 | 193 | include(build/CompilerAndLinker.cmake) 194 | 195 | target_compile_definitions(${PROJECT_NAME} PRIVATE ${COMPILER_DEFINES}) 196 | target_compile_definitions(${PROJECT_NAME}Opt PRIVATE ${COMPILER_DEFINES}) 197 | 198 | target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILER_SWITCHES}) 199 | target_compile_options(${PROJECT_NAME}Opt PRIVATE ${COMPILER_SWITCHES}) 200 | 201 | target_link_options(${PROJECT_NAME} PRIVATE ${LINKER_SWITCHES}) 202 | target_link_options(${PROJECT_NAME}Opt PRIVATE ${LINKER_SWITCHES}) 203 | 204 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM") 205 | set(WarningsLib "-Wno-deprecated-declarations" "-Wno-unused-const-variable" "-Wno-switch" "-Wno-ignored-attributes") 206 | target_compile_options(${PROJECT_NAME} PRIVATE ${WarningsLib}) 207 | target_compile_options(${PROJECT_NAME}Opt PRIVATE ${WarningsLib}) 208 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") 209 | target_compile_options(${PROJECT_NAME} PRIVATE "-Wno-ignored-attributes" "-Walloc-size-larger-than=4GB") 210 | target_compile_options(${PROJECT_NAME}Opt PRIVATE "-Wno-ignored-attributes" "-Walloc-size-larger-than=4GB") 211 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 212 | if(ENABLE_CODE_ANALYSIS) 213 | target_compile_options(${PROJECT_NAME} PRIVATE /analyze /WX) 214 | target_compile_options(${PROJECT_NAME}Opt PRIVATE /analyze /WX) 215 | endif() 216 | 217 | if(ENABLE_SPECTRE_MITIGATION 218 | AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.13)) 219 | message(STATUS "Building Spectre-mitigated libraries") 220 | target_compile_options(${PROJECT_NAME} PRIVATE "/Qspectre") 221 | target_compile_options(${PROJECT_NAME}Opt PRIVATE "/Qspectre") 222 | endif() 223 | endif() 224 | 225 | if(WIN32) 226 | if(${DIRECTX_ARCH} MATCHES "^arm64") 227 | message(STATUS "Building for Windows 10/Windows 11.") 228 | set(WINVER 0x0A00) 229 | elseif(${DIRECTX_ARCH} MATCHES "^arm") 230 | message(STATUS "Building for Windows 8.") 231 | set(WINVER 0x0602) 232 | else() 233 | message(STATUS "Building for Windows 7.") 234 | set(WINVER 0x0601) 235 | target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN7_PLATFORM_UPDATE) 236 | target_compile_definitions(${PROJECT_NAME}Opt PRIVATE _WIN7_PLATFORM_UPDATE) 237 | endif() 238 | 239 | target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN32_WINNT=${WINVER}) 240 | target_compile_definitions(${PROJECT_NAME}Opt PRIVATE _WIN32_WINNT=${WINVER}) 241 | 242 | if(DISABLE_MSVC_ITERATOR_DEBUGGING) 243 | target_compile_definitions(${PROJECT_NAME} PRIVATE _ITERATOR_DEBUG_LEVEL=0) 244 | target_compile_definitions(${PROJECT_NAME}Opt PRIVATE _ITERATOR_DEBUG_LEVEL=0) 245 | endif() 246 | endif() 247 | 248 | set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) 249 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "configurePresets": [ 4 | { 5 | "name": "base", 6 | "displayName": "Basic Config", 7 | "description": "Basic build using Ninja generator", 8 | "generator": "Ninja", 9 | "hidden": true, 10 | "binaryDir": "${sourceDir}/out/build/${presetName}", 11 | "cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" } 12 | }, 13 | 14 | { 15 | "name": "x64", 16 | "architecture": { 17 | "value": "x64", 18 | "strategy": "external" 19 | }, 20 | "cacheVariables": { "DIRECTX_ARCH": "x64" }, 21 | "hidden": true 22 | }, 23 | { 24 | "name": "x86", 25 | "architecture": { 26 | "value": "x86", 27 | "strategy": "external" 28 | }, 29 | "cacheVariables": { "DIRECTX_ARCH": "x86" }, 30 | "hidden": true 31 | }, 32 | { 33 | "name": "ARM64", 34 | "architecture": { 35 | "value": "arm64", 36 | "strategy": "external" 37 | }, 38 | "cacheVariables": { "DIRECTX_ARCH": "arm64" }, 39 | "hidden": true 40 | }, 41 | { 42 | "name": "ARM64EC", 43 | "architecture": { 44 | "value": "arm64ec", 45 | "strategy": "external" 46 | }, 47 | "cacheVariables": { "DIRECTX_ARCH": "arm64ec" }, 48 | "environment": { 49 | "CFLAGS": "/arm64EC", 50 | "CXXFLAGS": "/arm64EC" 51 | }, 52 | "hidden": true 53 | }, 54 | 55 | { 56 | "name": "Debug", 57 | "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }, 58 | "hidden": true 59 | }, 60 | { 61 | "name": "Release", 62 | "cacheVariables": 63 | { 64 | "CMAKE_BUILD_TYPE": "RelWithDebInfo", 65 | "CMAKE_INTERPROCEDURAL_OPTIMIZATION": true 66 | }, 67 | "hidden": true 68 | }, 69 | 70 | { 71 | "name": "MSVC", 72 | "hidden": true, 73 | "cacheVariables": { 74 | "CMAKE_CXX_COMPILER": "cl.exe" 75 | }, 76 | "toolset": { 77 | "value": "host=x64", 78 | "strategy": "external" 79 | } 80 | }, 81 | { 82 | "name": "Clang", 83 | "hidden": true, 84 | "cacheVariables": { 85 | "CMAKE_CXX_COMPILER": "clang-cl.exe" 86 | }, 87 | "toolset": { 88 | "value": "host=x64", 89 | "strategy": "external" 90 | } 91 | }, 92 | { 93 | "name": "Clang-X86", 94 | "environment": { 95 | "CFLAGS": "-m32", 96 | "CXXFLAGS": "-m32" 97 | }, 98 | "hidden": true 99 | }, 100 | { 101 | "name": "Clang-AArch64", 102 | "environment": { 103 | "CFLAGS": "--target=arm64-pc-windows-msvc", 104 | "CXXFLAGS": "--target=arm64-pc-windows-msvc" 105 | }, 106 | "hidden": true 107 | }, 108 | { 109 | "name": "GNUC", 110 | "hidden": true, 111 | "cacheVariables": { 112 | "CMAKE_CXX_COMPILER": "g++.exe" 113 | }, 114 | "toolset": { 115 | "value": "host=x64", 116 | "strategy": "external" 117 | } 118 | }, 119 | 120 | { 121 | "name": "VCPKG", 122 | "cacheVariables": { 123 | "CMAKE_TOOLCHAIN_FILE": { 124 | "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", 125 | "type": "FILEPATH" 126 | } 127 | }, 128 | "hidden": true 129 | }, 130 | { 131 | "name": "DXTK", 132 | "cacheVariables": { 133 | "DIRECTXTK_INTEGRATION": true 134 | }, 135 | "hidden": true 136 | }, 137 | 138 | { "name": "x64-Debug" , "description": "MSVC for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, 139 | { "name": "x64-Release" , "description": "MSVC for x64 (Release)", "inherits": [ "base", "x64", "Release", "MSVC" ] }, 140 | { "name": "x86-Debug" , "description": "MSVC for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, 141 | { "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC" ] }, 142 | { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, 143 | { "name": "arm64-Release" , "description": "MSVC for ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, 144 | { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug)", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ] }, 145 | { "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release)", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ] }, 146 | 147 | { "name": "x64-Debug-DXTK" , "description": "MSVC for x64 (Debug) w/ DirectX Tool Kit", "inherits": [ "base", "x64", "Debug", "MSVC", "DXTK", "VCPKG" ] }, 148 | { "name": "x64-Release-DXTK" , "description": "MSVC for x64 (Release) w/ DirectX Tool Kit", "inherits": [ "base", "x64", "Release", "MSVC", "DXTK", "VCPKG" ] }, 149 | { "name": "x86-Debug-DXTK" , "description": "MSVC for x86 (Debug) w/ DirectX Tool Kit", "inherits": [ "base", "x86", "Debug", "MSVC", "DXTK", "VCPKG" ] }, 150 | { "name": "x86-Release-DXTK" , "description": "MSVC for x86 (Release) w/ DirectX Tool Kit", "inherits": [ "base", "x86", "Release", "MSVC", "DXTK", "VCPKG" ] }, 151 | { "name": "arm64-Debug-DXTK" , "description": "MSVC for ARM64 (Debug) w/ DirectX Tool Kit", "inherits": [ "base", "ARM64", "Debug", "MSVC", "DXTK", "VCPKG" ] }, 152 | { "name": "arm64-Release-DXTK" , "description": "MSVC for ARM64 (Release) w/ DirectX Tool Kit", "inherits": [ "base", "ARM64", "Release", "MSVC", "DXTK", "VCPKG" ] }, 153 | 154 | { "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang" ] }, 155 | { "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang" ] }, 156 | { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86" ] }, 157 | { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86" ] }, 158 | { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64" ] }, 159 | { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64" ] }, 160 | 161 | { "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, 162 | { "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, 163 | { "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, 164 | { "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } } 165 | ] 166 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | - Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) 11 | -------------------------------------------------------------------------------- /Core/DDSTextureLoader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DDSTextureLoader.h 3 | // 4 | // Functions for loading a DDS texture and creating a Direct3D runtime resource for it 5 | // 6 | // Note these functions are useful as a light-weight runtime loader for DDS files. For 7 | // a full-featured DDS file reader, writer, and texture processing pipeline see 8 | // the 'Texconv' sample and the 'DirectXTex' library. 9 | // 10 | // Copyright (c) Microsoft Corporation. 11 | // Licensed under the MIT License. 12 | // 13 | // http://go.microsoft.com/fwlink/?LinkId=248926 14 | // http://go.microsoft.com/fwlink/?LinkId=248929 15 | //-------------------------------------------------------------------------------------- 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | 25 | namespace DirectX 26 | { 27 | #ifndef DDS_ALPHA_MODE_DEFINED 28 | #define DDS_ALPHA_MODE_DEFINED 29 | enum DDS_ALPHA_MODE : uint32_t 30 | { 31 | DDS_ALPHA_MODE_UNKNOWN = 0, 32 | DDS_ALPHA_MODE_STRAIGHT = 1, 33 | DDS_ALPHA_MODE_PREMULTIPLIED = 2, 34 | DDS_ALPHA_MODE_OPAQUE = 3, 35 | DDS_ALPHA_MODE_CUSTOM = 4, 36 | }; 37 | #endif 38 | 39 | inline namespace DX11 40 | { 41 | enum DDS_LOADER_FLAGS : uint32_t 42 | { 43 | DDS_LOADER_DEFAULT = 0, 44 | DDS_LOADER_FORCE_SRGB = 0x1, 45 | DDS_LOADER_IGNORE_SRGB = 0x2, 46 | }; 47 | } 48 | 49 | // Standard version 50 | HRESULT __cdecl CreateDDSTextureFromMemory( 51 | _In_ ID3D11Device* d3dDevice, 52 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, 53 | _In_ size_t ddsDataSize, 54 | _Outptr_opt_ ID3D11Resource** texture, 55 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 56 | _In_ size_t maxsize = 0, 57 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 58 | 59 | HRESULT __cdecl CreateDDSTextureFromFile( 60 | _In_ ID3D11Device* d3dDevice, 61 | _In_z_ const wchar_t* szFileName, 62 | _Outptr_opt_ ID3D11Resource** texture, 63 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 64 | _In_ size_t maxsize = 0, 65 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 66 | 67 | // Standard version with optional auto-gen mipmap support 68 | HRESULT __cdecl CreateDDSTextureFromMemory( 69 | _In_ ID3D11Device* d3dDevice, 70 | _In_opt_ ID3D11DeviceContext* d3dContext, 71 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, 72 | _In_ size_t ddsDataSize, 73 | _Outptr_opt_ ID3D11Resource** texture, 74 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 75 | _In_ size_t maxsize = 0, 76 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 77 | 78 | HRESULT __cdecl CreateDDSTextureFromFile( 79 | _In_ ID3D11Device* d3dDevice, 80 | _In_opt_ ID3D11DeviceContext* d3dContext, 81 | _In_z_ const wchar_t* szFileName, 82 | _Outptr_opt_ ID3D11Resource** texture, 83 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 84 | _In_ size_t maxsize = 0, 85 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 86 | 87 | // Extended version 88 | HRESULT __cdecl CreateDDSTextureFromMemoryEx( 89 | _In_ ID3D11Device* d3dDevice, 90 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, 91 | _In_ size_t ddsDataSize, 92 | _In_ size_t maxsize, 93 | _In_ D3D11_USAGE usage, 94 | _In_ unsigned int bindFlags, 95 | _In_ unsigned int cpuAccessFlags, 96 | _In_ unsigned int miscFlags, 97 | _In_ DDS_LOADER_FLAGS loadFlags, 98 | _Outptr_opt_ ID3D11Resource** texture, 99 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 100 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 101 | 102 | HRESULT __cdecl CreateDDSTextureFromFileEx( 103 | _In_ ID3D11Device* d3dDevice, 104 | _In_z_ const wchar_t* szFileName, 105 | _In_ size_t maxsize, 106 | _In_ D3D11_USAGE usage, 107 | _In_ unsigned int bindFlags, 108 | _In_ unsigned int cpuAccessFlags, 109 | _In_ unsigned int miscFlags, 110 | _In_ DDS_LOADER_FLAGS loadFlags, 111 | _Outptr_opt_ ID3D11Resource** texture, 112 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 113 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 114 | 115 | // Extended version with optional auto-gen mipmap support 116 | HRESULT __cdecl CreateDDSTextureFromMemoryEx( 117 | _In_ ID3D11Device* d3dDevice, 118 | _In_opt_ ID3D11DeviceContext* d3dContext, 119 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, 120 | _In_ size_t ddsDataSize, 121 | _In_ size_t maxsize, 122 | _In_ D3D11_USAGE usage, 123 | _In_ unsigned int bindFlags, 124 | _In_ unsigned int cpuAccessFlags, 125 | _In_ unsigned int miscFlags, 126 | _In_ DDS_LOADER_FLAGS loadFlags, 127 | _Outptr_opt_ ID3D11Resource** texture, 128 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 129 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 130 | 131 | HRESULT __cdecl CreateDDSTextureFromFileEx( 132 | _In_ ID3D11Device* d3dDevice, 133 | _In_opt_ ID3D11DeviceContext* d3dContext, 134 | _In_z_ const wchar_t* szFileName, 135 | _In_ size_t maxsize, 136 | _In_ D3D11_USAGE usage, 137 | _In_ unsigned int bindFlags, 138 | _In_ unsigned int cpuAccessFlags, 139 | _In_ unsigned int miscFlags, 140 | _In_ DDS_LOADER_FLAGS loadFlags, 141 | _Outptr_opt_ ID3D11Resource** texture, 142 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 143 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr) noexcept; 144 | 145 | #ifdef __clang__ 146 | #pragma clang diagnostic push 147 | #pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec" 148 | #endif 149 | 150 | inline namespace DX11 151 | { 152 | DEFINE_ENUM_FLAG_OPERATORS(DDS_LOADER_FLAGS); 153 | } 154 | 155 | #ifdef __clang__ 156 | #pragma clang diagnostic pop 157 | #endif 158 | } 159 | -------------------------------------------------------------------------------- /Core/DXUTDevice11.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DXUTDevice11.h 3 | // 4 | // Enumerates D3D adapters, devices, modes, etc. 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkId=320437 10 | //-------------------------------------------------------------------------------------- 11 | #pragma once 12 | 13 | void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings); 14 | 15 | //-------------------------------------------------------------------------------------- 16 | // Functions to get bit depth from formats 17 | //-------------------------------------------------------------------------------------- 18 | HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc ); 19 | 20 | 21 | 22 | 23 | //-------------------------------------------------------------------------------------- 24 | // Optional memory create/destory functions. If not call, these will be called automatically 25 | //-------------------------------------------------------------------------------------- 26 | HRESULT WINAPI DXUTCreateD3D11Enumeration(); 27 | void WINAPI DXUTDestroyD3D11Enumeration(); 28 | 29 | 30 | 31 | 32 | //-------------------------------------------------------------------------------------- 33 | // Forward declarations 34 | //-------------------------------------------------------------------------------------- 35 | class CD3D11EnumAdapterInfo; 36 | class CD3D11EnumDeviceInfo; 37 | class CD3D11EnumOutputInfo; 38 | struct CD3D11EnumDeviceSettingsCombo; 39 | 40 | 41 | 42 | //-------------------------------------------------------------------------------------- 43 | // Enumerates available Direct3D11 adapters, devices, modes, etc. 44 | //-------------------------------------------------------------------------------------- 45 | class CD3D11Enumeration 46 | { 47 | public: 48 | // These should be called before Enumerate(). 49 | // 50 | // Use these calls and the IsDeviceAcceptable to control the contents of 51 | // the enumeration object, which affects the device selection and the device settings dialog. 52 | void SetResolutionMinMax( _In_ UINT nMinWidth, _In_ UINT nMinHeight, _In_ UINT nMaxWidth, _In_ UINT nMaxHeight ); 53 | void SetRefreshMinMax( _In_ UINT nMin, _In_ UINT nMax ); 54 | void SetForceFeatureLevel( _In_ D3D_FEATURE_LEVEL forceFL) { m_forceFL = forceFL; } 55 | void SetMultisampleQualityMax( _In_ UINT nMax ); 56 | void ResetPossibleDepthStencilFormats(); 57 | void SetEnumerateAllAdapterFormats( _In_ bool bEnumerateAllAdapterFormats ); 58 | 59 | // Call Enumerate() to enumerate available D3D11 adapters, devices, modes, etc. 60 | bool HasEnumerated() { return m_bHasEnumerated; } 61 | HRESULT Enumerate( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE IsD3D11DeviceAcceptableFunc, 62 | _In_opt_ void* pIsD3D11DeviceAcceptableFuncUserContext ); 63 | 64 | // These should be called after Enumerate() is called 65 | std::vector* GetAdapterInfoList(); 66 | CD3D11EnumAdapterInfo* GetAdapterInfo( _In_ UINT AdapterOrdinal ) const; 67 | CD3D11EnumDeviceInfo* GetDeviceInfo( _In_ UINT AdapterOrdinal, _In_ D3D_DRIVER_TYPE DeviceType ) const; 68 | CD3D11EnumOutputInfo* GetOutputInfo( _In_ UINT AdapterOrdinal, _In_ UINT Output ) const; 69 | CD3D11EnumDeviceSettingsCombo* GetDeviceSettingsCombo( _In_ DXUTD3D11DeviceSettings* pDeviceSettings ) const { return GetDeviceSettingsCombo( pDeviceSettings->AdapterOrdinal, pDeviceSettings->sd.BufferDesc.Format, pDeviceSettings->sd.Windowed ); } 70 | CD3D11EnumDeviceSettingsCombo* GetDeviceSettingsCombo( _In_ UINT AdapterOrdinal, _In_ DXGI_FORMAT BackBufferFormat, _In_ BOOL Windowed ) const; 71 | D3D_FEATURE_LEVEL GetWARPFeaturevel() const { return m_warpFL; } 72 | D3D_FEATURE_LEVEL GetREFFeaturevel() const { return m_refFL; } 73 | 74 | ~CD3D11Enumeration(); 75 | 76 | private: 77 | friend HRESULT WINAPI DXUTCreateD3D11Enumeration(); 78 | 79 | // Use DXUTGetD3D11Enumeration() to access global instance 80 | CD3D11Enumeration() noexcept; 81 | 82 | bool m_bHasEnumerated; 83 | LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE m_IsD3D11DeviceAcceptableFunc; 84 | void* m_pIsD3D11DeviceAcceptableFuncUserContext; 85 | 86 | std::vector m_DepthStencilPossibleList; 87 | 88 | bool m_bEnumerateAllAdapterFormats; 89 | D3D_FEATURE_LEVEL m_forceFL; 90 | D3D_FEATURE_LEVEL m_warpFL; 91 | D3D_FEATURE_LEVEL m_refFL; 92 | 93 | std::vector m_AdapterInfoList; 94 | 95 | HRESULT EnumerateOutputs( _In_ CD3D11EnumAdapterInfo *pAdapterInfo ); 96 | HRESULT EnumerateDevices( _In_ CD3D11EnumAdapterInfo *pAdapterInfo ); 97 | HRESULT EnumerateDeviceCombos( _In_ CD3D11EnumAdapterInfo* pAdapterInfo ); 98 | HRESULT EnumerateDeviceCombosNoAdapter( _In_ CD3D11EnumAdapterInfo* pAdapterInfo ); 99 | 100 | HRESULT EnumerateDisplayModes( _In_ CD3D11EnumOutputInfo *pOutputInfo ); 101 | void BuildMultiSampleQualityList( _In_ DXGI_FORMAT fmt, _In_ CD3D11EnumDeviceSettingsCombo* pDeviceCombo ); 102 | void ClearAdapterInfoList(); 103 | }; 104 | 105 | CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) ); 106 | 107 | 108 | #define DXGI_MAX_DEVICE_IDENTIFIER_STRING 128 109 | 110 | //-------------------------------------------------------------------------------------- 111 | // A class describing an adapter which contains a unique adapter ordinal 112 | // that is installed on the system 113 | //-------------------------------------------------------------------------------------- 114 | class CD3D11EnumAdapterInfo 115 | { 116 | const CD3D11EnumAdapterInfo &operator = ( const CD3D11EnumAdapterInfo &rhs ); 117 | 118 | public: 119 | CD3D11EnumAdapterInfo() noexcept : 120 | AdapterOrdinal( 0 ), 121 | AdapterDesc{}, 122 | szUniqueDescription{}, 123 | m_pAdapter( nullptr ), 124 | bAdapterUnavailable(false) 125 | { 126 | *szUniqueDescription = 0; 127 | memset( &AdapterDesc, 0, sizeof(AdapterDesc) ); 128 | } 129 | ~CD3D11EnumAdapterInfo(); 130 | 131 | UINT AdapterOrdinal; 132 | DXGI_ADAPTER_DESC AdapterDesc; 133 | WCHAR szUniqueDescription[DXGI_MAX_DEVICE_IDENTIFIER_STRING]; 134 | IDXGIAdapter *m_pAdapter; 135 | bool bAdapterUnavailable; 136 | 137 | std::vector outputInfoList; // Array of CD3D11EnumOutputInfo* 138 | std::vector deviceInfoList; // Array of CD3D11EnumDeviceInfo* 139 | // List of CD3D11EnumDeviceSettingsCombo* with a unique set 140 | // of BackBufferFormat, and Windowed 141 | std::vector deviceSettingsComboList; 142 | }; 143 | 144 | 145 | class CD3D11EnumOutputInfo 146 | { 147 | const CD3D11EnumOutputInfo &operator = ( const CD3D11EnumOutputInfo &rhs ); 148 | 149 | public: 150 | CD3D11EnumOutputInfo() noexcept : 151 | AdapterOrdinal(0), 152 | Output(0), 153 | m_pOutput(nullptr), 154 | Desc{} 155 | {} 156 | ~CD3D11EnumOutputInfo(); 157 | 158 | UINT AdapterOrdinal; 159 | UINT Output; 160 | IDXGIOutput* m_pOutput; 161 | DXGI_OUTPUT_DESC Desc; 162 | 163 | std::vector displayModeList; // Array of supported D3DDISPLAYMODEs 164 | }; 165 | 166 | 167 | //-------------------------------------------------------------------------------------- 168 | // A class describing a Direct3D11 device that contains a unique supported driver type 169 | //-------------------------------------------------------------------------------------- 170 | class CD3D11EnumDeviceInfo 171 | { 172 | const CD3D11EnumDeviceInfo& operator =( const CD3D11EnumDeviceInfo& rhs ); 173 | 174 | public: 175 | ~CD3D11EnumDeviceInfo(); 176 | 177 | UINT AdapterOrdinal; 178 | D3D_DRIVER_TYPE DeviceType; 179 | D3D_FEATURE_LEVEL SelectedLevel; 180 | D3D_FEATURE_LEVEL MaxLevel; 181 | BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; 182 | }; 183 | 184 | 185 | //-------------------------------------------------------------------------------------- 186 | // A struct describing device settings that contains a unique combination of 187 | // adapter format, back buffer format, and windowed that is compatible with a 188 | // particular Direct3D device and the app. 189 | //-------------------------------------------------------------------------------------- 190 | struct CD3D11EnumDeviceSettingsCombo 191 | { 192 | UINT AdapterOrdinal; 193 | D3D_DRIVER_TYPE DeviceType; 194 | DXGI_FORMAT BackBufferFormat; 195 | BOOL Windowed; 196 | UINT Output; 197 | 198 | std::vector multiSampleCountList; // List of valid sampling counts (multisampling) 199 | std::vector multiSampleQualityList; // List of number of quality levels for each multisample count 200 | 201 | CD3D11EnumAdapterInfo* pAdapterInfo; 202 | CD3D11EnumDeviceInfo* pDeviceInfo; 203 | CD3D11EnumOutputInfo* pOutputInfo; 204 | 205 | CD3D11EnumDeviceSettingsCombo() noexcept : 206 | AdapterOrdinal(0), 207 | DeviceType(D3D_DRIVER_TYPE_UNKNOWN), 208 | BackBufferFormat(DXGI_FORMAT_UNKNOWN), 209 | Windowed(FALSE), 210 | Output(0), 211 | pAdapterInfo(nullptr), 212 | pDeviceInfo(nullptr), 213 | pOutputInfo(nullptr) 214 | { } 215 | }; 216 | 217 | float DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo, 218 | _In_ DXUTD3D11DeviceSettings* pOptimalDeviceSettings, 219 | _Out_ int &bestModeIndex, 220 | _Out_ int &bestMSAAIndex 221 | ); 222 | -------------------------------------------------------------------------------- /Core/DXUT_2019_Win10.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Profile 14 | Win32 15 | 16 | 17 | Profile 18 | x64 19 | 20 | 21 | Release 22 | Win32 23 | 24 | 25 | Release 26 | x64 27 | 28 | 29 | 30 | DXUT 31 | {85344B7F-5AA0-4e12-A065-D1333D11F6CA} 32 | DXUT 33 | Win32Proj 34 | 10.0 35 | 36 | 37 | 38 | StaticLibrary 39 | true 40 | Unicode 41 | v142 42 | 43 | 44 | StaticLibrary 45 | true 46 | Unicode 47 | v142 48 | 49 | 50 | StaticLibrary 51 | true 52 | Unicode 53 | v142 54 | 55 | 56 | StaticLibrary 57 | true 58 | Unicode 59 | v142 60 | 61 | 62 | StaticLibrary 63 | true 64 | Unicode 65 | v142 66 | 67 | 68 | StaticLibrary 69 | true 70 | Unicode 71 | v142 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | true 96 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 97 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 98 | DXUT 99 | 100 | 101 | true 102 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 103 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 104 | DXUT 105 | 106 | 107 | true 108 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 109 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 110 | DXUT 111 | 112 | 113 | true 114 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 115 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 116 | DXUT 117 | 118 | 119 | true 120 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 121 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 122 | DXUT 123 | 124 | 125 | true 126 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 127 | Bin\Desktop_2019_Win10\$(Platform)\$(Configuration)\ 128 | DXUT 129 | 130 | 131 | 132 | Level4 133 | Disabled 134 | MultiThreadedDebugDLL 135 | Fast 136 | StreamingSIMDExtensions2 137 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 138 | WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 139 | $(IntDir)$(TargetName).pdb 140 | Use 141 | DXUT.h 142 | true 143 | ProgramDatabase 144 | false 145 | 146 | 147 | Windows 148 | true 149 | 150 | 151 | false 152 | 153 | 154 | 155 | 156 | Level4 157 | Disabled 158 | MultiThreadedDebugDLL 159 | Fast 160 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 161 | WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 162 | $(IntDir)$(TargetName).pdb 163 | Use 164 | DXUT.h 165 | true 166 | ProgramDatabase 167 | false 168 | 169 | 170 | Windows 171 | true 172 | 173 | 174 | false 175 | 176 | 177 | 178 | 179 | Level4 180 | MaxSpeed 181 | Fast 182 | StreamingSIMDExtensions2 183 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 184 | WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 185 | $(IntDir)$(TargetName).pdb 186 | Use 187 | DXUT.h 188 | true 189 | 190 | 191 | true 192 | Windows 193 | true 194 | true 195 | 196 | 197 | false 198 | 199 | 200 | 201 | 202 | Level4 203 | MaxSpeed 204 | Fast 205 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 206 | WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 207 | $(IntDir)$(TargetName).pdb 208 | Use 209 | DXUT.h 210 | true 211 | true 212 | 213 | 214 | true 215 | Windows 216 | true 217 | true 218 | 219 | 220 | false 221 | 222 | 223 | 224 | 225 | Level4 226 | MaxSpeed 227 | Fast 228 | StreamingSIMDExtensions2 229 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 230 | WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 231 | $(IntDir)$(TargetName).pdb 232 | Use 233 | DXUT.h 234 | true 235 | 236 | 237 | true 238 | Windows 239 | true 240 | true 241 | 242 | 243 | false 244 | 245 | 246 | 247 | 248 | Level4 249 | MaxSpeed 250 | Fast 251 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 252 | WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 253 | $(IntDir)$(TargetName).pdb 254 | Use 255 | DXUT.h 256 | true 257 | true 258 | 259 | 260 | true 261 | Windows 262 | true 263 | true 264 | 265 | 266 | false 267 | 268 | 269 | 270 | 271 | 272 | Create 273 | Create 274 | Create 275 | Create 276 | Create 277 | Create 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | -------------------------------------------------------------------------------- /Core/DXUT_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Core/DXUT_2022_Win10.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Profile 14 | Win32 15 | 16 | 17 | Profile 18 | x64 19 | 20 | 21 | Release 22 | Win32 23 | 24 | 25 | Release 26 | x64 27 | 28 | 29 | 30 | DXUT 31 | {85344B7F-5AA0-4e12-A065-D1333D11F6CA} 32 | DXUT 33 | Win32Proj 34 | 10.0 35 | 36 | 37 | 38 | StaticLibrary 39 | true 40 | Unicode 41 | v143 42 | 43 | 44 | StaticLibrary 45 | true 46 | Unicode 47 | v143 48 | 49 | 50 | StaticLibrary 51 | true 52 | Unicode 53 | v143 54 | 55 | 56 | StaticLibrary 57 | true 58 | Unicode 59 | v143 60 | 61 | 62 | StaticLibrary 63 | true 64 | Unicode 65 | v143 66 | 67 | 68 | StaticLibrary 69 | true 70 | Unicode 71 | v143 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | true 96 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 97 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 98 | DXUT 99 | 100 | 101 | true 102 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 103 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 104 | DXUT 105 | 106 | 107 | true 108 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 109 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 110 | DXUT 111 | 112 | 113 | true 114 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 115 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 116 | DXUT 117 | 118 | 119 | true 120 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 121 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 122 | DXUT 123 | 124 | 125 | true 126 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 127 | Bin\Desktop_2022_Win10\$(Platform)\$(Configuration)\ 128 | DXUT 129 | 130 | 131 | 132 | Level4 133 | Disabled 134 | MultiThreadedDebugDLL 135 | Fast 136 | StreamingSIMDExtensions2 137 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 138 | WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 139 | $(IntDir)$(TargetName).pdb 140 | Use 141 | DXUT.h 142 | true 143 | ProgramDatabase 144 | false 145 | 146 | 147 | Windows 148 | true 149 | 150 | 151 | false 152 | 153 | 154 | 155 | 156 | Level4 157 | Disabled 158 | MultiThreadedDebugDLL 159 | Fast 160 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 161 | WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 162 | $(IntDir)$(TargetName).pdb 163 | Use 164 | DXUT.h 165 | true 166 | ProgramDatabase 167 | false 168 | 169 | 170 | Windows 171 | true 172 | 173 | 174 | false 175 | 176 | 177 | 178 | 179 | Level4 180 | MaxSpeed 181 | Fast 182 | StreamingSIMDExtensions2 183 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 184 | WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 185 | $(IntDir)$(TargetName).pdb 186 | Use 187 | DXUT.h 188 | true 189 | 190 | 191 | true 192 | Windows 193 | true 194 | true 195 | 196 | 197 | false 198 | 199 | 200 | 201 | 202 | Level4 203 | MaxSpeed 204 | Fast 205 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 206 | WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 207 | $(IntDir)$(TargetName).pdb 208 | Use 209 | DXUT.h 210 | true 211 | true 212 | 213 | 214 | true 215 | Windows 216 | true 217 | true 218 | 219 | 220 | false 221 | 222 | 223 | 224 | 225 | Level4 226 | MaxSpeed 227 | Fast 228 | StreamingSIMDExtensions2 229 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 230 | WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 231 | $(IntDir)$(TargetName).pdb 232 | Use 233 | DXUT.h 234 | true 235 | 236 | 237 | true 238 | Windows 239 | true 240 | true 241 | 242 | 243 | false 244 | 245 | 246 | 247 | 248 | Level4 249 | MaxSpeed 250 | Fast 251 | /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions) 252 | WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_4;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions) 253 | $(IntDir)$(TargetName).pdb 254 | Use 255 | DXUT.h 256 | true 257 | true 258 | 259 | 260 | true 261 | Windows 262 | true 263 | true 264 | 265 | 266 | false 267 | 268 | 269 | 270 | 271 | 272 | Create 273 | Create 274 | Create 275 | Create 276 | Create 277 | Create 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | -------------------------------------------------------------------------------- /Core/DXUT_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Core/DXUT_DirectXTK_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Core/DXUT_DirectXTK_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Core/DXUTmisc.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DXUTMisc.h 3 | // 4 | // Helper functions for Direct3D programming. 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkId=320437 10 | //-------------------------------------------------------------------------------------- 11 | #pragma once 12 | 13 | //-------------------------------------------------------------------------------------- 14 | // XInput helper state/function 15 | // This performs extra processing on XInput gamepad data to make it slightly more convenient to use 16 | // 17 | // Example usage: 18 | // 19 | // DXUT_GAMEPAD gamepad[4]; 20 | // for( DWORD iPort=0; iPortSetPrivateData( WKPDID_D3DDebugObjectName, (UINT)strlen(pstrName), pstrName ); 185 | } 186 | inline void DXUT_SetDebugName( _In_ ID3D11Device* pObj, _In_z_ const CHAR* pstrName ) 187 | { 188 | if ( pObj ) 189 | pObj->SetPrivateData( WKPDID_D3DDebugObjectName, (UINT)strlen(pstrName), pstrName ); 190 | } 191 | inline void DXUT_SetDebugName( _In_ ID3D11DeviceChild* pObj, _In_z_ const CHAR* pstrName ) 192 | { 193 | if ( pObj ) 194 | pObj->SetPrivateData( WKPDID_D3DDebugObjectName, (UINT)strlen(pstrName), pstrName ); 195 | } 196 | #else 197 | #define DXUT_SetDebugName( pObj, pstrName ) 198 | #endif 199 | 200 | 201 | //-------------------------------------------------------------------------------------- 202 | // Some D3DPERF APIs take a color that can be used when displaying user events in 203 | // performance analysis tools. The following constants are provided for your 204 | // convenience, but you can use any colors you like. 205 | //-------------------------------------------------------------------------------------- 206 | const DWORD DXUT_PERFEVENTCOLOR = 0xFFC86464; 207 | const DWORD DXUT_PERFEVENTCOLOR2 = 0xFF64C864; 208 | const DWORD DXUT_PERFEVENTCOLOR3 = 0xFF6464C8; 209 | 210 | //-------------------------------------------------------------------------------------- 211 | // The following macros provide a convenient way for your code to call the D3DPERF 212 | // functions only when PROFILE is defined. If PROFILE is not defined (as for the final 213 | // release version of a program), these macros evaluate to nothing, so no detailed event 214 | // information is embedded in your shipping program. It is recommended that you create 215 | // and use three build configurations for your projects: 216 | // Debug (nonoptimized code, asserts active, PROFILE defined to assist debugging) 217 | // Profile (optimized code, asserts disabled, PROFILE defined to assist optimization) 218 | // Release (optimized code, asserts disabled, PROFILE not defined) 219 | //-------------------------------------------------------------------------------------- 220 | #ifdef PROFILE 221 | // PROFILE is defined, so these macros call the D3DPERF functions 222 | #define DXUT_BeginPerfEvent( color, pstrMessage ) DXUT_Dynamic_D3DPERF_BeginEvent( color, pstrMessage ) 223 | #define DXUT_EndPerfEvent() DXUT_Dynamic_D3DPERF_EndEvent() 224 | #define DXUT_SetPerfMarker( color, pstrMessage ) DXUT_Dynamic_D3DPERF_SetMarker( color, pstrMessage ) 225 | #else 226 | // PROFILE is not defined, so these macros do nothing 227 | #define DXUT_BeginPerfEvent( color, pstrMessage ) 228 | #define DXUT_EndPerfEvent() 229 | #define DXUT_SetPerfMarker( color, pstrMessage ) 230 | #endif 231 | 232 | //-------------------------------------------------------------------------------------- 233 | // CDXUTPerfEventGenerator is a helper class that makes it easy to attach begin and end 234 | // events to a block of code. Simply define a CDXUTPerfEventGenerator variable anywhere 235 | // in a block of code, and the class's constructor will call DXUT_BeginPerfEvent when 236 | // the block of code begins, and the class's destructor will call DXUT_EndPerfEvent when 237 | // the block ends. 238 | //-------------------------------------------------------------------------------------- 239 | class CDXUTPerfEventGenerator 240 | { 241 | public: 242 | CDXUTPerfEventGenerator( _In_ DWORD color, _In_z_ LPCWSTR pstrMessage ) 243 | { 244 | #ifdef PROFILE 245 | DXUT_BeginPerfEvent( color, pstrMessage ); 246 | #else 247 | UNREFERENCED_PARAMETER(color); 248 | UNREFERENCED_PARAMETER(pstrMessage); 249 | #endif 250 | } 251 | ~CDXUTPerfEventGenerator() 252 | { 253 | DXUT_EndPerfEvent(); 254 | } 255 | }; 256 | 257 | 258 | //-------------------------------------------------------------------------------------- 259 | // Multimon handling to support OSes with or without multimon API support. 260 | // Purposely avoiding the use of multimon.h so DXUT.lib doesn't require 261 | // COMPILE_MULTIMON_STUBS and cause complication with MFC or other users of multimon.h 262 | //-------------------------------------------------------------------------------------- 263 | #ifndef MONITOR_DEFAULTTOPRIMARY 264 | #define MONITORINFOF_PRIMARY 0x00000001 265 | #define MONITOR_DEFAULTTONULL 0x00000000 266 | #define MONITOR_DEFAULTTOPRIMARY 0x00000001 267 | #define MONITOR_DEFAULTTONEAREST 0x00000002 268 | typedef struct tagMONITORINFO 269 | { 270 | DWORD cbSize; 271 | RECT rcMonitor; 272 | RECT rcWork; 273 | DWORD dwFlags; 274 | } MONITORINFO, *LPMONITORINFO; 275 | typedef struct tagMONITORINFOEXW : public tagMONITORINFO 276 | { 277 | WCHAR szDevice[CCHDEVICENAME]; 278 | } MONITORINFOEXW, *LPMONITORINFOEXW; 279 | typedef MONITORINFOEXW MONITORINFOEX; 280 | typedef LPMONITORINFOEXW LPMONITORINFOEX; 281 | #endif 282 | 283 | HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags ); 284 | HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags ); 285 | BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo ); 286 | void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight ); 287 | 288 | 289 | //-------------------------------------------------------------------------------------- 290 | // Helper functions to create SRGB formats from typeless formats and vice versa 291 | //-------------------------------------------------------------------------------------- 292 | DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format ); 293 | DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format ); 294 | -------------------------------------------------------------------------------- /Core/ScreenGrab.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: ScreenGrab.h 3 | // 4 | // Function for capturing a 2D texture and saving it to a file (aka a 'screenshot' 5 | // when used on a Direct3D 11 Render Target). 6 | // 7 | // Note these functions are useful as a light-weight runtime screen grabber. For 8 | // full-featured texture capture, DDS writer, and texture processing pipeline, 9 | // see the 'Texconv' sample and the 'DirectXTex' library. 10 | // 11 | // Copyright (c) Microsoft Corporation. 12 | // Licensed under the MIT License. 13 | // 14 | // http://go.microsoft.com/fwlink/?LinkId=248926 15 | // http://go.microsoft.com/fwlink/?LinkId=248929 16 | //-------------------------------------------------------------------------------------- 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #if defined(NTDDI_WIN10_FE) || defined(__MINGW32__) 23 | #include 24 | #else 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | 31 | namespace DirectX 32 | { 33 | HRESULT __cdecl SaveDDSTextureToFile( 34 | _In_ ID3D11DeviceContext* pContext, 35 | _In_ ID3D11Resource* pSource, 36 | _In_z_ const wchar_t* fileName) noexcept; 37 | 38 | HRESULT __cdecl SaveWICTextureToFile( 39 | _In_ ID3D11DeviceContext* pContext, 40 | _In_ ID3D11Resource* pSource, 41 | _In_ REFGUID guidContainerFormat, 42 | _In_z_ const wchar_t* fileName, 43 | _In_opt_ const GUID* targetFormat = nullptr, 44 | std::function setCustomProps = nullptr, 45 | _In_ bool forceSRGB = false); 46 | } 47 | -------------------------------------------------------------------------------- /Core/WICTextureLoader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: WICTextureLoader.h 3 | // 4 | // Function for loading a WIC image and creating a Direct3D runtime texture for it 5 | // (auto-generating mipmaps if possible) 6 | // 7 | // Note: Assumes application has already called CoInitializeEx 8 | // 9 | // Warning: CreateWICTexture* functions are not thread-safe if given a d3dContext instance for 10 | // auto-gen mipmap support. 11 | // 12 | // Note these functions are useful for images created as simple 2D textures. For 13 | // more complex resources, DDSTextureLoader is an excellent light-weight runtime loader. 14 | // For a full-featured DDS file reader, writer, and texture processing pipeline see 15 | // the 'Texconv' sample and the 'DirectXTex' library. 16 | // 17 | // Copyright (c) Microsoft Corporation. 18 | // Licensed under the MIT License. 19 | // 20 | // http://go.microsoft.com/fwlink/?LinkId=248926 21 | // http://go.microsoft.com/fwlink/?LinkId=248929 22 | //-------------------------------------------------------------------------------------- 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | namespace DirectX 32 | { 33 | inline namespace DX11 34 | { 35 | enum WIC_LOADER_FLAGS : uint32_t 36 | { 37 | WIC_LOADER_DEFAULT = 0, 38 | WIC_LOADER_FORCE_SRGB = 0x1, 39 | WIC_LOADER_IGNORE_SRGB = 0x2, 40 | WIC_LOADER_SRGB_DEFAULT = 0x4, 41 | WIC_LOADER_FIT_POW2 = 0x20, 42 | WIC_LOADER_MAKE_SQUARE = 0x40, 43 | WIC_LOADER_FORCE_RGBA32 = 0x80, 44 | }; 45 | } 46 | 47 | // Standard version 48 | HRESULT __cdecl CreateWICTextureFromMemory( 49 | _In_ ID3D11Device* d3dDevice, 50 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData, 51 | _In_ size_t wicDataSize, 52 | _Outptr_opt_ ID3D11Resource** texture, 53 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 54 | _In_ size_t maxsize = 0) noexcept; 55 | 56 | HRESULT __cdecl CreateWICTextureFromFile( 57 | _In_ ID3D11Device* d3dDevice, 58 | _In_z_ const wchar_t* szFileName, 59 | _Outptr_opt_ ID3D11Resource** texture, 60 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 61 | _In_ size_t maxsize = 0) noexcept; 62 | 63 | // Standard version with optional auto-gen mipmap support 64 | HRESULT __cdecl CreateWICTextureFromMemory( 65 | _In_ ID3D11Device* d3dDevice, 66 | _In_opt_ ID3D11DeviceContext* d3dContext, 67 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData, 68 | _In_ size_t wicDataSize, 69 | _Outptr_opt_ ID3D11Resource** texture, 70 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 71 | _In_ size_t maxsize = 0) noexcept; 72 | 73 | HRESULT __cdecl CreateWICTextureFromFile( 74 | _In_ ID3D11Device* d3dDevice, 75 | _In_opt_ ID3D11DeviceContext* d3dContext, 76 | _In_z_ const wchar_t* szFileName, 77 | _Outptr_opt_ ID3D11Resource** texture, 78 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 79 | _In_ size_t maxsize = 0) noexcept; 80 | 81 | // Extended version 82 | HRESULT __cdecl CreateWICTextureFromMemoryEx( 83 | _In_ ID3D11Device* d3dDevice, 84 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData, 85 | _In_ size_t wicDataSize, 86 | _In_ size_t maxsize, 87 | _In_ D3D11_USAGE usage, 88 | _In_ unsigned int bindFlags, 89 | _In_ unsigned int cpuAccessFlags, 90 | _In_ unsigned int miscFlags, 91 | _In_ WIC_LOADER_FLAGS loadFlags, 92 | _Outptr_opt_ ID3D11Resource** texture, 93 | _Outptr_opt_ ID3D11ShaderResourceView** textureView) noexcept; 94 | 95 | HRESULT __cdecl CreateWICTextureFromFileEx( 96 | _In_ ID3D11Device* d3dDevice, 97 | _In_z_ const wchar_t* szFileName, 98 | _In_ size_t maxsize, 99 | _In_ D3D11_USAGE usage, 100 | _In_ unsigned int bindFlags, 101 | _In_ unsigned int cpuAccessFlags, 102 | _In_ unsigned int miscFlags, 103 | _In_ WIC_LOADER_FLAGS loadFlags, 104 | _Outptr_opt_ ID3D11Resource** texture, 105 | _Outptr_opt_ ID3D11ShaderResourceView** textureView) noexcept; 106 | 107 | // Extended version with optional auto-gen mipmap support 108 | HRESULT __cdecl CreateWICTextureFromMemoryEx( 109 | _In_ ID3D11Device* d3dDevice, 110 | _In_opt_ ID3D11DeviceContext* d3dContext, 111 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData, 112 | _In_ size_t wicDataSize, 113 | _In_ size_t maxsize, 114 | _In_ D3D11_USAGE usage, 115 | _In_ unsigned int bindFlags, 116 | _In_ unsigned int cpuAccessFlags, 117 | _In_ unsigned int miscFlags, 118 | _In_ WIC_LOADER_FLAGS loadFlags, 119 | _Outptr_opt_ ID3D11Resource** texture, 120 | _Outptr_opt_ ID3D11ShaderResourceView** textureView) noexcept; 121 | 122 | HRESULT __cdecl CreateWICTextureFromFileEx( 123 | _In_ ID3D11Device* d3dDevice, 124 | _In_opt_ ID3D11DeviceContext* d3dContext, 125 | _In_z_ const wchar_t* szFileName, 126 | _In_ size_t maxsize, 127 | _In_ D3D11_USAGE usage, 128 | _In_ unsigned int bindFlags, 129 | _In_ unsigned int cpuAccessFlags, 130 | _In_ unsigned int miscFlags, 131 | _In_ WIC_LOADER_FLAGS loadFlags, 132 | _Outptr_opt_ ID3D11Resource** texture, 133 | _Outptr_opt_ ID3D11ShaderResourceView** textureView) noexcept; 134 | 135 | #ifdef __clang__ 136 | #pragma clang diagnostic push 137 | #pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec" 138 | #endif 139 | 140 | inline namespace DX11 141 | { 142 | DEFINE_ENUM_FLAG_OPERATORS(WIC_LOADER_FLAGS); 143 | } 144 | 145 | #ifdef __clang__ 146 | #pragma clang diagnostic pop 147 | #endif 148 | } 149 | -------------------------------------------------------------------------------- /Core/dxerr.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DXErr.h 3 | // 4 | // DirectX Error Library 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | //-------------------------------------------------------------------------------------- 9 | 10 | // This version only supports UNICODE. 11 | 12 | #pragma once 13 | 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | //-------------------------------------------------------------------------------------- 22 | // DXGetErrorString 23 | //-------------------------------------------------------------------------------------- 24 | const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ); 25 | 26 | #define DXGetErrorString DXGetErrorStringW 27 | 28 | //-------------------------------------------------------------------------------------- 29 | // DXGetErrorDescription has to be modified to return a copy in a buffer rather than 30 | // the original static string. 31 | //-------------------------------------------------------------------------------------- 32 | void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count ); 33 | 34 | #define DXGetErrorDescription DXGetErrorDescriptionW 35 | 36 | //-------------------------------------------------------------------------------------- 37 | // DXTrace 38 | // 39 | // Desc: Outputs a formatted error message to the debug stream 40 | // 41 | // Args: WCHAR* strFile The current file, typically passed in using the 42 | // __FILEW__ macro. 43 | // DWORD dwLine The current line number, typically passed in using the 44 | // __LINE__ macro. 45 | // HRESULT hr An HRESULT that will be traced to the debug stream. 46 | // CHAR* strMsg A string that will be traced to the debug stream (may be NULL) 47 | // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. 48 | // 49 | // Return: The hr that was passed in. 50 | //-------------------------------------------------------------------------------------- 51 | HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox ); 52 | 53 | #define DXTrace DXTraceW 54 | 55 | //-------------------------------------------------------------------------------------- 56 | // 57 | // Helper macros 58 | // 59 | //-------------------------------------------------------------------------------------- 60 | #if defined(DEBUG) || defined(_DEBUG) 61 | #ifdef _MSC_VER 62 | #define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false ) 63 | #define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false ) 64 | #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true ) 65 | #else 66 | #define DXUT_PASTE(x, y) x##y 67 | #define DXUT_MAKEWIDE(x) DXUT_PASTE(L,x) 68 | #define DXTRACE_MSG(str) DXTrace( DXUT_MAKEWIDE(__FILE__), (DWORD)__LINE__, 0, str, false ) 69 | #define DXTRACE_ERR(str,hr) DXTrace( DXUT_MAKEWIDE(__FILE__), (DWORD)__LINE__, hr, str, false ) 70 | #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( DXUT_MAKEWIDE(__FILE__), (DWORD)__LINE__, hr, str, true ) 71 | #endif 72 | #else 73 | #define DXTRACE_MSG(str) (0L) 74 | #define DXTRACE_ERR(str,hr) (hr) 75 | #define DXTRACE_ERR_MSGBOX(str,hr) (hr) 76 | #endif 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif //__cplusplus 81 | -------------------------------------------------------------------------------- /DXUT_2019_Win10.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 15.0.27703.2000 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "Core\DXUT_2019_Win10.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "Optional\DXUTOpt_2019_Win10.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4C959E18-6969-4523-88A8-05DA5B36F168}" 11 | ProjectSection(SolutionItems) = preProject 12 | .editorconfig = .editorconfig 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Win32 = Debug|Win32 18 | Debug|x64 = Debug|x64 19 | Profile|Win32 = Profile|Win32 20 | Profile|x64 = Profile|x64 21 | Release|Win32 = Release|Win32 22 | Release|x64 = Release|x64 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.ActiveCfg = Debug|Win32 26 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Build.0 = Debug|Win32 27 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Deploy.0 = Debug|Win32 28 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64 29 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64 30 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Deploy.0 = Debug|x64 31 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.ActiveCfg = Profile|Win32 32 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Build.0 = Profile|Win32 33 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Deploy.0 = Profile|Win32 34 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.ActiveCfg = Profile|x64 35 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Build.0 = Profile|x64 36 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Deploy.0 = Profile|x64 37 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.ActiveCfg = Release|Win32 38 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Build.0 = Release|Win32 39 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Deploy.0 = Release|Win32 40 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64 41 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64 42 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Deploy.0 = Release|x64 43 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.ActiveCfg = Debug|Win32 44 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Build.0 = Debug|Win32 45 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Deploy.0 = Debug|Win32 46 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64 47 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64 48 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Deploy.0 = Debug|x64 49 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.ActiveCfg = Profile|Win32 50 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Build.0 = Profile|Win32 51 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Deploy.0 = Profile|Win32 52 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.ActiveCfg = Profile|x64 53 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Build.0 = Profile|x64 54 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Deploy.0 = Profile|x64 55 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.ActiveCfg = Release|Win32 56 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Build.0 = Release|Win32 57 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Deploy.0 = Release|Win32 58 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64 59 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64 60 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Deploy.0 = Release|x64 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | GlobalSection(ExtensibilityGlobals) = postSolution 66 | SolutionGuid = {47CE266D-B0B1-44CE-A32C-E57A18C54CF3} 67 | EndGlobalSection 68 | EndGlobal 69 | -------------------------------------------------------------------------------- /DXUT_2022_Win10.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 15.0.27703.2000 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "Core\DXUT_2022_Win10.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "Optional\DXUTOpt_2022_Win10.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4C959E18-6969-4523-88A8-05DA5B36F168}" 11 | ProjectSection(SolutionItems) = preProject 12 | .editorconfig = .editorconfig 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Win32 = Debug|Win32 18 | Debug|x64 = Debug|x64 19 | Profile|Win32 = Profile|Win32 20 | Profile|x64 = Profile|x64 21 | Release|Win32 = Release|Win32 22 | Release|x64 = Release|x64 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.ActiveCfg = Debug|Win32 26 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Build.0 = Debug|Win32 27 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Deploy.0 = Debug|Win32 28 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64 29 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64 30 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Deploy.0 = Debug|x64 31 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.ActiveCfg = Profile|Win32 32 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Build.0 = Profile|Win32 33 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Deploy.0 = Profile|Win32 34 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.ActiveCfg = Profile|x64 35 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Build.0 = Profile|x64 36 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Deploy.0 = Profile|x64 37 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.ActiveCfg = Release|Win32 38 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Build.0 = Release|Win32 39 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Deploy.0 = Release|Win32 40 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64 41 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64 42 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Deploy.0 = Release|x64 43 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.ActiveCfg = Debug|Win32 44 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Build.0 = Debug|Win32 45 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Deploy.0 = Debug|Win32 46 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64 47 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64 48 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Deploy.0 = Debug|x64 49 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.ActiveCfg = Profile|Win32 50 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Build.0 = Profile|Win32 51 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Deploy.0 = Profile|Win32 52 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.ActiveCfg = Profile|x64 53 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Build.0 = Profile|x64 54 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Deploy.0 = Profile|x64 55 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.ActiveCfg = Release|Win32 56 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Build.0 = Release|Win32 57 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Deploy.0 = Release|Win32 58 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64 59 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64 60 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Deploy.0 = Release|x64 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | GlobalSection(ExtensibilityGlobals) = postSolution 66 | SolutionGuid = {47CE266D-B0B1-44CE-A32C-E57A18C54CF3} 67 | EndGlobalSection 68 | EndGlobal 69 | -------------------------------------------------------------------------------- /DXUT_DirectXTK_2019_Win10.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 15.0.27703.2000 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "Core\DXUT_DirectXTK_2019_Win10.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} = {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "Optional\DXUTOpt_DirectXTK_2019_Win10.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} = {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} 14 | EndProjectSection 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2019", "..\DirectXTK\DirectXTK_Desktop_2019.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EACA61D-02C5-45AC-AB92-6665F9022F62}" 19 | ProjectSection(SolutionItems) = preProject 20 | .editorconfig = .editorconfig 21 | EndProjectSection 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Win32 = Debug|Win32 26 | Debug|x64 = Debug|x64 27 | Profile|Win32 = Profile|Win32 28 | Profile|x64 = Profile|x64 29 | Release|Win32 = Release|Win32 30 | Release|x64 = Release|x64 31 | EndGlobalSection 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 33 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.ActiveCfg = Debug|Win32 34 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Build.0 = Debug|Win32 35 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Deploy.0 = Debug|Win32 36 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64 37 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64 38 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Deploy.0 = Debug|x64 39 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.ActiveCfg = Profile|Win32 40 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Build.0 = Profile|Win32 41 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Deploy.0 = Profile|Win32 42 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.ActiveCfg = Profile|x64 43 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Build.0 = Profile|x64 44 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Deploy.0 = Profile|x64 45 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.ActiveCfg = Release|Win32 46 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Build.0 = Release|Win32 47 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Deploy.0 = Release|Win32 48 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64 49 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64 50 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Deploy.0 = Release|x64 51 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.ActiveCfg = Debug|Win32 52 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Build.0 = Debug|Win32 53 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Deploy.0 = Debug|Win32 54 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64 55 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64 56 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Deploy.0 = Debug|x64 57 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.ActiveCfg = Profile|Win32 58 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Build.0 = Profile|Win32 59 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Deploy.0 = Profile|Win32 60 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.ActiveCfg = Profile|x64 61 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Build.0 = Profile|x64 62 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Deploy.0 = Profile|x64 63 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.ActiveCfg = Release|Win32 64 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Build.0 = Release|Win32 65 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Deploy.0 = Release|Win32 66 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64 67 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64 68 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Deploy.0 = Release|x64 69 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 70 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 71 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Deploy.0 = Debug|Win32 72 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 73 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 74 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Deploy.0 = Debug|x64 75 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.ActiveCfg = Release|Win32 76 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.Build.0 = Release|Win32 77 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.Deploy.0 = Release|Win32 78 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.ActiveCfg = Release|x64 79 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.Build.0 = Release|x64 80 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.Deploy.0 = Release|x64 81 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 82 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 83 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Deploy.0 = Release|Win32 84 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 85 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 86 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Deploy.0 = Release|x64 87 | EndGlobalSection 88 | GlobalSection(SolutionProperties) = preSolution 89 | HideSolutionNode = FALSE 90 | EndGlobalSection 91 | GlobalSection(ExtensibilityGlobals) = postSolution 92 | SolutionGuid = {298153E7-D73B-4B15-9824-69D4725B153C} 93 | EndGlobalSection 94 | EndGlobal 95 | -------------------------------------------------------------------------------- /DXUT_DirectXTK_2022_Win10.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 15.0.27703.2000 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "Core\DXUT_DirectXTK_2022_Win10.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} = {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "Optional\DXUTOpt_DirectXTK_2022_Win10.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} = {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} 14 | EndProjectSection 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2022", "..\DirectXTK\DirectXTK_Desktop_2022.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EACA61D-02C5-45AC-AB92-6665F9022F62}" 19 | ProjectSection(SolutionItems) = preProject 20 | .editorconfig = .editorconfig 21 | EndProjectSection 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Win32 = Debug|Win32 26 | Debug|x64 = Debug|x64 27 | Profile|Win32 = Profile|Win32 28 | Profile|x64 = Profile|x64 29 | Release|Win32 = Release|Win32 30 | Release|x64 = Release|x64 31 | EndGlobalSection 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 33 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.ActiveCfg = Debug|Win32 34 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Build.0 = Debug|Win32 35 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|Win32.Deploy.0 = Debug|Win32 36 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64 37 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64 38 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Deploy.0 = Debug|x64 39 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.ActiveCfg = Profile|Win32 40 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Build.0 = Profile|Win32 41 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|Win32.Deploy.0 = Profile|Win32 42 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.ActiveCfg = Profile|x64 43 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Build.0 = Profile|x64 44 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Profile|x64.Deploy.0 = Profile|x64 45 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.ActiveCfg = Release|Win32 46 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Build.0 = Release|Win32 47 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|Win32.Deploy.0 = Release|Win32 48 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64 49 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64 50 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Deploy.0 = Release|x64 51 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.ActiveCfg = Debug|Win32 52 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Build.0 = Debug|Win32 53 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|Win32.Deploy.0 = Debug|Win32 54 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64 55 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64 56 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Deploy.0 = Debug|x64 57 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.ActiveCfg = Profile|Win32 58 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Build.0 = Profile|Win32 59 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|Win32.Deploy.0 = Profile|Win32 60 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.ActiveCfg = Profile|x64 61 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Build.0 = Profile|x64 62 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Profile|x64.Deploy.0 = Profile|x64 63 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.ActiveCfg = Release|Win32 64 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Build.0 = Release|Win32 65 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|Win32.Deploy.0 = Release|Win32 66 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64 67 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64 68 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Deploy.0 = Release|x64 69 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 70 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 71 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Deploy.0 = Debug|Win32 72 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 73 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 74 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Deploy.0 = Debug|x64 75 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.ActiveCfg = Release|Win32 76 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.Build.0 = Release|Win32 77 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.Deploy.0 = Release|Win32 78 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.ActiveCfg = Release|x64 79 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.Build.0 = Release|x64 80 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.Deploy.0 = Release|x64 81 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 82 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 83 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Deploy.0 = Release|Win32 84 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 85 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 86 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Deploy.0 = Release|x64 87 | EndGlobalSection 88 | GlobalSection(SolutionProperties) = preSolution 89 | HideSolutionNode = FALSE 90 | EndGlobalSection 91 | GlobalSection(ExtensibilityGlobals) = postSolution 92 | SolutionGuid = {298153E7-D73B-4B15-9824-69D4725B153C} 93 | EndGlobalSection 94 | EndGlobal 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /Media/UI/Font.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DXUT/2b7f8caca999a79c279bb937195e208e4de6374c/Media/UI/Font.dds -------------------------------------------------------------------------------- /Media/UI/dxutcontrols.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DXUT/2b7f8caca999a79c279bb937195e208e4de6374c/Media/UI/dxutcontrols.dds -------------------------------------------------------------------------------- /Optional/DXUTLockFreePipe.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // DXUTLockFreePipe.h 3 | // 4 | // See the "Lockless Programming Considerations for Xbox 360 and Microsoft Windows" 5 | // article for more details. 6 | // 7 | // http://msdn.microsoft.com/en-us/library/ee418650.aspx 8 | // 9 | // Copyright (c) Microsoft Corporation. 10 | // Licensed under the MIT License. 11 | // 12 | // http://go.microsoft.com/fwlink/?LinkId=320437 13 | //-------------------------------------------------------------------------------------- 14 | #pragma once 15 | 16 | #include 17 | #include 18 | 19 | #pragma pack(push) 20 | #pragma pack(8) 21 | #include 22 | #pragma pack (pop) 23 | 24 | #ifdef _MSC_VER 25 | extern "C" void _ReadWriteBarrier(); 26 | #pragma intrinsic(_ReadWriteBarrier) 27 | #endif 28 | 29 | // Prevent the compiler from rearranging loads 30 | // and stores, sufficiently for read-acquire 31 | // and write-release. This is sufficient on 32 | // x86 and x64. 33 | #define DXUTImportBarrier _ReadWriteBarrier 34 | #define DXUTExportBarrier _ReadWriteBarrier 35 | 36 | // 37 | // Pipe class designed for use by at most two threads: one reader, one writer. 38 | // Access by more than two threads isn't guaranteed to be safe. 39 | // 40 | // In order to provide efficient access the size of the buffer is passed 41 | // as a template parameter and restricted to powers of two less than 31. 42 | // 43 | 44 | template class DXUTLockFreePipe 45 | { 46 | public: 47 | DXUTLockFreePipe() : m_readOffset( 0 ), 48 | m_writeOffset( 0 ) 49 | { 50 | } 51 | 52 | DWORD GetBufferSize() const 53 | { 54 | return c_cbBufferSize; 55 | } 56 | 57 | __forceinline unsigned long BytesAvailable() const 58 | { 59 | return m_writeOffset - m_readOffset; 60 | } 61 | 62 | bool __forceinline Read( _Out_writes_(cbDest) void* pvDest, _In_ unsigned long cbDest ) 63 | { 64 | // Store the read and write offsets into local variables--this is 65 | // essentially a snapshot of their values so that they stay constant 66 | // for the duration of the function (and so we don't end up with cache 67 | // misses due to false sharing). 68 | DWORD readOffset = m_readOffset; 69 | DWORD writeOffset = m_writeOffset; 70 | 71 | // Compare the two offsets to see if we have anything to read. 72 | // Note that we don't do anything to synchronize the offsets here. 73 | // Really there's not much we *can* do unless we're willing to completely 74 | // synchronize access to the entire object. We have to assume that as we 75 | // read, someone else may be writing, and the write offset we have now 76 | // may be out of date by the time we read it. Fortunately that's not a 77 | // very big deal. We might miss reading some data that was just written. 78 | // But the assumption is that we'll be back before long to grab more data 79 | // anyway. 80 | // 81 | // Note that this comparison works because we're careful to constrain 82 | // the total buffer size to be a power of 2, which means it will divide 83 | // evenly into ULONG_MAX+1. That, and the fact that the offsets are 84 | // unsigned, means that the calculation returns correct results even 85 | // when the values wrap around. 86 | DWORD cbAvailable = writeOffset - readOffset; 87 | if( cbDest > cbAvailable ) 88 | { 89 | return false; 90 | } 91 | 92 | // The data has been made available, but we need to make sure 93 | // that our view on the data is up to date -- at least as up to 94 | // date as the control values we just read. We need to prevent 95 | // the compiler or CPU from moving any of the data reads before 96 | // the control value reads. This import barrier serves this 97 | // purpose, on Xbox 360 and on Windows. 98 | 99 | // Reading a control value and then having a barrier is known 100 | // as a "read-acquire." 101 | DXUTImportBarrier(); 102 | 103 | unsigned char* pbDest = ( unsigned char* )pvDest; 104 | 105 | unsigned long actualReadOffset = readOffset & c_sizeMask; 106 | unsigned long bytesLeft = cbDest; 107 | 108 | // 109 | // Copy from the tail, then the head. Note that there's no explicit 110 | // check to see if the write offset comes between the read offset 111 | // and the end of the buffer--that particular condition is implicitly 112 | // checked by the comparison with AvailableToRead(), above. If copying 113 | // cbDest bytes off the tail would cause us to cross the write offset, 114 | // then the previous comparison would have failed since that would imply 115 | // that there were less than cbDest bytes available to read. 116 | // 117 | unsigned long cbTailBytes = std::min( bytesLeft, c_cbBufferSize - actualReadOffset ); 118 | memcpy( pbDest, m_pbBuffer + actualReadOffset, cbTailBytes ); 119 | bytesLeft -= cbTailBytes; 120 | 121 | if( bytesLeft ) 122 | { 123 | memcpy( pbDest + cbTailBytes, m_pbBuffer, bytesLeft ); 124 | } 125 | 126 | // When we update the read offset we are, effectively, 'freeing' buffer 127 | // memory so that the writing thread can use it. We need to make sure that 128 | // we don't free the memory before we have finished reading it. That is, 129 | // we need to make sure that the write to m_readOffset can't get reordered 130 | // above the reads of the buffer data. The only way to guarantee this is to 131 | // have an export barrier to prevent both compiler and CPU rearrangements. 132 | DXUTExportBarrier(); 133 | 134 | // Advance the read offset. From the CPUs point of view this is several 135 | // operations--read, modify, store--and we'd normally want to make sure that 136 | // all of the operations happened atomically. But in the case of a single 137 | // reader, only one thread updates this value and so the only operation that 138 | // must be atomic is the store. That's lucky, because 32-bit aligned stores are 139 | // atomic on all modern processors. 140 | // 141 | readOffset += cbDest; 142 | m_readOffset = readOffset; 143 | 144 | return true; 145 | } 146 | 147 | bool __forceinline Write( _In_reads_(cbSrc) const void* pvSrc, _In_ unsigned long cbSrc ) 148 | { 149 | // Reading the read offset here has the same caveats as reading 150 | // the write offset had in the Read() function above. 151 | DWORD readOffset = m_readOffset; 152 | DWORD writeOffset = m_writeOffset; 153 | 154 | // Compute the available write size. This comparison relies on 155 | // the fact that the buffer size is always a power of 2, and the 156 | // offsets are unsigned integers, so that when the write pointer 157 | // wraps around the subtraction still yields a value (assuming 158 | // we haven't messed up somewhere else) between 0 and c_cbBufferSize - 1. 159 | DWORD cbAvailable = c_cbBufferSize - ( writeOffset - readOffset ); 160 | if( cbSrc > cbAvailable ) 161 | { 162 | return false; 163 | } 164 | 165 | // It is theoretically possible for writes of the data to be reordered 166 | // above the reads to see if the data is available. Improbable perhaps, 167 | // but possible. This barrier guarantees that the reordering will not 168 | // happen. 169 | DXUTImportBarrier(); 170 | 171 | // Write the data 172 | const unsigned char* pbSrc = ( const unsigned char* )pvSrc; 173 | unsigned long actualWriteOffset = writeOffset & c_sizeMask; 174 | unsigned long bytesLeft = cbSrc; 175 | 176 | // See the explanation in the Read() function as to why we don't 177 | // explicitly check against the read offset here. 178 | unsigned long cbTailBytes = std::min( bytesLeft, c_cbBufferSize - actualWriteOffset ); 179 | memcpy( m_pbBuffer + actualWriteOffset, pbSrc, cbTailBytes ); 180 | bytesLeft -= cbTailBytes; 181 | 182 | if( bytesLeft ) 183 | { 184 | memcpy( m_pbBuffer, pbSrc + cbTailBytes, bytesLeft ); 185 | } 186 | 187 | // Now it's time to update the write offset, but since the updated position 188 | // of the write offset will imply that there's data to be read, we need to 189 | // make sure that the data all actually gets written before the update to 190 | // the write offset. The writes could be reordered by the compiler (on any 191 | // platform) or by the CPU (on Xbox 360). We need a barrier which prevents 192 | // the writes from being reordered past each other. 193 | // 194 | // Having a barrier and then writing a control value is called "write-release." 195 | DXUTExportBarrier(); 196 | 197 | // See comments in Read() as to why this operation isn't interlocked. 198 | writeOffset += cbSrc; 199 | m_writeOffset = writeOffset; 200 | 201 | return true; 202 | } 203 | 204 | private: 205 | // Values derived from the buffer size template parameter 206 | // 207 | static const BYTE c_cbBufferSizeLog2 = __min( cbBufferSizeLog2, 31 ); 208 | static const DWORD c_cbBufferSize = ( 1 << c_cbBufferSizeLog2 ); 209 | static const DWORD c_sizeMask = c_cbBufferSize - 1; 210 | 211 | // Leave these private and undefined to prevent their use 212 | DXUTLockFreePipe( const DXUTLockFreePipe& ); 213 | DXUTLockFreePipe& operator =( const DXUTLockFreePipe& ); 214 | 215 | // Member data 216 | // 217 | BYTE m_pbBuffer[c_cbBufferSize]; 218 | // Note that these offsets are not clamped to the buffer size. 219 | // Instead the calculations rely on wrapping at ULONG_MAX+1. 220 | // See the comments in Read() for details. 221 | volatile DWORD __declspec( align( 4 ) ) m_readOffset; 222 | volatile DWORD __declspec( align( 4 ) ) m_writeOffset; 223 | }; 224 | -------------------------------------------------------------------------------- /Optional/DXUTOpt_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Optional/DXUTOpt_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Optional/DXUTOpt_DirectXTK_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Optional/DXUTOpt_DirectXTK_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Optional/DXUTguiIME.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DXUTguiIME.h 3 | // 4 | // Copyright (c) Microsoft Corporation. 5 | // Licensed under the MIT License. 6 | // 7 | // http://go.microsoft.com/fwlink/?LinkId=320437 8 | //-------------------------------------------------------------------------------------- 9 | #pragma once 10 | 11 | #include 12 | #include 13 | #include "ImeUi.h" 14 | 15 | //-------------------------------------------------------------------------------------- 16 | // Forward declarations 17 | //-------------------------------------------------------------------------------------- 18 | class CDXUTIMEEditBox; 19 | 20 | 21 | //----------------------------------------------------------------------------- 22 | // IME-enabled EditBox control 23 | //----------------------------------------------------------------------------- 24 | #define MAX_COMPSTRING_SIZE 256 25 | 26 | 27 | class CDXUTIMEEditBox : public CDXUTEditBox 28 | { 29 | public: 30 | 31 | static HRESULT CreateIMEEditBox( _In_ CDXUTDialog* pDialog, _In_ int ID, _In_z_ LPCWSTR strText, _In_ int x, _In_ int y, _In_ int width, 32 | _In_ int height, _In_ bool bIsDefault=false, _Outptr_opt_ CDXUTIMEEditBox** ppCreated=nullptr ); 33 | 34 | CDXUTIMEEditBox( _In_opt_ CDXUTDialog* pDialog = nullptr ) noexcept; 35 | virtual ~CDXUTIMEEditBox(); 36 | 37 | static void InitDefaultElements( _In_ CDXUTDialog* pDialog ); 38 | 39 | static void WINAPI Initialize( _In_ HWND hWnd ); 40 | static void WINAPI Uninitialize(); 41 | 42 | static HRESULT WINAPI StaticOnCreateDevice(); 43 | static bool WINAPI StaticMsgProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); 44 | 45 | static void WINAPI SetImeEnableFlag( _In_ bool bFlag ); 46 | 47 | virtual void Render( _In_ float fElapsedTime ) override; 48 | virtual bool MsgProc( _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ) override; 49 | virtual bool HandleMouse( _In_ UINT uMsg, _In_ const POINT& pt, _In_ WPARAM wParam, _In_ LPARAM lParam ) override; 50 | virtual void UpdateRects() override; 51 | virtual void OnFocusIn() override; 52 | virtual void OnFocusOut() override; 53 | 54 | void PumpMessage(); 55 | 56 | virtual void RenderCandidateReadingWindow( _In_ bool bReading ); 57 | virtual void RenderComposition(); 58 | virtual void RenderIndicator( _In_ float fElapsedTime ); 59 | 60 | protected: 61 | static void WINAPI EnableImeSystem( _In_ bool bEnable ); 62 | 63 | static WORD WINAPI GetLanguage() 64 | { 65 | return ImeUi_GetLanguage(); 66 | } 67 | static WORD WINAPI GetPrimaryLanguage() 68 | { 69 | return ImeUi_GetPrimaryLanguage(); 70 | } 71 | static void WINAPI SendKey( _In_ BYTE nVirtKey ); 72 | static DWORD WINAPI GetImeId( _In_ UINT uIndex = 0 ) 73 | { 74 | return ImeUi_GetImeId( uIndex ); 75 | }; 76 | static void WINAPI CheckInputLocale(); 77 | static void WINAPI CheckToggleState(); 78 | static void WINAPI SetupImeApi(); 79 | static void WINAPI ResetCompositionString(); 80 | 81 | 82 | static void SetupImeUiCallback(); 83 | 84 | protected: 85 | enum 86 | { 87 | INDICATOR_NON_IME, 88 | INDICATOR_CHS, 89 | INDICATOR_CHT, 90 | INDICATOR_KOREAN, 91 | INDICATOR_JAPANESE 92 | }; 93 | 94 | struct CCandList 95 | { 96 | CUniBuffer HoriCand; // Candidate list string (for horizontal candidate window) 97 | int nFirstSelected; // First character position of the selected string in HoriCand 98 | int nHoriSelectedLen; // Length of the selected string in HoriCand 99 | RECT rcCandidate; // Candidate rectangle computed and filled each time before rendered 100 | 101 | CCandList() noexcept : 102 | nFirstSelected(0), 103 | nHoriSelectedLen(0), 104 | rcCandidate{} 105 | {} 106 | }; 107 | 108 | static POINT s_ptCompString; // Composition string position. Updated every frame. 109 | static int s_nFirstTargetConv; // Index of the first target converted char in comp string. If none, -1. 110 | static CUniBuffer s_CompString; // Buffer to hold the composition string (we fix its length) 111 | static DWORD s_adwCompStringClause[MAX_COMPSTRING_SIZE]; 112 | static CCandList s_CandList; // Data relevant to the candidate list 113 | static WCHAR s_wszReadingString[32];// Used only with horizontal reading window (why?) 114 | static bool s_bImeFlag; // Is ime enabled 115 | 116 | // Color of various IME elements 117 | DWORD m_ReadingColor; // Reading string color 118 | DWORD m_ReadingWinColor; // Reading window color 119 | DWORD m_ReadingSelColor; // Selected character in reading string 120 | DWORD m_ReadingSelBkColor; // Background color for selected char in reading str 121 | DWORD m_CandidateColor; // Candidate string color 122 | DWORD m_CandidateWinColor; // Candidate window color 123 | DWORD m_CandidateSelColor; // Selected candidate string color 124 | DWORD m_CandidateSelBkColor; // Selected candidate background color 125 | DWORD m_CompColor; // Composition string color 126 | DWORD m_CompWinColor; // Composition string window color 127 | DWORD m_CompCaretColor; // Composition string caret color 128 | DWORD m_CompTargetColor; // Composition string target converted color 129 | DWORD m_CompTargetBkColor; // Composition string target converted background 130 | DWORD m_CompTargetNonColor; // Composition string target non-converted color 131 | DWORD m_CompTargetNonBkColor;// Composition string target non-converted background 132 | DWORD m_IndicatorImeColor; // Indicator text color for IME 133 | DWORD m_IndicatorEngColor; // Indicator text color for English 134 | DWORD m_IndicatorBkColor; // Indicator text background color 135 | 136 | // Edit-control-specific data 137 | int m_nIndicatorWidth; // Width of the indicator symbol 138 | RECT m_rcIndicator; // Rectangle for drawing the indicator button 139 | 140 | #if defined(DEBUG) || defined(_DEBUG) 141 | static bool m_bIMEStaticMsgProcCalled; 142 | #endif 143 | }; 144 | -------------------------------------------------------------------------------- /Optional/DXUTres.h: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // File: dxutres.h 3 | // 4 | // Functions to create DXUT media from arrays in memory 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkId=320437 10 | //----------------------------------------------------------------------------- 11 | #pragma once 12 | 13 | HRESULT WINAPI DXUTCreateGUITextureFromInternalArray( _In_ ID3D11Device* pd3dDevice, _Outptr_ ID3D11Texture2D** ppTexture ); 14 | -------------------------------------------------------------------------------- /Optional/DXUTsettingsdlg.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DXUTSettingsDlg.h 3 | // 4 | // Copyright (c) Microsoft Corporation. 5 | // Licensed under the MIT License. 6 | // 7 | // http://go.microsoft.com/fwlink/?LinkId=320437 8 | //-------------------------------------------------------------------------------------- 9 | #pragma once 10 | 11 | //-------------------------------------------------------------------------------------- 12 | // Header Includes 13 | //-------------------------------------------------------------------------------------- 14 | #include "DXUTgui.h" 15 | 16 | //-------------------------------------------------------------------------------------- 17 | // Control IDs 18 | //-------------------------------------------------------------------------------------- 19 | #define DXUTSETTINGSDLG_STATIC -1 20 | #define DXUTSETTINGSDLG_OK 1 21 | #define DXUTSETTINGSDLG_CANCEL 2 22 | #define DXUTSETTINGSDLG_ADAPTER 3 23 | #define DXUTSETTINGSDLG_DEVICE_TYPE 4 24 | #define DXUTSETTINGSDLG_WINDOWED 5 25 | #define DXUTSETTINGSDLG_FULLSCREEN 6 26 | #define DXUTSETTINGSDLG_RESOLUTION_SHOW_ALL 26 27 | #define DXUTSETTINGSDLG_D3D11_ADAPTER_OUTPUT 28 28 | #define DXUTSETTINGSDLG_D3D11_ADAPTER_OUTPUT_LABEL 29 29 | #define DXUTSETTINGSDLG_D3D11_RESOLUTION 30 30 | #define DXUTSETTINGSDLG_D3D11_RESOLUTION_LABEL 31 31 | #define DXUTSETTINGSDLG_D3D11_REFRESH_RATE 32 32 | #define DXUTSETTINGSDLG_D3D11_REFRESH_RATE_LABEL 33 33 | #define DXUTSETTINGSDLG_D3D11_BACK_BUFFER_FORMAT 34 34 | #define DXUTSETTINGSDLG_D3D11_BACK_BUFFER_FORMAT_LABEL 35 35 | #define DXUTSETTINGSDLG_D3D11_MULTISAMPLE_COUNT 36 36 | #define DXUTSETTINGSDLG_D3D11_MULTISAMPLE_COUNT_LABEL 37 37 | #define DXUTSETTINGSDLG_D3D11_MULTISAMPLE_QUALITY 38 38 | #define DXUTSETTINGSDLG_D3D11_MULTISAMPLE_QUALITY_LABEL 39 39 | #define DXUTSETTINGSDLG_D3D11_PRESENT_INTERVAL 40 40 | #define DXUTSETTINGSDLG_D3D11_PRESENT_INTERVAL_LABEL 41 41 | #define DXUTSETTINGSDLG_D3D11_DEBUG_DEVICE 42 42 | #define DXUTSETTINGSDLG_D3D11_FEATURE_LEVEL 43 43 | #define DXUTSETTINGSDLG_D3D11_FEATURE_LEVEL_LABEL 44 44 | 45 | #define DXUTSETTINGSDLG_MODE_CHANGE_ACCEPT 58 46 | #define DXUTSETTINGSDLG_MODE_CHANGE_REVERT 59 47 | #define DXUTSETTINGSDLG_STATIC_MODE_CHANGE_TIMEOUT 60 48 | #define DXUTSETTINGSDLG_WINDOWED_GROUP 0x0100 49 | 50 | #define TOTAL_FEATURE_LEVELS 9 51 | 52 | //-------------------------------------------------------------------------------------- 53 | // Dialog for selection of device settings 54 | // Use DXUTGetD3DSettingsDialog() to access global instance 55 | // To control the contents of the dialog, use the CD3D11Enumeration class. 56 | //-------------------------------------------------------------------------------------- 57 | class CD3DSettingsDlg 58 | { 59 | public: 60 | CD3DSettingsDlg() noexcept; 61 | ~CD3DSettingsDlg(); 62 | 63 | void Init( _In_ CDXUTDialogResourceManager* pManager ); 64 | void Init( _In_ CDXUTDialogResourceManager* pManager, _In_z_ LPCWSTR szControlTextureFileName ); 65 | void Init( _In_ CDXUTDialogResourceManager* pManager, _In_z_ LPCWSTR pszControlTextureResourcename, 66 | _In_ HMODULE hModule ); 67 | 68 | HRESULT Refresh(); 69 | void OnRender( _In_ float fElapsedTime ); 70 | 71 | HRESULT OnD3D11CreateDevice( _In_ ID3D11Device* pd3dDevice ); 72 | HRESULT OnD3D11ResizedSwapChain( _In_ ID3D11Device* pd3dDevice, 73 | _In_ const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc ); 74 | void OnD3D11DestroyDevice(); 75 | 76 | CDXUTDialog* GetDialogControl() { return &m_Dialog; } 77 | bool IsActive() const { return m_bActive; } 78 | void SetActive( _In_ bool bActive ) 79 | { 80 | m_bActive = bActive; 81 | if( bActive ) Refresh(); 82 | } 83 | 84 | LRESULT MsgProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ); 85 | 86 | protected: 87 | friend CD3DSettingsDlg* WINAPI DXUTGetD3DSettingsDialog(); 88 | 89 | void CreateControls(); 90 | void SetSelectedD3D11RefreshRate( _In_ DXGI_RATIONAL RefreshRate ); 91 | HRESULT UpdateD3D11Resolutions(); 92 | HRESULT UpdateD3D11RefreshRates(); 93 | 94 | void OnEvent( _In_ UINT nEvent, _In_ int nControlID, _In_ CDXUTControl* pControl ); 95 | 96 | static void WINAPI StaticOnEvent( _In_ UINT nEvent, _In_ int nControlID, _In_ CDXUTControl* pControl, _In_opt_ void* pUserData ); 97 | static void WINAPI StaticOnModeChangeTimer( _In_ UINT nIDEvent, _In_opt_ void* pUserContext ); 98 | 99 | CD3D11EnumAdapterInfo* GetCurrentD3D11AdapterInfo() const; 100 | CD3D11EnumDeviceInfo* GetCurrentD3D11DeviceInfo() const; 101 | CD3D11EnumOutputInfo* GetCurrentD3D11OutputInfo() const; 102 | CD3D11EnumDeviceSettingsCombo* GetCurrentD3D11DeviceSettingsCombo() const; 103 | 104 | void AddAdapter( _In_z_ const WCHAR* strDescription, _In_ UINT iAdapter ); 105 | UINT GetSelectedAdapter() const; 106 | 107 | void SetWindowed( _In_ bool bWindowed ); 108 | bool IsWindowed() const; 109 | 110 | // D3D11 111 | void AddD3D11DeviceType( _In_ D3D_DRIVER_TYPE devType ); 112 | D3D_DRIVER_TYPE GetSelectedD3D11DeviceType() const; 113 | 114 | void AddD3D11AdapterOutput( _In_z_ const WCHAR* strName, _In_ UINT nOutput ); 115 | UINT GetSelectedD3D11AdapterOutput() const; 116 | 117 | void AddD3D11Resolution( _In_ DWORD dwWidth, _In_ DWORD dwHeight ); 118 | void GetSelectedD3D11Resolution( _Out_ DWORD* pdwWidth, _Out_ DWORD* pdwHeight ) const; 119 | 120 | void AddD3D11FeatureLevel( _In_ D3D_FEATURE_LEVEL fl ); 121 | D3D_FEATURE_LEVEL GetSelectedFeatureLevel() const; 122 | 123 | void AddD3D11RefreshRate( _In_ DXGI_RATIONAL RefreshRate ); 124 | DXGI_RATIONAL GetSelectedD3D11RefreshRate() const; 125 | 126 | void AddD3D11BackBufferFormat( _In_ DXGI_FORMAT format ); 127 | DXGI_FORMAT GetSelectedD3D11BackBufferFormat() const; 128 | 129 | void AddD3D11MultisampleCount( _In_ UINT count ); 130 | UINT GetSelectedD3D11MultisampleCount() const; 131 | 132 | void AddD3D11MultisampleQuality( _In_ UINT Quality ); 133 | UINT GetSelectedD3D11MultisampleQuality() const; 134 | 135 | DWORD GetSelectedD3D11PresentInterval() const; 136 | bool GetSelectedDebugDeviceValue() const; 137 | 138 | HRESULT OnD3D11ResolutionChanged (); 139 | HRESULT OnFeatureLevelChanged(); 140 | HRESULT OnAdapterChanged(); 141 | HRESULT OnDeviceTypeChanged(); 142 | HRESULT OnWindowedFullScreenChanged(); 143 | HRESULT OnAdapterOutputChanged(); 144 | HRESULT OnRefreshRateChanged(); 145 | HRESULT OnBackBufferFormatChanged(); 146 | HRESULT OnMultisampleTypeChanged(); 147 | HRESULT OnMultisampleQualityChanged(); 148 | HRESULT OnPresentIntervalChanged(); 149 | HRESULT OnDebugDeviceChanged(); 150 | 151 | void UpdateModeChangeTimeoutText( _In_ int nSecRemaining ); 152 | 153 | CDXUTDialog* m_pActiveDialog; 154 | CDXUTDialog m_Dialog; 155 | CDXUTDialog m_RevertModeDialog; 156 | int m_nRevertModeTimeout; 157 | UINT m_nIDEvent; 158 | bool m_bActive; 159 | 160 | D3D_FEATURE_LEVEL m_Levels[TOTAL_FEATURE_LEVELS]; 161 | 162 | }; 163 | 164 | 165 | CD3DSettingsDlg* WINAPI DXUTGetD3DSettingsDialog(); 166 | -------------------------------------------------------------------------------- /Optional/ImeUi.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: ImeUi.h 3 | // 4 | // Copyright (c) Microsoft Corporation. 5 | // Licensed under the MIT License. 6 | // 7 | // http://go.microsoft.com/fwlink/?LinkId=320437 8 | //-------------------------------------------------------------------------------------- 9 | #pragma once 10 | 11 | #include 12 | 13 | class CImeUiFont_Base 14 | { 15 | public: 16 | virtual void SetHeight( _In_ UINT uHeight ) 17 | { 18 | UNREFERENCED_PARAMETER(uHeight); 19 | }; // for backward compatibility 20 | virtual void SetColor( _In_ DWORD color ) = 0; 21 | virtual void SetPosition( _In_ int x, _In_ int y ) = 0; 22 | virtual void GetTextExtent( _In_z_ LPCTSTR szText, _Out_ DWORD* puWidth, _Out_ DWORD* puHeight ) = 0; 23 | virtual void DrawText( _In_z_ LPCTSTR pszText ) = 0; 24 | }; 25 | 26 | typedef struct 27 | { 28 | // symbol (Henkan-kyu) 29 | DWORD symbolColor; 30 | DWORD symbolColorOff; 31 | DWORD symbolColorText; 32 | BYTE symbolHeight; 33 | BYTE symbolTranslucence; 34 | BYTE symbolPlacement; 35 | CImeUiFont_Base* symbolFont; 36 | 37 | // candidate list 38 | DWORD candColorBase; 39 | DWORD candColorBorder; 40 | DWORD candColorText; 41 | 42 | // composition string 43 | DWORD compColorInput; 44 | DWORD compColorTargetConv; 45 | DWORD compColorConverted; 46 | DWORD compColorTargetNotConv; 47 | DWORD compColorInputErr; 48 | BYTE compTranslucence; 49 | DWORD compColorText; 50 | 51 | // caret 52 | BYTE caretWidth; 53 | BYTE caretYMargin; 54 | } IMEUI_APPEARANCE; 55 | 56 | typedef struct // D3DTLVERTEX compatible 57 | { 58 | float sx; 59 | float sy; 60 | float sz; 61 | float rhw; 62 | DWORD color; 63 | DWORD specular; 64 | float tu; 65 | float tv; 66 | } IMEUI_VERTEX; 67 | 68 | // IME States 69 | #define IMEUI_STATE_OFF 0 70 | #define IMEUI_STATE_ON 1 71 | #define IMEUI_STATE_ENGLISH 2 72 | 73 | // IME const 74 | #define MAX_CANDLIST 10 75 | 76 | // IME Flags 77 | #define IMEUI_FLAG_SUPPORT_CARET 0x00000001 78 | 79 | bool ImeUi_Initialize( _In_ HWND hwnd, _In_ bool bDisable = false ); 80 | void ImeUi_Uninitialize(); 81 | void ImeUi_SetAppearance( _In_opt_ const IMEUI_APPEARANCE* pia ); 82 | void ImeUi_GetAppearance( _Out_opt_ IMEUI_APPEARANCE* pia ); 83 | bool ImeUi_IgnoreHotKey( _In_ const MSG* pmsg ); 84 | LPARAM ImeUi_ProcessMessage( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _Inout_ LPARAM& lParam, _Out_ bool* trapped ); 85 | void ImeUi_SetScreenDimension( _In_ UINT width, _In_ UINT height ); 86 | void ImeUi_RenderUI( _In_ bool bDrawCompAttr = true, _In_ bool bDrawOtherUi = true ); 87 | void ImeUi_SetCaretPosition( _In_ UINT x, _In_ UINT y ); 88 | void ImeUi_SetCompStringAppearance( _In_ CImeUiFont_Base* pFont, _In_ DWORD color, _In_ const RECT* prc ); 89 | bool ImeUi_GetCaretStatus(); 90 | void ImeUi_SetInsertMode( _In_ bool bInsert ); 91 | void ImeUi_SetState( _In_ DWORD dwState ); 92 | DWORD ImeUi_GetState(); 93 | void ImeUi_EnableIme( _In_ bool bEnable ); 94 | bool ImeUi_IsEnabled(); 95 | void ImeUi_FinalizeString( _In_ bool bSend = false ); 96 | void ImeUi_ToggleLanguageBar( _In_ BOOL bRestore ); 97 | bool ImeUi_IsSendingKeyMessage(); 98 | void ImeUi_SetWindow( _In_ HWND hwnd ); 99 | UINT ImeUi_GetInputCodePage(); 100 | DWORD ImeUi_GetFlags(); 101 | void ImeUi_SetFlags( _In_ DWORD dwFlags, _In_ bool bSet ); 102 | 103 | WORD ImeUi_GetPrimaryLanguage(); 104 | DWORD ImeUi_GetImeId( _In_ UINT uIndex ); 105 | WORD ImeUi_GetLanguage(); 106 | LPCTSTR ImeUi_GetIndicatior(); 107 | bool ImeUi_IsShowReadingWindow(); 108 | bool ImeUi_IsShowCandListWindow(); 109 | bool ImeUi_IsVerticalCand(); 110 | bool ImeUi_IsHorizontalReading(); 111 | TCHAR* ImeUi_GetCandidate( _In_ UINT idx ); 112 | TCHAR* ImeUi_GetCompositionString(); 113 | DWORD ImeUi_GetCandidateSelection(); 114 | DWORD ImeUi_GetCandidateCount(); 115 | BYTE* ImeUi_GetCompStringAttr(); 116 | DWORD ImeUi_GetImeCursorChars(); 117 | 118 | extern void ( CALLBACK*ImeUiCallback_DrawRect )( _In_ int x1, _In_ int y1, _In_ int x2, _In_ int y2, _In_ DWORD color ); 119 | extern void* ( __cdecl*ImeUiCallback_Malloc )( _In_ size_t bytes ); 120 | extern void ( __cdecl*ImeUiCallback_Free )( _In_ void* ptr ); 121 | extern void ( CALLBACK*ImeUiCallback_DrawFans )( _In_ const IMEUI_VERTEX* paVertex, _In_ UINT uNum ); 122 | extern void ( CALLBACK*ImeUiCallback_OnChar )( _In_ WCHAR wc ); 123 | -------------------------------------------------------------------------------- /Optional/SDKmisc.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: SDKMisc.h 3 | // 4 | // Various helper functionality that is shared between SDK samples 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkId=320437 10 | //-------------------------------------------------------------------------------------- 11 | #pragma once 12 | 13 | //----------------------------------------------------------------------------- 14 | // Resource cache for textures, fonts, meshs, and effects. 15 | // Use DXUTGetGlobalResourceCache() to access the global cache 16 | //----------------------------------------------------------------------------- 17 | 18 | struct DXUTCache_Texture 19 | { 20 | WCHAR wszSource[MAX_PATH]; 21 | bool bSRGB; 22 | ID3D11ShaderResourceView* pSRV11; 23 | 24 | DXUTCache_Texture() noexcept : 25 | wszSource{}, 26 | bSRGB(false), 27 | pSRV11(nullptr) 28 | { 29 | } 30 | }; 31 | 32 | 33 | class CDXUTResourceCache 34 | { 35 | public: 36 | ~CDXUTResourceCache(); 37 | 38 | HRESULT CreateTextureFromFile( _In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext *pContext, _In_z_ LPCWSTR pSrcFile, 39 | _Outptr_ ID3D11ShaderResourceView** ppOutputRV, _In_ bool bSRGB=false ); 40 | HRESULT CreateTextureFromFile( _In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext *pContext, _In_z_ LPCSTR pSrcFile, 41 | _Outptr_ ID3D11ShaderResourceView** ppOutputRV, _In_ bool bSRGB=false ); 42 | public: 43 | HRESULT OnDestroyDevice(); 44 | 45 | protected: 46 | friend CDXUTResourceCache& WINAPI DXUTGetGlobalResourceCache(); 47 | friend HRESULT WINAPI DXUTInitialize3DEnvironment(); 48 | friend HRESULT WINAPI DXUTReset3DEnvironment(); 49 | friend void WINAPI DXUTCleanup3DEnvironment( bool bReleaseSettings ); 50 | 51 | CDXUTResourceCache() = default; 52 | 53 | std::vector m_TextureCache; 54 | }; 55 | 56 | CDXUTResourceCache& WINAPI DXUTGetGlobalResourceCache(); 57 | 58 | 59 | //-------------------------------------------------------------------------------------- 60 | // Manages the insertion point when drawing text 61 | //-------------------------------------------------------------------------------------- 62 | class CDXUTDialogResourceManager; 63 | class CDXUTTextHelper 64 | { 65 | public: 66 | CDXUTTextHelper( _In_ ID3D11Device* pd3d11Device, _In_ ID3D11DeviceContext* pd3dDeviceContext, _In_ CDXUTDialogResourceManager* pManager, _In_ int nLineHeight ); 67 | ~CDXUTTextHelper(); 68 | 69 | void Init( _In_ int nLineHeight = 15 ); 70 | 71 | void SetInsertionPos( _In_ int x, _In_ int y ) 72 | { 73 | m_pt.x = x; 74 | m_pt.y = y; 75 | } 76 | void SetForegroundColor( _In_ DirectX::XMFLOAT4 clr ) { m_clr = clr; } 77 | void XM_CALLCONV SetForegroundColor( _In_ DirectX::FXMVECTOR clr ) { XMStoreFloat4( &m_clr, clr ); } 78 | 79 | void Begin(); 80 | HRESULT DrawFormattedTextLine( _In_z_ const WCHAR* strMsg, ... ); 81 | HRESULT DrawTextLine( _In_z_ const WCHAR* strMsg ); 82 | HRESULT DrawFormattedTextLine( _In_ const RECT& rc, _In_z_ const WCHAR* strMsg, ... ); 83 | HRESULT DrawTextLine( _In_ const RECT& rc, _In_z_ const WCHAR* strMsg ); 84 | void End(); 85 | 86 | protected: 87 | DirectX::XMFLOAT4 m_clr; 88 | POINT m_pt; 89 | int m_nLineHeight; 90 | 91 | // D3D11 font 92 | ID3D11Device* m_pd3d11Device; 93 | ID3D11DeviceContext* m_pd3d11DeviceContext; 94 | CDXUTDialogResourceManager* m_pManager; 95 | }; 96 | 97 | 98 | //-------------------------------------------------------------------------------------- 99 | // Shared code for samples to ask user if they want to use a REF device or quit 100 | //-------------------------------------------------------------------------------------- 101 | void WINAPI DXUTDisplaySwitchingToREFWarning(); 102 | 103 | //-------------------------------------------------------------------------------------- 104 | // Tries to finds a media file by searching in common locations 105 | //-------------------------------------------------------------------------------------- 106 | HRESULT WINAPI DXUTFindDXSDKMediaFileCch( _Out_writes_(cchDest) WCHAR* strDestPath, 107 | _In_ int cchDest, 108 | _In_z_ LPCWSTR strFilename ); 109 | HRESULT WINAPI DXUTSetMediaSearchPath( _In_z_ LPCWSTR strPath ); 110 | LPCWSTR WINAPI DXUTGetMediaSearchPath(); 111 | 112 | 113 | //-------------------------------------------------------------------------------------- 114 | // Compiles HLSL shaders 115 | //-------------------------------------------------------------------------------------- 116 | HRESULT WINAPI DXUTCompileFromFile( _In_z_ LPCWSTR pFileName, 117 | _In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) const D3D_SHADER_MACRO* pDefines, 118 | _In_z_ LPCSTR pEntrypoint, _In_z_ LPCSTR pTarget, 119 | _In_ UINT Flags1, _In_ UINT Flags2, 120 | _Outptr_ ID3DBlob** ppCode ); 121 | 122 | //-------------------------------------------------------------------------------------- 123 | // Texture utilities 124 | //-------------------------------------------------------------------------------------- 125 | HRESULT WINAPI DXUTCreateShaderResourceViewFromFile( _In_ ID3D11Device* d3dDevice, _In_z_ const wchar_t* szFileName, _Outptr_ ID3D11ShaderResourceView** textureView ); 126 | HRESULT WINAPI DXUTCreateTextureFromFile( _In_ ID3D11Device* d3dDevice, _In_z_ const wchar_t* szFileName, _Outptr_ ID3D11Resource** texture ); 127 | HRESULT WINAPI DXUTSaveTextureToFile( _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _In_ bool usedds, _In_z_ const wchar_t* szFileName ); 128 | 129 | //-------------------------------------------------------------------------------------- 130 | // Returns a view matrix for rendering to a face of a cubemap. 131 | //-------------------------------------------------------------------------------------- 132 | DirectX::XMMATRIX WINAPI DXUTGetCubeMapViewMatrix( _In_ DWORD dwFace ); 133 | -------------------------------------------------------------------------------- /Optional/directx.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DXUT/2b7f8caca999a79c279bb937195e208e4de6374c/Optional/directx.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![DirectX Logo](https://raw.githubusercontent.com/wiki/Microsoft/DXUT/Dx_logo.GIF) 2 | 3 | # DXUT for Direct3D 11 4 | 5 | http://go.microsoft.com/fwlink/?LinkId=320437 6 | 7 | Copyright (c) Microsoft Corporation. 8 | 9 | # August 14, 2024 10 | 11 | DXUT is a "GLUT"-like framework for Direct3D 11.x Win32 desktop applications; primarily samples, demos, and prototypes. 12 | 13 | This code is designed to build with Visual Studio 2019 (16.11) or Visual Studio 2022. Use of the Windows 10 May 2020 Update SDK ([19041](https://walbourn.github.io/windows-10-may-2020-update-sdk/)) or later is required. 14 | 15 | These components are designed to work without requiring any content from the legacy DirectX SDK. For details, see [Where is the DirectX SDK?](https://aka.ms/dxsdk). 16 | 17 | _This project is 'archived'. It is still available for use for legacy projects or when using older developer education materials, but use of it for new projects is not recommended._ 18 | 19 | ## Disclaimer 20 | 21 | DXUT is being provided as a porting aid for older code that makes use of the legacy DirectX SDK, the deprecated D3DX9/D3DX11 library, and the DXUT11 framework. It is a cleaned up version of the original DXUT11 that will build with the Windows 8.1 / 10 SDK and does not make use of any legacy DirectX SDK or DirectSetup deployed components. 22 | 23 | The DXUT framework is for use in Win32 desktop applications. It not usable for Universal Windows Platform apps, Windows Store apps, 24 | Xbox, or Windows phone. 25 | 26 | This version of DXUT only supports Direct3D 11, and therefore is not compatible with Windows XP or early versions of Windows Vista. 27 | 28 | ## Documentation 29 | 30 | Documentation is available on the [GitHub wiki](https://github.com/Microsoft/DXUT/wiki). 31 | 32 | ## Notices 33 | 34 | All content and source code for this package are subject to the terms of the [MIT License](https://github.com/microsoft/DXUT/blob/main/LICENSE). 35 | 36 | For the latest version of DXUT for Direct3D 11, please visit the project site on [GitHub](https://github.com/microsoft/DXUT). 37 | 38 | > The legacy versions of **DXUT for DX11/DX9** and **DXUT for DX10/DX9** version are on [GitHub](https://github.com/microsoft/DirectX-SDK-Samples). These both require using [Microsoft.DXSDK.D3DX](https://www.nuget.org/packages/Microsoft.DXSDK.D3DX). 39 | 40 | ## Release Notes 41 | 42 | FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DXUT/security/advisories). 43 | 44 | For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DXUT/blob/main/CHANGELOG.md). 45 | 46 | * Starting with the July 2022 release, the ``bool forceSRGB`` parameter for DDSTextureLoader ``Ex`` functions is now a ``DDS_LOADER_FLAGS`` typed enum bitmask flag parameter. This may have a _breaking change_ impact to client code. Replace ``true`` with ``DDS_LOADER_FORCE_SRGB`` and ``false`` with ``DDS_LOADER_DEFAULT``. 47 | 48 | * There are known codegen issues when mixing the library built with Visual C++ and the sample built with recent builds of clang/LLVM for Windows. Building both the library and the sample using the same complier avoids the issue. 49 | 50 | ## Support 51 | 52 | For questions, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/dxut) with the _dxut_ tag. 53 | 54 | ## Code of Conduct 55 | 56 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 57 | 58 | ## Trademarks 59 | 60 | This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. 61 | 62 | ## Credits 63 | 64 | The DXUT library is the work of Shanon Drone, Jason Sandlin, and David Tuft with contributions from David Cook, Kev Gee, Matt Lee, and Chuck Walbourn. 65 | 66 | ## Samples 67 | 68 | * Direct3D Tutorial08 - 10 69 | * BasicHLSL11, EmptyProject11, SimpleSample11 70 | * DXUT+DirectXTK Simple Sample 71 | 72 | These are hosted on [GitHub](https://github.com/microsoft/DirectX-SDK-Samples) 73 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /build/CompilerAndLinker.cmake: -------------------------------------------------------------------------------- 1 | # This modules provides variables with recommended Compiler and Linker switches 2 | # 3 | # Copyright (c) Microsoft Corporation. 4 | # Licensed under the MIT License. 5 | 6 | set(COMPILER_DEFINES "") 7 | set(COMPILER_SWITCHES "") 8 | set(LINKER_SWITCHES "") 9 | 10 | #--- Determines target architecture if not explicitly set 11 | if(DEFINED VCPKG_TARGET_ARCHITECTURE) 12 | set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE}) 13 | elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") 14 | set(DIRECTX_ARCH x86) 15 | elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") 16 | set(DIRECTX_ARCH x64) 17 | elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") 18 | set(DIRECTX_ARCH arm) 19 | elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$") 20 | set(DIRECTX_ARCH arm64) 21 | elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64EC$") 22 | set(DIRECTX_ARCH arm64ec) 23 | elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Ww][Ii][Nn]32$") 24 | set(DIRECTX_ARCH x86) 25 | elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Xx]64$") 26 | set(DIRECTX_ARCH x64) 27 | elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Aa][Rr][Mm]$") 28 | set(DIRECTX_ARCH arm) 29 | elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Aa][Rr][Mm]64$") 30 | set(DIRECTX_ARCH arm64) 31 | elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Aa][Rr][Mm]64EC$") 32 | set(DIRECTX_ARCH arm64ec) 33 | elseif(NOT (DEFINED DIRECTX_ARCH)) 34 | if(CMAKE_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64|aarch64|arm64") 35 | set(DIRECTX_ARCH arm64) 36 | else() 37 | set(DIRECTX_ARCH x64) 38 | endif() 39 | endif() 40 | 41 | #--- Determines host architecture 42 | if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64|aarch64|arm64") 43 | set(DIRECTX_HOST_ARCH arm64) 44 | else() 45 | set(DIRECTX_HOST_ARCH x64) 46 | endif() 47 | 48 | #--- Build with Unicode Win32 APIs per "UTF-8 Everywhere" 49 | if(WIN32) 50 | list(APPEND COMPILER_DEFINES _UNICODE UNICODE) 51 | endif() 52 | 53 | if(MINGW) 54 | list(APPEND LINKER_SWITCHES -municode) 55 | endif() 56 | 57 | #--- General MSVC-like SDL options 58 | if(MSVC) 59 | list(APPEND COMPILER_SWITCHES "$<$>:/guard:cf>") 60 | list(APPEND LINKER_SWITCHES /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO) 61 | 62 | if((${DIRECTX_ARCH} STREQUAL "x86") 63 | OR ((CMAKE_SIZEOF_VOID_P EQUAL 4) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))) 64 | list(APPEND LINKER_SWITCHES /SAFESEH) 65 | endif() 66 | 67 | if((MSVC_VERSION GREATER_EQUAL 1928) 68 | AND (CMAKE_SIZEOF_VOID_P EQUAL 8) 69 | AND (NOT (TARGET OpenEXR::OpenEXR)) 70 | AND ((NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")) OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0))) 71 | list(APPEND COMPILER_SWITCHES "$<$>:/guard:ehcont>") 72 | list(APPEND LINKER_SWITCHES "$<$>:/guard:ehcont>") 73 | endif() 74 | else() 75 | list(APPEND COMPILER_DEFINES $,_DEBUG,NDEBUG>) 76 | endif() 77 | 78 | #--- Target architecture switches 79 | if(NOT (${DIRECTX_ARCH} MATCHES "^arm")) 80 | if((${DIRECTX_ARCH} STREQUAL "x86") OR (CMAKE_SIZEOF_VOID_P EQUAL 4)) 81 | set(ARCH_SSE2 $<$:/arch:SSE2> $<$>:-msse2>) 82 | else() 83 | set(ARCH_SSE2 $<$>:-msse2>) 84 | endif() 85 | 86 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") 87 | list(APPEND ARCH_SSE2 -mfpmath=sse) 88 | endif() 89 | 90 | list(APPEND COMPILER_SWITCHES ${ARCH_SSE2}) 91 | endif() 92 | 93 | #--- Compiler-specific switches 94 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM") 95 | if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)) 96 | list(APPEND COMPILER_SWITCHES /ZH:SHA_256) 97 | endif() 98 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") 99 | list(APPEND COMPILER_SWITCHES /Zc:__cplusplus /Zc:inline /fp:fast /Qdiag-disable:161) 100 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 101 | list(APPEND COMPILER_SWITCHES /sdl /Zc:inline /fp:fast) 102 | 103 | if(CMAKE_INTERPROCEDURAL_OPTIMIZATION) 104 | message(STATUS "Building using Whole Program Optimization") 105 | list(APPEND COMPILER_SWITCHES $<$>:/Gy /Gw>) 106 | endif() 107 | 108 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10) 109 | list(APPEND COMPILER_SWITCHES /permissive-) 110 | endif() 111 | 112 | if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.11) 113 | AND OpenMP_CXX_FOUND) 114 | # OpenMP in MSVC is not compatible with /permissive- unless you disable two-phase lookup 115 | list(APPEND COMPILER_SWITCHES /Zc:twoPhase-) 116 | endif() 117 | 118 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.14) 119 | list(APPEND COMPILER_SWITCHES /Zc:__cplusplus) 120 | endif() 121 | 122 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.15) 123 | list(APPEND COMPILER_SWITCHES /JMC-) 124 | endif() 125 | 126 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24) 127 | list(APPEND COMPILER_SWITCHES /ZH:SHA_256) 128 | endif() 129 | 130 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26) 131 | list(APPEND COMPILER_SWITCHES /Zc:preprocessor /wd5104 /wd5105) 132 | endif() 133 | 134 | if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm"))) 135 | list(APPEND LINKER_SWITCHES /CETCOMPAT) 136 | endif() 137 | 138 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28) 139 | list(APPEND COMPILER_SWITCHES /Zc:lambda) 140 | endif() 141 | 142 | if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29) 143 | AND (NOT VCPKG_TOOLCHAIN)) 144 | list(APPEND COMPILER_SWITCHES /external:W4) 145 | endif() 146 | 147 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35) 148 | if(CMAKE_INTERPROCEDURAL_OPTIMIZATION) 149 | list(APPEND COMPILER_SWITCHES $<$>:/Zc:checkGwOdr>) 150 | endif() 151 | 152 | list(APPEND COMPILER_SWITCHES $<$:/Zc:templateScope>) 153 | endif() 154 | endif() 155 | -------------------------------------------------------------------------------- /build/DXUT-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake) 4 | include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Opt-targets.cmake) 5 | include(CMakeFindDependencyMacro) 6 | 7 | if(MINGW) 8 | find_dependency(directxmath) 9 | else() 10 | find_package(directxmath CONFIG QUIET) 11 | endif() 12 | 13 | check_required_components("@PROJECT_NAME@") 14 | --------------------------------------------------------------------------------