Overview
Game engines have evolved into intricate systems encompassing physics, audio, graphics, input, AI, and networking components. Graphics engines transcend gaming applications, finding utility in animations, AI/VR frameworks, and scientific visualizations.
This article provides foundational knowledge about DirectX 12 rendering features for beginners and developers transitioning from other graphics APIs. The author references a demonstration and source code available on GitHub.
Graphics APIs
OpenGL, Vulkan, Metal, Direct3D, and native console interfaces represent graphics APIs — dynamic libraries enabling applications to render content to screens.
Popular APIs for Nvidia Graphics Cards (Windows)
DirectX:
- DirectX 9:
nvumdshim.dll - DirectX 10/11:
nvd3dum.dll(32-bit) andnvd3dumx.dll(64-bit) - DirectX 12:
nvldumdx.dll
Vulkan:
- 32-bit:
nvoglv32.dll - 64-bit:
nvoglv64.dll
OpenGL:
- 32-bit:
nvoglv32.dll - 64-bit:
nvoglv64.dll
Vulkan and OpenGL share similar driver naming conventions since Nvidia often uses identical drivers for both.

Complexity Trade-offs
Direct3D 12 and Vulkan demand manual synchronization control, precompiled root signatures, pipeline states, and fine-grained resource management. OpenGL and DirectX 11 abstract complexity but restrict single-threaded GPU execution.
Operating System Interface
Two primary approaches exist for cross-platform engine development:
- Library abstraction (e.g., GLFW): Enables code portability across platforms
- Native API calls: Provides greater control but sacrifices portability
The article adopts the second approach using Windows native APIs with DirectX 12.

Handling Window
All graphics APIs share fundamental window-creation processes. After specifying parameters, applications receive a handle (such as hwnd in DirectX) identifying the window instance. This handle facilitates event reception — keyboard inputs, mouse movements, window controls — initially processed by the operating system and transferred to waiting applications.
The source code demonstrates window creation with event callback specification.
Input
Though typically a separate component with dedicated managers and classes, input handling remains essential in graphics engines supporting user interaction.
Graphics Card Interface
Graphics APIs interact with hardware for resource allocation, debugging, pipeline execution, and asynchronous computation across multiple graphics cards and monitors.
DirectX 12 Key Components
DXGI Factory: An abstraction interface enumerating adapters (graphics cards and monitors), managing fullscreen transitions, and binding windows to swap chains.

Adapter: Represents physical graphics cards, providing memory information, device IDs, feature support, and performance characteristics. Used primarily to create a Device.
Device: A logical interface enabling direct graphics card operations — resource allocation, descriptor management, pipeline state creation, and root signature specification.
Reference the ODevice class in the source code for practical implementation.
Command Queues
Command execution on graphics hardware occurs through separate objects: Command Queue and Command List, responsible for writing and executing GPU instructions sequentially.
Command queues execute command lists after closing them and passing them to the queue.
GPUs support parallel execution across different queues, allowing simultaneous graphics and compute pipeline operations.

Synchronization with Fences
Direct device command execution presents synchronization challenges between GPU and CPU. Command queues in GPU memory permit specification of synchronization points called Fences, enabling CPU resumption after GPU instruction completion.
Fences facilitate both CPU-GPU synchronization and inter-queue GPU synchronization. For example, rendering completion requires CPU waiting before processing subsequent frames.
Reference the synchronization implementation in the repository.
Conclusion
DirectX 12 establishes standardized graphics card interaction while maintaining universal API principles. Developers familiar with CUDA may recognize parallels with compute shader operations.
Mastering window setup, input handling, graphics card interfaces, and command queues enables developers to efficiently leverage GPU capabilities for realistic rendering.