DirectX Documentation

Welcome to the official Microsoft DirectX documentation. This resource provides comprehensive guides, API references, and code samples for developing high-performance graphics, audio, and input experiences on Windows.

On This Page:

Introduction to DirectX

DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. It enables software to directly access specialized hardware such as graphics processing units (GPUs) and audio processing units (APUs), with significant performance increases.

The DirectX family includes:

What's New in Recent Versions

DirectX is constantly evolving to take advantage of new hardware capabilities and performance improvements. Key advancements include:

Direct3D 12 is the recommended modern API for graphics development on Windows.

Getting Started with DirectX Development

To begin your DirectX development journey, you'll typically need:

Explore the Getting Started section for detailed setup instructions and your first DirectX application.

Key DirectX Components

Direct3D Pipeline

Understanding the Direct3D pipeline is crucial for graphics programming. It involves stages like input assembler, vertex shader, hull shader, domain shader, geometry shader, rasterizer, pixel shader, and output merger.

A simplified representation:

Input Assembler -> Vertex Shader -> Rasterizer -> Pixel Shader -> Output Merger

Shader Programming (HLSL)

Shaders are small programs that run on the GPU to process vertices and pixels. High-Level Shading Language (HLSL) is used to write these shaders.

Example of a simple HLSL vertex shader:

struct VertexShaderInput {
    float4 pos : POSITION;
};

struct VertexShaderOutput {
    float4 pos : SV_POSITION;
};

VertexShaderOutput main(VertexShaderInput input) {
    VertexShaderOutput output;
    output.pos = input.pos; // Pass position through
    return output;
}

Dive deeper into each component by navigating the sidebar to the left. You'll find detailed guides on graphics programming with Direct3D, audio with XAudio2, input handling, and more.