Direct What?These days running a game on your PC can be a confusing matter. Does your video card support trilinear filtering? What version of Direct3D do you need? Will it run with the MX video card or do you need the Ti? Should I use 65,000 colors or 16 million? What refresh rate do I need? And so on...It's a whole lot of gobbledy gook, and let's face it... As players we just don't care! All we want is to download, install, and play the game. This article will try to de-mystify one of the things you hear a lot about when trying to run a game. DirectX. Most games will say "You require DirectX version 8" etc... But what does that mean? Why do you need it? And what's the difference between version 5 and version 9? Should you upgrade? This article is not meant to help you run DirectX on your computer, but rather it's an article that goes into a little more depth and tries to help you understand, as a non technical person, on a more fundamental level what DirectX is. If you understand the article then making the other decisions should be easy. An InterfaceDirectX is an Interface for game developers (or just programmers in general). What do I mean by interface? In order to try and make it clear to you non-techies I'm going to take a roundabout way of explaining it using an analogy that everyone can understand.Picture a vending machine selling soft-drinks. As a consumer looking to buy a soft drink you really don't care what's going on inside the vending machine so long as it counts your money correctly, responds correctly to your flavor selection, and gives you your drink and change. For instance when you drop a nickel in the coin slot you don't care whether the coin acceptor in the machine uses a digital switch or an analog sensor to determine that 5 cents has been added. All you care about is that the 5 cents gets credited towards your purchase. The buttons and slots on the vending machine are your interface to the complex stuff going on inside. I will use the vending machine analogy freely and interchangeably in the text below when talking about DirectX. Lets try to move the vending machine analogy towards what DirectX means to us as game developers and finally to you as a player. How DirectX Came about and What it isFirst a little history. As a game developer what do I want to do? Basically I want to display pictures on the screen, read input from things like joysticks or your keyboard, and play sounds and music. As a game developer I really don't care or want to know how the circuits on a video card work. But back when DOS was the major PC operating system that's exactly the kind of thing I had to know to program a game. If I didn't understand it I couldn't make a game. For instance I had to understand what a latch register was on a VGA (video graphics adapter) card. But really as a game designer I didn't care about that. It was a means to an end. All I really wanted to tell the computer to do was "load the picture of pacman and display him in the middle of the screen." -- In fact it was very difficult making a game because there were many different competing companies providing video cards and each card worked differently! At some points it was necessary to understand how the hardware worked for each card in detail in order to make something that would run on a reasonable number of PCs.After windows came out programmers were moved away from the specifics of the hardware that PCs were running and into a more abstract world where our entire interface to your computer was something called the Win32 API. The "I" in API stands for "Interface". That brings us back to the vending machine. Win32 was our interface when making a windows program run. It wasn't concerned with the details of how the computer worked. It was just like a set of buttons on a vending machine. Except in our case the buttons didn't say "Push here for Pepsi", they said "Push here to make a new window" or "Push here to read what the mouse is doing". The abstract interface freed us as developers to program games without having to know anything about how the various video cards worked. All we had to understand was what the various many many buttons did. The button results became the responsibility of the video card company. They had to make their card work with windows and we had to take care of hitting the right buttons. The video card company was responding to the vending machine button presses and we were just pushing buttons to tell the machine inside what to do. We had no idea how it worked internally just like a soft drink purchaser need not know how a coin acceptor device works to add a nickel to his purchase. (In practice many of us knew a little about how things worked underneath, but the idea was that it shouldn't be necessary.) In earlier versions of windows before and including Windows95 not many games used Windows. In fact a lot of them still ran in DOS. Why would game developers choose to run their games in DOS when there was a nice interface to use which didn't require them to learn and program all the complex differences of each video card available on the market? The answer in one word is "speed". DOS gave us direct access to the video card so we could do things quicker than we could in windows. In fact the speed difference was significant enough that many games we wanted to make simply couldn't realistically be made using earlier versions of Windows. As Windows progressed it was realized that in order to make it a viable platform to play computer games something would need to be done to give programmers a more direct link to the video card hardware. There were a few little jumps in between that I'll ignore, but basically this led to the creation of DirectX. Now we're back to the vending machine analogy. DirectX was an abstract interface (like the buttons on vending machines) to the complexities of the video hardware but tied into the operating system in such a way that it provided us as developers fast "more direct" access to video. ![]() The DirectX interface became the standard for programming games for PCs. Video card makers would have to ensure that their cards responded to the DirectX interface correctly by writing video drivers that worked. As with all software the drivers sometimes contained bugs so the system was not perfect. It's like hitting the button for Coke but sometimes you get a Pepsi. That's why often updating your video driver will fix a game that doesn't work. The game programming we did was hitting the buttons correctly but the video card was responding wrong so it broke. (and of course sometimes we just hit the wrong buttons). But technical innovation didn't stop. As new cards came out new capabilities and new issues followed. Eventually video cards could start displaying 3D images with special graphics processing units, and they could display more colors, and they could display higher resolutions. As the hardware evolved and became more powerful DirectX had to evolve and offer new vending machine buttons for the new features. If a game company wants to use the very latest features of the video hardware then they need to use the very latest version of DirectX. That's why many commercial games which often compete in the marketplace by providing the very latest and greatest video require you to run the latest version of DirectX. Sometimes though the programmers who make games simply use the latest version of DirectX even though they are not using the latest features, so in some cases you're forced to upgrade to the newest version of DirectX unnecessarily. They only ever hit the Coke button and don't use the new Root beer button, but they require you to have a vending machine with the Root beer button anyway even though it's not used. Another thing I'll mention about DirectX is that it has become a superset encompassing more than just video display. DirectX is not only used for video but also for things like Joystick input, to play music and sound effects, to let you play against other players over the internet, and to access the 3D hardware on your video card (that part usually referred to as Direct3D) - A whole number of game related things that programmers want to do. As well DirectX is not only used by game developers but by any programmer that wants to use these sorts of features. For instance a program that plays mp3 music might use the DirectMusic or DirectSound elements of DirectX. I'll also note that many of you probably already have DirectX on your computers without knowing it. One reason for this is that many of the operating systems coming out today like WindowsXP already contain the latest version of DirectX that was available at the time they shipped the operating system. You can always upgrade to the latest version of DirectX. Older games that use earlier versions will still run. It's designed that way on purpose. (i.e. if a game says "requires DirectX 5" it means "version 5 or higher"). But since the programmers who maintain DirectX and the game developers who use it are not perfect I'd suggest sticking to a version that works for you unless you really need to upgrade for a new game. Or as the old saying goes. If it aint broke don't fix it. In our case we try to use the lowest version of DirectX possible because we want our games to run easily on as many computers as possible. Related LinksMicrosoft's Official DirectX Page |