DirectX is a set of APIs from Microsoft for applications and games on Windows and Xbox systems.
DOS allowed direct access to video cards, sound devices, input devices and other components of the system.
High performance DOS games used blitting and page flipping with direct access to video memory.
The Graphics Device Interface (GDI) is the original graphics interface for 16-bit Windows.
Windows 3.x had several problems to enable high performance applications.
- Bitmap operations could be done using the Windows Graphics Device Interface (GDI) but only in main memory.
- No support for creating Device Contexts (DC) based on Device Independent Bitmaps (DIB).
- No direct access to video memory.
- No support for page flipping.
GDI+ was introduced in Windows XP as a successor to GDI.
GDI+ is a C++ API with a few additional features but the same limitations regarding direct access to video memory.
The .NET Framework also provides a managed version of GDI+.
To fix the issues with GDI, Microsoft released the WinG library on September 1994.
WinG used the Device Control Interface (DCI) driver that exists at the same software layer as the GDI to exploit the video acceleration features of graphic cards.
WinG introduced a new type of DC called the
WinGDC and a new type of DIB called
WinG allowed reading and writing directly to memory and fast transfers to the display device.
WinGRecommendDIBFormatdetermines the most appropriate DIB format on the system.
WinGCreateBitmapallocates a block of memory using the specified
BITMAPINFOstructure describing the size and format of the bitmap.
- The bitmap palette is still managed using the GDI APIs.
- Applications overwrite the system palette with
SetSystemPaletteUsewith the palette mode:
SYSPAL_STATICmode gives access to 236 colors out of 256.
SYSPAL_NOSTATICmode gives access to 254 colors out of 256 by also overwriting the static colors.
- The frame buffer is transfered to the display device using two methods:
WinGBitBlttransfers the WinGBitmap to the display for full-screen resolution.
WinGStretchBltstretches the WinGBitmap to fit a window resolution.
Windows NT 3.5 and Windows 95 introduced
CreateDIBSection to support creating DCs based on DIBs.
However, Windows 95 had a protected memory model that restriced access to the hardware.
The first version of DirectX was called Windows 95 Game SDK or Game SDK.
It was announced in March 1995 at CGDC.
It was released on September 1995.
It supported Windows 95.
The libray provided four set of APIs:
- DirectDraw (DD)
- DirectSound (DS)
- DirectInput (DI)
- DirectPlay (DP)
DirectX is composed of interfaces based on the Component Object Model (COM).
Each interface supports a set of functions.
DirectDraw is a Hardware Abstraction Layer (HAL).
DirectDraw can emulate hardware functionality in software using its Hardware Emulation Layer (HEL).
DirectDraw provides a memory manager for video memory. Memory can be allocated, moved, transformed, and freed.
An image in video memory is referred to as a surface.
- Allows direct manipulation of video display memory
- Access to hardware blitters
- Transparent blitting with color keys
- Hardware overlays with z ordering (sprites and multiple layers of animation)
- Support for double-buffering and page flipping
- Support for clipping, stretching, and non-RGB color format
- Support for depth buffers
- Support for palletized primary surfaces: 8-bit (256 entry) and 4-bit (16 entry) palettes.
DirectSound provides hardware acceleration (HAL).
- Low-latency mixing of audio stream
- Access to hardware memory
DirectSound can emulate hardware functionality in software using the Windows waveform audio functions (HEL).
DirectSound supports uncompressed PCM formats.
DirectInput only provides support for joysticks.
The Windows API provided limited support for joysticks using the
- The coordinates of up to three axis.
- The state of up to four buttons (pressed or released).
DirectInput added an extended function:
- The coordinates of up to six joystick axes.
- The state of up to 32 buttons (pressed or released).
- The position of the point-of-view control.
DirectPlay is a high-level software interface between applications and communication services.
DirectPlay is built on the User Datagram Protocol (UDP).
It was announced in April 1996 at CGDC.
It was released on June 1996.
A minor revision was released: DirectX 2.0a.
It supported Windows 95 OSR2 and Windows NT 4.0.
- Introduced Direct3D (D3D), based on the technology of Rendermorphics.
- Introduced the Direct3D File Format (.X files).
- High-level Retained-mode interface.
- Low-level Immediate-mode interface.
- Full 3D rendering pipeline (transformations, lighting, and rasterization).
- Floating-point precision of 53.
- Advanced graphics capabilities of 3D hardware accelerators:
- Perspective-correct texture mapping
- Alpha blending
- Atmospheric effects
- Added support for 24-bit and 32-bit surfaces.
- Display mode descriptions include the refresh rate.
- Support for locking a page of system memory (to prevent it from being paged out by the system).
- Windowed applications don't need to provide a window handle.
- Palettes can be attached to any surfaces.
- Added support for 1-bit (2 entry) and 2-bit (4 entry) palettes.
- Added support for texture, mipmap and z-buffer surfaces.
Keyboard and mouse are provided as wrappers to the Windows API.
Support for up to 16 joysticks, each with up to six axes of movement and up to 32 buttons.
It was released on September 1996.
Two minor revisions were released: DirectX 3.0a and 3.0b.
- Introduced DirectSound3D (DS3D) as an extension to DirectSound.
- Support for the MMX technology.
- Added support for keyboards and mouse.
- Improved support for joysticks.
It was planned for December 1996 with special features for Cirrus Logic chips.
The released was skipped because of the delay of the chips.
It was released on July 1997.
It supported Windows 98.
DirectX 5.2 was released for:
- Windows 95 on May 1998
- Windows 98 on June 1998
- Improved support for MMX.
- Support for multiple monitors on Windows 98.
- Improved support for joysticks.
- Improved mouse support by increasing the number of buttons from 4 to 8.
- Added a Game Controllers control panel.
- Added support for force feedback controllers.
It was released on August 1998.
It was released as Windows CE on the Sega Dreamcast.
- Support for AMD’s 3DNow! technology
- Added new Direct3D features:
- Bump mapping
- Texture compression
- Stencil buffers
The introduction of DirectMusic was delayed.
It was released on February 1999.
A minor revision, DirectX 6.1a was released on May 1999 for Windows 98 SE.
- Added DirectMusic (DM)
It was released in 1999.
A version for Windows 2000 was released on February 2000.
A minor revision, DirectX 7.0a was released on March 2000.
It was released on September 2000.
It required at least Windows ME.
- Introduced DirectPlay Voice.
It was released in 2000.
A minor revision, DirectX 8.0a was released on February 2001.
- Introduced DirectX Graphics that included Direct3D and DirectDraw.
- DirectSound and DirectSound3D were merged into DirectX Audio.
- Added action mapping to DirectInput.
- Major overhaul of DirectPlay to be a lightweight networking library.
- Introduced Shader Model 1 with support for pixel shader and vertex shader.
It was released on November 2001.
It required at least Windows 98 and Windows 2000.
Two minor revisions, DirectX 8.1a and 8.1b were released in 2002.
The Xbox system was based on DirectX 8.1.
It was released in late 2002.
It included DirectPlay 8.2.
It was released on December 2002.
The original release supported Windows 98 and Windows XP.
The February 2005 release is the released with support for 64-bit systems.
The last update was DirectX 9.0c.
The April 2006 release added support for Windows Vista and required at least Windows XP or Windows 2000.
The Xbox 360 system was based on the 2008 release.
The August 2009 release added support for Windows 7.
- Introduced Shader Model 2.
- DirectX 9.0c introduced Shader Model 3.
- XInput was introduced with the Xbox 360.
- Support for XInput was then added to DirectX.
- XInput 1.3 supports Windows Vista, Windows 7, and Windows 8.
- XInput 1.4 supports Windows 8.
Managed DirectX (MDX) 1.1 was introduced in 2002.
- Can be used under .NET Framework 1.1 and 2.0.
- Exposed functionality from DirectX 9.
MDX 2.0 was in beta from 2005 but was cancelled in 2006.
XNA was announced on March 2004 at GDC.
A first Community Technology Preview of XNA Build was released on March 2006.
The first beta version of XNA Game Studio Express was released on August 2006, followed by a second version on November 2006.
XNA Game Studio Express was released on December 2006.
XNA Game Studio Express 1.0 Refresh was released on April 2007.
XNA Game Studio 2.0 was released in December 2007.
- Added a networking API for some Xbox Live functionality on Windows and Xbox 360.
A beta of XNA Game Studio 3.0 was released on September 2008.
XNA Game Studio 3.0 was released on October 2008.
- Added support for C# 3.0 and LINQ.
- Added support for Zune.
- Added support for trial mode on Xbox 360.
- Added support for multiplayer features on Xbox Live.
XNA Game Studio 3.1 was released on June 2009.
- Added support for video playback.
- Added a revised audio API.
- Added support for Xbox LIVE Party.
- Added support for the Xbox 360 Avatars.
XNA Game Studio 4.0 "Community Technical Preview" was released on March 2010.
XNA Game Studio 4.0 was released on September 2010.
- Added support for Windows Phone.
- Included the Windows Phone Development Tools.
XNA Game Studio 4.0 Refresh was released on October 2011.
- Added support for Windows Phone 7.5 (Mango).
- Added support for Visual Basic.
XDK Extensions was available with the Xbox 360 Development Kit for licensed developers.
- Added support for achievements and leaderboards.
In 2013, the development of XNA was discontinued.
XNA Framework is based on the native implementation of .NET Compact Framework 2.0 for Xbox 360 development and .NET Framework 2.0 on Windows.
XNA is available on Windows XP, Windows Vista, Windows 7, Windows Phone and Xbox 360.
It was released in November 2006.
It required Windows Vista.
- Deprecated Direct3D Retained Mode
- Deprecated DirectInput
- Deprecated DirectSound
- Deprecated DirectPlay Voice
- Deprecated DirectPlay in 2007
- Introduced XACT
- Introduced Shader Model 4
DirectX 10.1 was released on February 2008 and added support for Windows Server 2008.
Direct3D 10.1 introduced feature levels and Shader Model 4.1.
Added support for:
- Shader Model 4.1
- Cube map arrays
- Separate blend modes per-MRT
- Coverage mask export from a pixel shader
- Running pixel shader per sample
- Accessing multi-sampled depth buffers
It was released in October 2009.
- Introduced Shader Model 5 with support for compute shaders.
- Introduced DirectCompute for GPGPU support
- Introduced Direct2D
- Support for tessellation
DirectX 11.1 was released on August 2012.
- Included DirectXMath, XAudio2, and XInput libraries from the XNA framework
- Added support for stereoscopic 3D
DirectX 11.2 was released on October 2013.
- Added support for Windows 8.1 and Windows RT
- Added swap chain composition
The Xbox One system is based on DirectX 11.2.
DirectX 11.3 was released with DirectX 12.
It added support for:
- Shader Model 5.1
- Ordered rasterizer View
- Typed UAV Load
- Volume Tiled Resources
- Conservative grid
It was announced on March 2014 at GDC.
It was released in July 2015.
It requires Windows 10.
- Introduced Shader Model 5.1
- Introduced Shader Model 6 with a range of wave operation intrinsics.
- Updated to Shader Model 6.4 in 2019.
DirectX 12 is also featured on Xbox One.
- The March 2017 released added support for Depth Bounds Testing and Programmable MSAA
- The October 2018 released added support for DirectX Raytracing
- The May 2019 released added support for Variable Rate Shading (VRS)