I Think I Broke It!  Free online help for your everyday computer problems

How a Graphics Card Works - Page 3

Engines, Their Drivers and A Little History

All modern computer games feature a core software component, called the game engine. Its main role is to handle graphical rendering (it supplies instructions and data to the hardware), and sometimes additional tasks such as game AI (Artificial Intelligence - the actions of other computer controlled players) and collision detection between game objects. You'll hear more about how a game engine is related to the actions of the graphics card a little later, so don't worry if this isn't 100% clear at the moment! (I just needed to bring it up here to be able to mention some of the historical aspects of graphics card software).

A game engine will often be tied to a specific game genre, such as a 'first person shooter', but not to a particular game. The physical attributes of specific characters and objects are usually not coded into the engine, only the methods used to create the characters/objects are in there - e.g. there's no 'Bob' code, but there will be code that allows you to produce each constituent part of Bob in one way or another, as well as rules for how each part of Bob will react to other player/object in the virtual world. This allows other game developers to reuse existing game engines easily; an attractive option for developers who want to release a game quickly and cheaply.

 

Left: StarCraft, a real-time strategy (RTS). Strategy games focus on planning and resource management in order to achieve victory. Right: Half Life, a first-person shooter (FPS). Most FPS's focus on shooting and combat from a specific perspective, usually placing the player behind a weapon.
   
Neither of these two games could use the same type of engine, as each game works in different ways.

 

In the days of DOS, game engines also contained an extra piece of code for each gaming peripheral that could be connected to it, be it a joystick, or a soundcard. And if your particular make of soundcard didn't work with the game, then it was tough luck! The sound/graphics card manufacturer couldn't help you, it was all down to the game developer (imagine that the game engine is talking in one language, and the hardware is talking in another language).

The piece of code that acted as a 'translator' between the engine and the hardware is called a driver, but with many hundreds of different graphics cards out there, supporting them all was a growing challenge for the game developers, and something had to change.

These days hardware manufacturers make their devices to be compliant with a standard specification (after all, it's no use having hundreds of fabulous features in the hardware if the games developers don't know what they are or what they do!). By sticking to a specification that everyone in the industry can follow and understand, the hardware developers could now simply supply their own drivers, allowing the games developers to use whatever supported features they wanted.

We have Microsoft to thank for this, at least in part, owing to their DirectX API, and the widespread use of 'Microsoft Windows drivers' that allow games developers to forget about the 'hardware>game' translation headaches that they had with previous operating systems.

When Windows 95 arrived on the scene, most game developers still preferred to write games to run under DOS for performance reasons (since this allowed the engine to have access to the hardware itself, without going through Windows). This made setting up games complex (having to manually choose which IRQ your soundcard uses, the port for the midi chip etc..), and almost always required the user to shutdown Windows to run the game.

 


After a restart into a DOS environment with no sound, there's just one question left, port 332 or 334?!

 

This was unacceptable for Microsoft, who would obviously prefer games to run in Windows directly (with no configuration problems or the need to shutdown their latest and greatest OS). Thus the DirectX API (Application Programming Interface) was born, along with an SDK (software development kit) that made it far easier to develop high performance games that run under Windows. DirectX, put simply, is a collection of programming interfaces that allowed for direct, (and therefore fast) access to popular gaming hardware under Windows. Windows itself also made things far simpler, allowing users to set up a piece of hardware only once for all software in Windows to use thereafter.

Many large graphics card manufacturers (ATI/NVIDIA) have now moved from a per-card driver model (one driver for every model card), to a 'unified driver architecture', which allows the company to support a wide range of cards with one driver, making things simpler for both the end user trying to find the correct driver, and the developers, who don't have to support several hundred different products with different drivers.

So to sum up; when the graphics card is instructed to draw something in a game (be it a square or a dinosaur), the commands are sent to the game engine, which in turn passes on these instructions and any relevant data to the graphics card driver (it does this in the language of the API being used, usually either DirectX or OpenGL). This driver knows how to access the graphics card hardware directly, so it sends on the instructions and data to the relevant parts of the card to be processed.

 


All access to the graphics card hardware must go through the game engine, then the graphics card drivers first

 

This neatly takes us to the bulk, and primary focus, of the article; how the graphics card does its thing, whether that's simply displaying this page, or rendering a 3D character in your favourite game.


<<< Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 Next >>>

Article Navigation:

Latest Question

Stop Automatic Restarts after Automatic Windows Updates - After leaving my computer to encode a large video the other day, I was surprised to come back and find it sitting at the login screen. ...

View Full Question & Answer
 

Search
To search the site, enter your search string in the box below: