Intro to DirectX
Jens-Stefan Mikson
What is DirectX?
Collection of APIs for handling tasks related to multimedia, especially game programming and video on Microsoft platforms.
DirectX is an umbrella term for the above.
Xbox - Console based on DirectX technology.
Non-deprecated APIs in DirectX
Version history
DirectX 1.0 - Released in 1995 as Windows Game SDK.
…
DirectX 9 - Released in 2002. Introduced Shader Model 2.0.
DirectX 10 - Released in 2006.
DirectX 11 - Released in 2009. Shader Model 5.0.
DirectX 12 - Released in 2015.
Direct3D
Direct3D 11 vs Direct3D 12
Let’s look at some theory for working with DirectX 11.
Graphics Hardware
DirectX Graphics Infrastructure (DXGI)
Framework 1
Link to source: https://tinyurl.com/v v k j 9 8 8 s
Framework 2
Image Buffer
Slow monitors
Monitors do not refresh as needed for real-time rendering.
Tearing
Tearing - Why?
Swapping
Use 2 buffers: front buffer and back buffer.
Render images to the back buffer. When done, DXGI updates the front buffer, discarding the old image.
This happens via changing pointers to the buffers, i.e, very fast.
Is there a problem here?
Swapping - Solution
The GPU asks the monitor when it’s about to refresh. The GPU can time the swapping of the buffer to synchronize with the refresh rate of the monitor.
The Swap Chain
Framework 3