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
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,12 @@ 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/DirectXTK/wiki/Getting-Started).
16
16
- The recommended way to integrate *DirectX Tool Kit for DirectX 11* into your project is by using the *vcpkg* Package Manager. See [d3d11game_vcpkg](https://github.com/walbourn/directx-vs-templates/tree/main/d3d11game_vcpkg) for a template which uses VCPKG.
17
-
- You can make use of the nuget.org packages **directxtk_desktop_2019**, **directxtk_desktop_win10**, or **directxtk_uwp**.
17
+
- You can make use of the nuget.org packages **directxtk_desktop_win10** or **directxtk_uwp**.
18
18
- You can also use the library source code directly in your project or as a git submodule.
19
19
20
20
## General Guidelines
21
21
22
-
-**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/DirectXTK/wiki/Implementation). The library implementation is written to be compatible with C++14 features, but C++17 is required to build the project for the command-line tools which utilize C++17filesystem for long file path support.
22
+
-**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/DirectXTK/wiki/Implementation). The library's public API requires C++11, and the project builds with C++17 (`CMAKE_CXX_STANDARD 17`). The command-line tools also use C++17, including `<filesystem>` for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, or MinGW 12.2.
23
23
> 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`.
24
24
-**Documentation**: The project provides documentation in the form of wiki pages available at [Documentation](https://github.com/microsoft/DirectXTK/wiki/).
25
25
-**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.
@@ -35,13 +35,13 @@ These instructions define how GitHub Copilot should assist with this project. Th
35
35
.azuredevops/ # Azure DevOps pipeline configuration and policy files.
36
36
.github/ # GitHub Actions workflow files and linter configuration files.
37
37
.nuget/ # NuGet package configuration files.
38
-
build/ # Miscellaneous build files and scripts.
38
+
build/ # Miscellaneous build files and scripts, including OneFuzzConfig.json.
39
39
Audio/ # DirectX Tool Kit for Audio implementation files.
40
40
Inc/ # Public header files.
41
41
Src/ # Implementation header and source files.
42
42
Shaders/ # HLSL shader files.
43
-
MakeSpriteFont/ # CLI tool for capturing sprite fonts.
44
-
XWBTool/ # CLI tool for creating XACT-style wave banks.
43
+
MakeSpriteFont/ # C# CLI tool for capturing sprite fonts.
44
+
XWBTool/ # C++ CLI tool for creating XACT-style wave banks.
45
45
Tests/ # Tests are designed to be cloned from a separate repository at this location.
46
46
wiki/ # Local clone of the GitHub wiki documentation repository.
47
47
```
@@ -63,6 +63,10 @@ wiki/ # Local clone of the GitHub wiki documentation repository.
63
63
- All implementation `.cpp` files include `pch.h` as their first include (precompiled header). MinGW builds skip precompiled headers.
64
64
-`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`.
65
65
66
+
#### Inline Namespace
67
+
68
+
All public headers that contain types shared with the DirectX 12 version of the *DirectX Tool Kit* use `inline namespace DX11` inside `namespace DirectX`. This provides link-unique names (e.g. `DirectX::DX11::SpriteBatch`) without requiring explicit `DX11` qualification in client code. When adding new public types that also exist in DirectXTK12, place them inside this inline namespace.
69
+
66
70
#### SAL Annotations
67
71
68
72
All public API functions must use SAL annotations on every parameter. Use `_Use_decl_annotations_` at the top of each implementation that has SAL in the header declaration — never repeat the annotations in the `.cpp` or `.inl` file.
@@ -231,8 +235,10 @@ When creating documentation:
231
235
232
236
## Cross-platform Support Notes
233
237
234
-
- The code supports building for Windows.
238
+
- The code targets Win32 desktop applications for Windows 8.1 or later, Xbox One, Xbox Series X|S, and Universal Windows Platform (UWP) apps for Windows 10 and Windows 11.
235
239
- Portability and conformance of the code is validated by building with Visual C++, clang/LLVM for Windows, and MinGW.
240
+
- For Xbox development, the project provides MSBuild solutions for GDK (`DirectXTK_GDK_2022.sln`) and GDK with Xbox Extensions (`DirectXTK_GDKW_2022.sln`). The CMake build supports Xbox via the `XBOX_CONSOLE_TARGET` variable (`scarlett` or `xboxone`).
241
+
- The project ships MSBuild projects for Visual Studio 2022 (`.sln` / `.vcxproj`) and Visual Studio 2026 (`.slnx` / `.vcxproj`). VS 2019 projects have been retired.
236
242
237
243
### Platform and Compiler `#ifdef` Guards
238
244
@@ -241,14 +247,20 @@ Use these established guards — do not invent new ones:
241
247
| Guard | Purpose |
242
248
| --- | --- |
243
249
|`_WIN32`| Windows platform (desktop, UWP, Xbox) |
244
-
|`_GAMING_XBOX`| Xbox One |
250
+
|`_GAMING_XBOX`| Xbox platform (GDK — covers both Xbox One and Xbox Series X\|S) |
251
+
|`_GAMING_XBOX_SCARLETT`| Xbox Series X\|S (GDK with Xbox Extensions) |
252
+
|`_GAMING_XBOX_XBOXONE`| Xbox One (GDK with Xbox Extensions) |
245
253
|`_XBOX_ONE && _TITLE`| Xbox One XDK (legacy) |
246
254
|`_MSC_VER`| MSVC-specific (and MSVC-like clang-cl) pragmas and warning suppression |
0 commit comments