3.14. What is DirectX?
DirectX is a collection of proprietary multimedia API's, first developed by Microsoft in 1995, for its various Windows OS's. It's a mistake to say something like "DirectX is like OpenGL" or "DirectX is like SDL", as is commonly said in DirectX tutorials. Multimedia API's are more centralized on Windows than they are on Linux. A more accurate statement would be something like "DirectX is like DRI, OpenGL and SDL combined". As of October 2004, the most recent version of DirectX is 9c. The components of DirectX are:
- DirectDraw
- Direct3D (D3D)
- DirectAudio
- DirectInput
- DirectPlay
- DirectShow
- DirectSetup
DirectDraw gives direct access to video memory, like DRI, so 2D graphics can be blitted directly to the video card. DirectDraw is like the graphical component of SDL, but the direct video card access is done by DRI rather than SDL. This is why a game can easily take out a Windows system but should not take down a Linux system.
Direct3D, like OpenGL, provides a 3D graphics API. Whereas OpenGL is open source, lower level and compiles under a multitude of operating systems, D3D is proprietary, higher level and only compiles on Windows. D3D first appeared in DirectX 2, released in 1996.
DirectAudio is a combination of 2 audio API's, DirectSound and DirectMusic, which allows direct access to the sound card for sound and music playback.
DirectInput gives support for gaming input devices such as joysticks.
DirectPlay gives support for simplified networking for multiplayer gaming.
DirectShow provides support for movie files like AVI and MPG. It was a separate API from DirectX, but was integrated with DirectX 8.
This API provides a way to install DirectX from within an application to simplify game installation.
Depending on the version of DirectX you're talking about, DirectX support in winex (Section 10.5.3 ) ranges from well supported to "kind of" supported. It's poorly supported by wine (Section 10.5.1 ), barely supported by vmware (Section 10.5.5 ) and unsupported by Win4Lin (Section 10.5.4 ).
One comment about portability: Each component of DirectX has multiple corresponding library on Linux. Moreover, a game writer who uses libraries like OpenGL, GGI or SDL will write a game which will trivially compile on Windows, Linux and a multitude of other OS's. Yet game companies persist using DirectX and therefore limit their audience to Windows users only. If you're a game writer, please consider using cross platform libraries and stay away from DirectX.
A company named realtechVR started an open source project, DirectX Port, <http://www.v3x.net/directx > which, like wine, provides a Direct3D emulation layer that implements Direct3D calls. The project was focused on the BeOS platform, but is now focused on MacOS and Linux. You can get the latest cvs from their sourceforge page at <http://sourceforge.net/projects/dxglwrap >.
* License

