DirectX's true intent is to make game programming as simple as possible by providing a hardware-independent abstraction layer above the myraid of blazingly fast (and immensely different) graphics cards. Another advantage is that DirectX drawing and screen display routines are a lot more minimalized and boiled down than GDI calls. Mind you, DirectX games are not portable across platforms (Wine does have some DirectX support, but no one seriously considers that when making a game to bring to market). With some abstracted functions, you can work around that. DirectX is also an underlying technology of the upcoming Xbox game console.

The first flagship game to use the Direct X technology was actually Doom, a non-DOS version of the famous first person shooter. It required DirectX 1.0, which was just a fledgling product that you could download from the Microsoft website. I inadvertently got it the day it came out. DirectX really didn't mature until release 3 (for NT 4, and most DirectDraw items, which came late), or release 5 (the first excellent, very clean and widespread release). A lot of hardware vendors today provide DirectX aware drivers for the hardware, making the game developer's life just a bit easier.

Introduction :
DirectX is Microsofts proprietary technology for multimedia and game programming.
It is based on ActiveX / COM and provides an abstraction of the underlying hardwares capabilities, allowing programs to be written that do not need to deal with the nitty-gritties of every brand of hardware component.

Background :
In order to have a grasp about what DirectX is all about, we need to delve into the workings of modern (and ancient) graphics hardware and a little history.
To display an image on your screen, your graphics adapter maintains a block of memory ( called the frame buffer ) which is a matrix containing the intensity ( and color ) of the pixel at every coordinate. All graphics involves rapid modification of this frame buffer.
In the dark ages ( or good old days ), Old monks, in dark cloisters, by the light of flickering candles had to .. Er !
I mean, tough programmers had to do everything the hard way, painstakingly manipulating the memory to produce all the pretty colors.

When the IBM PC first came out it had a crummy graphics adapter called the CGA, which was even worse than the hardware on the cheaper systems like the Commodore-64 or the BBC Micro, but that wouldn't keep the good programmer down and heaps of great games were written. ( Remember PC - Man, Paratrooper , MoonBugs ? )
However PC games could never compare with console games and it was a jagged four coloured world for PC gamers.
Then IBM came up with the VGA, and suddenly PC game developers could enjoy an unbelievable ( at that time ) resolution of 640 x 480 with 16 simultaneous colors, or a 320 x 200 screen with a mind-boggling 256 simultaneous colors! ( Pant! Pant! Drool!! )

Some of the best games ever ( Wolfenstein, One Must Fall, Doom, Quake, Stargun, Tomb Raider etc. ) were developed for the VGA, but gamers craved for more realistic graphics and hardware vendors found differing and incompatible ways of extending the VGA. This left developers in a quandary as they had to take arms against a sea of conflicting graphic adapters ( and write code for each of them) or by opposing, end their dreams of being rich and famous.

Meanwhile, Windows was spreading like the plague, but its graphics performance was pathetic. Windows provided an API called the GDI which isolated developers from the quirks of the underlying graphics hardware, but it was too slow to use for graphically intensive games ( hence we have MineSweeper, Solitaire, Tetris etc. ).
The problem was that while GDI was good for efficient drawing of GUI elements ( windows, buttons etc. ) and WYSIWYG printing, it was not meant for the kind of graphics that games required. Moreover, Windows frowned upon direct hardware access and there was no clean way to get access to the hardware frame buffer unless you wrote a DOS game, in which case you were limited to VGA resolutions.
There was a need for a better way and Microsoft came up with DirectX ( actually they first came out with WinG and DCI, but that's a story for another node! ).

DirectX components:
Initially, DirectX had only two major components DirectDraw and DirectSound. These provided standard interfaces to access the graphics frame buffer and the sound hardware.
Then as 3D accelerators started getting popular, Direct3D was born , Multiplayer games begat DirectPlay and Microsoft threw in DirectMusic at some point.

So we now have:
The good :
The bad and ugly: Anyone for MoonBugs 2?

Log in or register to write something here or to contact authors.