You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,20 +14,20 @@ These instructions define how GitHub Copilot should assist with this project. Th
14
14
15
15
- See the tutorial at [Getting Started](https://github.com/microsoft/DirectXTK12/wiki/Getting-Started).
16
16
- The recommended way to integrate *DirectX Tool Kit for DirectX 12* into your project is by using the *vcpkg* Package Manager. See [d3d12game_vcpkg](https://github.com/walbourn/directx-vs-templates/tree/main/d3d12game_vcpkg) for a template which uses VCPKG.
17
-
- You can make use of the nuget.org packages **directxtk12_desktop_2019**, **directxtk12_desktop_win10**, or **directxtk12_uwp**.
17
+
- You can make use of the nuget.org packages **directxtk12_desktop_win10** or **directxtk12_uwp**.
18
18
- You can also use the library source code directly in your project or as a git submodule.
19
19
20
20
> If you are new to DirectX, you may want to start with [DirectX Tool Kit for DirectX 11](https://github.com/microsoft/DirectXTK/wiki/Getting-Started) to learn many important concepts for Direct3D programming, HLSL shaders, and the code patterns used in this project with a more 'noobie friendly' API.
21
21
22
22
## General Guidelines
23
23
24
-
-**Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXTK12/wiki/Implementation). The library implementation is written to be compatible with C++14 features.
24
+
-**Code Style**: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in `.editorconfig` for indentation, line endings, and other formatting. Additional information can be found on the wiki at [Implementation](https://github.com/microsoft/DirectXTK12/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`).F
25
25
> Notable `.editorconfig` rules: C/C++ files use 4-space indentation, `crlf` line endings, and `latin1` charset — avoid non-ASCII characters in source files. HLSL files have separate indent/spacing rules defined in `.editorconfig`.
26
26
-**Documentation**: The project provides documentation in the form of wiki pages available at [Documentation](https://github.com/microsoft/DirectXTK12/wiki/). The audio, input, and math implementations are identical to the DirectX Tool Kit for DirectX 11.
27
27
-**Error Handling**: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed. For some functions that return HRESULT error codes, they are marked `noexcept`, use `std::nothrow` for memory allocation, and should not throw exceptions.
28
28
-**Testing**: Unit tests for this project are implemented in this repository [Test Suite](https://github.com/walbourn/directxtk12test/) and can be run using CTest per the instructions at [Test Documentation](https://github.com/walbourn/directxtk12test/wiki).
29
29
-**Security**: This project uses secure coding practices from the Microsoft Secure Coding Guidelines, and is subject to the `SECURITY.md` file in the root of the repository. Functions that read input from image file, geometry files, and audio files are subject to OneFuzz fuzz testing to ensure they are secure against malformed files.
30
-
-**Dependencies**: The project uses CMake and VCPKG for managing dependencies, making optional use of DirectXMath, DirectX-Headers, DirectX 12 Agility SDK, GameInput, and XAudio2Redist. The project can be built without these dependencies, relying on the Windows SDK for core functionality.
30
+
-**Dependencies**: The project uses CMake and VCPKG for managing dependencies, making optional use of DirectXMath, DirectX-Headers, DirectX 12 Agility SDK, GameInput, and XAudio2Redist. The project can be built without these dependencies, relying on the Windows SDK for core functionality. Additional CMake build options include `BUILD_WGI` and `BUILD_XINPUT` for alternative input backends, `BUILD_MIXED_DX11` for DX11 toolkit interop, `ENABLE_SPECTRE_MITIGATION`, `ENABLE_CODE_ANALYSIS`, and `BUILD_FUZZING`.
31
31
-**Continuous Integration**: This project implements GitHub Actions for continuous integration, ensuring that all code changes are tested and validated before merging. This includes building the project for a number of configurations and toolsets, running a subset of unit tests, and static code analysis including GitHub super-linter, CodeQL, and MSVC Code Analysis.
32
32
-**Code of Conduct**: The project adheres to the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). All contributors are expected to follow this code of conduct in all interactions related to the project.
33
33
@@ -64,6 +64,7 @@ wiki/ # Local clone of the GitHub wiki documentation repository.
64
64
- Use 16-byte alignment (`_aligned_malloc` / `_aligned_free`) to support SIMD operations in the implementation, but do not expose this requirement in public APIs.
65
65
- All implementation `.cpp` files include `pch.h` as their first include (precompiled header). MinGW builds skip precompiled headers.
66
66
-`Model` and related classes require RTTI (`/GR` on MSVC, `__GXX_RTTI` on GCC/Clang). The CMake build enables `/GR` automatically; do not disable RTTI when using `Model`.
67
+
- Many public headers use `inline namespace DX12` inside `namespace DirectX` to disambiguate from *DirectX Tool Kit for DirectX 11* types when both libraries are used together.
67
68
68
69
#### SAL Annotations
69
70
@@ -86,7 +87,7 @@ Common annotations:
86
87
Example:
87
88
88
89
```cpp
89
-
// Header (BuffersHelpers.h)
90
+
// Header (BufferHelpers.h)
90
91
DIRECTX_TOOLKIT_API
91
92
HRESULT __cdecl CreateStaticBuffer(
92
93
_In_ ID3D12Device* device,
@@ -241,6 +242,7 @@ When creating documentation:
241
242
242
243
- The code supports building for Windows.
243
244
- Portability and conformance of the code is validated by building with Visual C++, clang/LLVM for Windows, and MinGW.
245
+
- The project ships MSBuild projects for Visual Studio 2022 (`.sln` / `.vcxproj`) and Visual Studio 2026 (`.slnx` / `.vcxproj`). VS 2019 projects have been retired.
244
246
245
247
### Platform and Compiler `#ifdef` Guards
246
248
@@ -260,6 +262,11 @@ Use these established guards — do not invent new ones:
260
262
|`_M_ARM64EC`| ARM64EC ABI (ARM64 code with x64 interop) for MSVC |
0 commit comments