A small WPF + C# test application that acts as:
- a hardware / display diagnostics launcher, and
- a Direct3D 11 demo host
The app was built as a modern replacement for the old "DirectX SDK sample launcher" style workflow:
- inspect the PC
- show graphics/display information
- then launch a separate 3D demo window
---
The main window shows:
- machine and OS information
- .NET runtime and process architecture
- logical processor count
- physical memory summary
- detected display adapters
- detected monitors and current resolutions
- basic Direct3D probe results
The demo window:
-
opens in a separate WPF window
-
hosts native Direct3D rendering through
HwndHost -
creates a Direct3D 11 device and swap chain
-
renders a rotating textured cube
-
uses
Assets/world.pngas the cube texture -
supports:
F11to toggle borderless fullscreenEscto close the demo window
---
- C# / .NET
- WPF for the launcher UI and demo window shell
- WinForms support for monitor enumeration via
Screen.AllScreens - Vortice.Direct3D11 for Direct3D 11 bindings
- Vortice.DXGI for swap chain / DXGI integration
- HLSL shaders compiled with
fxc.exefrom the Windows SDK
---
| File / Folder | Purpose |
|---|---|
DXtestWPF/DXtestWPF.csproj |
Project configuration, NuGet references, shader compilation build step, asset copy rules |
DXtestWPF/MainWindow.xaml |
Launcher UI |
DXtestWPF/MainWindow.xaml.cs |
Loads diagnostics data and opens the Direct3D demo |
DXtestWPF/HardwareInfoService.cs |
Collects system, display, and basic Direct3D information |
DXtestWPF/Dx11DemoWindow.xaml |
Separate Direct3D demo window |
DXtestWPF/Dx11DemoWindow.xaml.cs |
Demo window behavior and keyboard handling |
DXtestWPF/Dx11RenderHost.cs |
WPF HwndHost that creates a native child window for Direct3D rendering |
DXtestWPF/D3D11Renderer.cs |
Direct3D 11 renderer, cube geometry, texture loading, render loop, resize handling |
DXtestWPF/Assets/world.png |
Texture used on all faces of the cube |
DXtestWPF/Shaders/TexturedCubeShader.hlsl |
HLSL shader source for the textured cube |
Note: TexturedCubeShader.hlsl is compiled by
fxc.exeduring build.
---
The renderer currently creates:
- a Direct3D 11 device
- an immediate context
- a DXGI swap chain
- a render target view
- a depth/stencil buffer and depth/stencil view
It first tries:
- hardware device creation
and falls back to:
- WARP if hardware creation fails
The renderer sets up:
- vertex shader
- pixel shader
- input layout
- vertex buffer
- index buffer
- constant buffer
- sampler state
- rasterizer state
- texture shader resource view
The demo currently renders:
- a textured cube
- perspective projection
- continuous rotation over time
- anisotropic texture sampling
- no lighting yet
---
The launcher currently reports:
- whether Direct3D device creation used hardware or WARP fallback
- the detected feature level
- an estimated shader model based on feature level
The shader model shown in the launcher is an estimate derived from feature level. It is not a full shader capability matrix.
---
To build the shader bytecode for the cube demo, the project needs:
- a Windows SDK installation that includes
fxc.exe
Typical location:
C:\\Program Files (x86)\\Windows Kits\\10\\bin\\<sdk-version>\\x64\\fxc.exe
Set FxcPath explicitly in DXtestWPF/DXtestWPF.csproj:
<PropertyGroup>
<FxcPath>C:\\Program Files (x86)\\Windows Kits\\10\\bin\\<sdk-version>\\x64\\fxc.exe</FxcPath>
</PropertyGroup>The project compiles these shader objects during build:
Shaders/TexturedCubeVS.csoShaders/TexturedCubePS.cso
These are written to the build output folder and loaded by D3D11Renderer at runtime.
---
-
Open the solution in Visual Studio.
-
Ensure the Windows SDK / HLSL compiler tools are installed.
-
Verify
FxcPathif needed. -
Build the project.
-
Run the app.
-
In the main window:
- review the hardware / display information
- click Start DirectX 11 Demo
-
In the demo window:
- press
F11for fullscreen - press
Escto close
- press
---
This project intentionally stays fairly close to the Direct3D 11 pipeline. That means even a simple textured cube requires a fair amount of setup code:
- device creation
- swap chain creation
- render target / depth buffer setup
- geometry buffers
- HLSL shaders
- texture loading
- sampler configuration
- matrix updates per frame
That is expected for low-level Direct3D work. The Vortice libraries make the APIs accessible from C#, but they do not remove the underlying Direct3D concepts.
---
At the moment, the project is intentionally simple and does not yet include:
- lighting
- camera controls
- wireframe toggle
- advanced shader capability reporting
- full monitor mode enumeration
- explicit adapter selection UI
- audio / input diagnostics
---
Some logical next enhancements would be:
- add basic directional lighting
- add mouse-controlled camera movement
- add wireframe / culling toggles
- report more Direct3D capability details
- allow monitor / display mode selection
- show adapter memory and driver information
---
This repository now contains a working WPF diagnostics launcher + Direct3D 11 textured cube demo built with modern C# tooling.
It demonstrates:
- WPF and Direct3D interop
- basic hardware / display diagnostics
- Direct3D 11 initialization from C#
- textured 3D rendering with HLSL shaders
- fullscreen/windowed demo control