MSDN Documentation

Windows Graphics API Samples

Graphics Sample Gallery

DirectX 12 Basic Rendering

A fundamental sample demonstrating the core concepts of DirectX 12, including pipeline creation, command buffers, and resource binding for basic 3D rendering.

DirectX 12 Rendering Beginner
View Sample

Direct2D Transforms

Explore the power of Direct2D transformations like translation, rotation, and scaling. This sample shows how to manipulate 2D shapes and text efficiently.

Direct2D 2D Graphics Transforms
View Sample

DirectWrite Text Layout

Learn how to use DirectWrite for advanced text rendering, including complex script shaping, line breaking, and bidirectional text support.

DirectWrite Text Rendering Localization
View Sample

Shader Model 6.7 Compute Shader

Implement parallel processing on the GPU using compute shaders. This sample demonstrates a simple image processing effect accelerated by a compute pipeline.

DirectX 12 Compute Shader HLSL Performance
View Sample

XAML Graphics Integration

See how to integrate DirectX graphics rendering seamlessly within a XAML application using `SwapChainPanel` and modern Windows UI development practices.

DirectX XAML UWP Integration
View Sample

WPF Hardware Acceleration

Understand how Windows Presentation Foundation (WPF) utilizes hardware acceleration for rendering. This sample showcases custom drawing with hardware acceleration.

WPF Hardware Acceleration 2D Graphics
View Sample

Featured Sample: DirectX 12 Basic Rendering

This sample serves as an excellent starting point for developers new to DirectX 12. It meticulously walks through the essential steps required to initialize the API, set up the device and swap chain, compile shaders, create input layouts, and render a simple triangle to the screen.

Key features:

Code Snippet Example (HLSL Pixel Shader):

// Basic HLSL Pixel Shader for DirectX 12
float4 main(float4 pos : SV_POSITION) : SV_TARGET
{
    return float4(1.0f, 0.5f, 0.0f, 1.0f); // Output an orange color
}
Explore DirectX 12 Basic Rendering