Stable version to be found:

And other formats as well (may be) on the Stable HOWTOs page

If necessary use the Discussion page to give comments.

Discussion Page Content if any

The Linux Gamers' HOWTO

Peter Jay Salzman

Frédéric Delanoy

Copyright © 2001, 2002 Peter Jay Salzman

Copyright © 2003, 2004 Peter Jay Salzman, Frédéric Delanoy

2004-11-13 v.1.0.6

Abstract

The same questions get asked repeatedly on Linux related mailing lists and news groups. Many of them arise because people don't know as much as they should about how things "work" on Linux, at least, as far as games go. Gaming can be a tough pursuit; it requires knowledge from an incredibly vast range of topics from compilers to libraries to system administration to networking to XFree86 administration ... you get the picture. Every aspect of your computer plays a role in gaming. It's a demanding topic, but this fact is shadowed by the primary goal of gaming: to have fun and blow off some steam.

This document is a stepping stone to get the most common problems resolved and to give people the knowledge to begin thinking intelligently about what is going on with their games. Just as with anything else on Linux, you need to know a little more about what's going on behind the scenes with your system to be able to keep your games healthy or to diagnose and fix them when they're not.

<[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]> / http://www.dirac.org/p.

Distributed subject to the Open Software License, ver 1.1


Table of Contents:: 1. Administra:: 1.1. Authorship and Copyright:: 1.2. Acknowledgements:: 1.3. Latest Versions and Translations::2. Definitions: Types Of Games:: 2.1. Arcade style:: 2.2. Card, logic and board games:: 2.3. Text Adventure (aka Interactive Fiction):: 2.4. Graphical Adventures:: 2.5. Simulation (aka Sims):: 2.6. Strategy (aka Strats):: 2.7. First Person Shooter (aka FPS):: 2.8. Side Scrollers:: 2.9. Third Person Shooters:: 2.10. Role Playing Game (aka RPG)::3. Libraries:: 3.1. What is Glide2?:: 3.2. What is Glide3?:: 3.3. What is OpenGL?:: 3.4. What is Mesa?:: 3.5. What is DRI?:: 3.6. What is GLX?:: 3.7. What is Utah GLX?:: 3.8. What is xlib?:: 3.9. What is a widget set?:: 3.10. What is SDL (Simple DirectMedia Layer)?:: 3.11. What is GGI?:: 3.12. What is SVGAlib? Frame buffer? Console?:: 3.13. What is OpenAL?:: 3.14. What is DirectX?:: 3.15. Clanlib::4. XFree86 and You:: 4.1. Getting information about your X system:: 4.2. Playing Games In X Without a Window Manager::5. Various Topics:: 5.1. Memory Type Range Registers:: 5.2. Milking performance from your system for all it's worth:: 5.3. About libraries on Linux::6. When Bad Things Happen To Good People:: 6.1. RTFM!:: 6.2. Look For Updates and Patches:: 6.3. Newsgroups:: 6.4. Google Group Search:: 6.5. Debugging: call traces and core files:: 6.6. Saved Games:: 6.7. What to do when a file or library isn't being found (better living through strace):: 6.8. Hosed consoles:: 6.9. Locked System::7. Video Cards:: 7.1. History:: 7.2. Current Status (1 March 2004):: 7.3. Which Video Card Should I Buy? (1 March 2004):: 7.4. Definitions: Video Card and 3D Terminology::8. Sound:: 8.1. Which sound card is best?:: 8.2. Why isn't my sound working?::9. Miscellaneous Problems:: 9.1. Hardware Acceleration Problems:: 9.2. Hardware acceleration works only for the root user::10. Emulation and Virtual Machines:: 10.1. What is a virtual machine?:: 10.2. Apple 8-bit:: 10.3. DOS:: 10.4. Win16:: 10.5. Win32::11. Interpreters:: 11.1. SCUMM Engine (LucasArts):: 11.2. AGI: Adventure Gaming Interface (Sierra):: 11.3. SCI: SCript Interpreter or Sierra Creative Interpreter (Sierra):: 11.4. Infocom Adventures (Infocom, Activision):: 11.5. Scott Adams Adventures (Adventure International):: 11.6. Ultima Underworld: The Stygian Abyss (Origin, Blue Sky Productions):: 11.7. Ultima 7 (Origin, Electronic Arts):: 11.8. System Shock (Electronic Arts, Origin)::12. Websites And Resources:: 12.1. Meta gaming websites:: 12.2. Commercial Linux Game Resources:: 12.3. Other Resources::

1. Administra

If you have ideas, corrections or questions relating to this HOWTO, please email me. By receiving feedback on this howto (even if I don't have the time to answer), you make me feel like I'm doing something useful. In turn, it motivates me to write more and add to this document. You can reach me at <[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]>. My web page is http://www.dirac.org/p and my Linux pages are at http://www.dirac.org/linux. Please do send comments and suggestions for this howto. Even if I don't take your suggestions, your input is graciously received.

I assume a working knowledge of Linux, so I use some topics like runlevels and modules without defining them. If there are enough questions (or even protests) I'll add more basic information to this document.


This document is copyright (c) 2001-2002 Peter Jay Salzman, <[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]>; 2003-2004 Peter Jay Salzman and Frédéric Delanoy. Permission is granted to copy, distribute and/or modify this document under the terms of the Open Software License, Version 1.1, except for the provisions I list in the next paragraph. I hate HOWTO's that include the license; it's a tree killer. You can read the OSL at http://opensource.org/licenses/osl-1.1.txt.

If you want to create a derivative work or publish this HOWTO for commercial purposes, I would appreciate it if you contact me first. This will give me a chance to give you the most recent version. I'd also appreciate either a copy of whatever it is you're doing or a spinach, garlic, mushroom, feta cheese and artichoke heart pizza.


1.2. Acknowledgements

Thanks goes out to these people for extensive comments, corrections, and diffs. Their effort is above and beyond the call of duty:

Frédéric Delanoy, Moritz Muehlenhoff <[[mailto:jmm(at)Informatik(dot)uni-bremen(dot)de|jmm(at)Informatik(dot)uni-bremen(dot)de]]>, Mike Phillips, Ioan Rogers <[[mailto:buck(at)aiur(dot)co(dot)uk|buck(at)aiur(dot)co(dot)uk]]>

I would also like to thank the following people for sending in comments and corrections. Without their help, there would be more typos and mistakes than you could shake a stick at:

Michael McDonnell


1.3. Latest Versions and Translations

The latest version can be found at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/lgh/LG-HOWTO or http://www.dirac.org/linux/writing, but this is my own personal working copy. The version at my personal web site might be broken if I'm working on the HOWTO. The version at sourceforge is bleeding edge but guaranteed to be not broken, however it may have glitches, like unfinished paragraphs. :)

The most recent stable version can be found at http://www.tldp.org.


1.3.1. Russian

Dmitry Samoyloff <[[mailto:dsamoyloff(at)yandex(dot)ru|dsamoyloff(at)yandex(dot)ru]]> is the maintainer of the Russian translation. The most recent version can be found at http://www.dirac.org/linux/writing.


1.3.2. Hungarian

László Daczi <[[mailto:dacas(at)korhaz(dot)rethy(dot)hu|dacas(at)korhaz(dot)rethy(dot)hu]]>, the Hungarian LDP coordinator, announced that a Hungarian translation was produced by Szilard Ivan, and is available at http://tldp.fsf.hu/HOWTO/Linux-Gamers-HOWTO-hu.

- ---

2. Definitions: Types Of Games

Not everyone knows the different types of games that are out there, so in an effort to form a common language that we can all use, I'll run through each game type and provide a very brief history.


2.1. Arcade style

Although arcade games had their heydey in the 80's, they are nonetheless very popular. Nothing will ever replace walking into a dark, crowded and noisy arcade gallery, popping a quarter into your favorite machine and playing an old fashioned game of Space Invaders. Arcade style games attempt to simulate the arcade games themselves. There is such a vast number of these things that it's nearly impossible to enumerate them all, but they include clones of Asteroids, Space Invaders, Pac-Man, Missile Command and Galaxian.


2.2. Card, logic and board games

Computer based card games simulate a card game like poker or solitaire. The program can simulate your opponent(s).

Logic games usually simulate some well known logic puzzle like Master Mind or the game where you have put sliding numbered tiles in order inside a box.

Computer based board games simulate some kind of board game you'd play on a table top with friends, like monopoly, Mille Bourne, chess or checkers. The program can simulate your opponent.


2.3. Text Adventure (aka Interactive Fiction)

Once upon a time, when Apple ][, Commodore, and Atari ruled the world, text adventures were the game of choice of `intelligent folk'. You are given a scenario and can interact with the world you're placed in:

     You are in a room.  It is pitch dark and you're likely to be eaten by a grue.     > Light lantern with match.     You light the lantern.  This room appears to be a kitchen.  There's a table with a     book in the center.  You also see an oven, refrigerator and a door leading east.     > Open the oven.     In the oven you see a brown paper bag.     > Take the bag.  Open the bag.  Close the oven.     Inside the bag is a some garlic and a cheese sandwich.  The oven door is now closed. 

Back then, text adventures were self contained executables on a disk or casette. These days there's usually a data file and an interpreter. The interpreter reads data files and provides the gaming interface. The data files are the actual game itself, similar to the relationship between first person shooters (Section 2.7) and wad files.

The first adventure game was Adventure (actually “ADVENT”, written on a PDP-1 in 1972). You can play Adventure yourself (actually, a descendent); it comes with “bsd games” on most Linux distros. Text adventures became popularized by Scott Adams (Section 11.5) and reached their height of popularity in the late 80's with Infocom (Section 11.4) which are also playable under Linux.

As computer graphics became easier and more powerful, text adventures gave rise to graphic adventures. The death of commercial interactive fiction more or less coincided with the bankruptcy of Infocom.


2.4. Graphical Adventures

Graphical adventures are, at heart, text adventures on steroids. The degree to which they use graphics varies widely. Back in the 80's, they were little more than text adventures which showed a screen of static graphics. When you picked up an item, the background would be redrawn without the item appearing. The canonical example would be the so-called `Hi-Res Adventures' like The Wizard And The Princess. Later on, the sophisticated graphical adventures had your character roaming around the screen, and you could even use a mouse, but the interface remained purely text.

Next there are the `point and click adventures' which basically have no text interface at all, and often have dynamic graphics, like a cat wandering around the room while you're deciding what to do next. In these games, you point at an object (say, a book) and can choose from a pull-down list of functions. Kind of like object oriented adventuring. :) There aren't many graphical adventures written natively for Linux. The only one I can think of is Hopkins FBI (which happens to be my favorite game for Linux).


2.5. Simulation (aka Sims)

Simulations strive to immerse the player behind the controls of something they normally wouldn't have access to. This could be something real like a fighter jet or something imaginary like a mechanized warrior combat unit. In either case, sims strive for realism.

Some sims have little or no strategy. They simply put you in a cockpit to give you the thrill of piloting a plane. Some are considerably complex, and there's often a fine line between sims and strats (Section 2.6). A good example would be Heavy Gear III or Flight Gear. These days sims and strats are nearly indistinguishable, but a long time ago, sims were real time while strats were turn based. This is awkward for modern day use, since a game like Warcraft which everyone knows as a strat, would be a sim by definition.


2.6. Strategy (aka Strats)

Strategy games have their roots in old Avalon type board games like Panzer Leader and old war strategy games published by SSI. Generally, they simulate some kind of scenario. The scenario can be peaceful, like running a successful city (SimCity), or not, like illegal drug selling operation (DrugWars) or an all-out war strategy game like Myth II. The types of games usually take a long time to complete and require a lot of brainpower.

Strats can be further divided into two classes: real time and turn based. Real time strats are based on the concept of you-snooze-you-lose. For example, you're managing a city and a fire erupts somewhere. The more time it takes for you mobilize the fire fighters, the more damage the fire does. Turn based strats are more like chess---the computer takes a turn and then the player takes a turn.


2.7. First Person Shooter (aka FPS)

What light through yonder window breaks? It must be the flash of the double barreled shotgun! We have a long and twisted history with FPS games which started when id Software open sourced code for Doom. The code base has forked and merged numerous times. Other previously closed engines opened up, many engines are playable via emulators, many commercial FPS games were released for Linux and there are quite a number of FPS engines which started life as open source projects. Although you may not be able to play your favorite FPS under Linux (Half-Life plays great under winex) Linux definitely has no deficiency here!

First person shooters are characterized by two things. First, you pretty much blow up everything you see. Second, the action takes place in first person. That is, through the eyes of the character who's doing all the shooting. You may even see your hands or weapon at the bottom of the screen. They can be set in fantasy (Hexen), science fiction (Quake II), present day `real world' (Soldier Of Fortune) and many other settings.

Like text adventures, FPS fit the engine/datafile format. The engine refers to the actual game itself (Doom, Quake, Heretic2) and plays out the maps and bad guys outlined by the datafile (doom2.wad, pak0.pak, etc). Many FPS games allow people to write their own non-commercial datafile. There are hundreds, even thousands of non-commercial Doom datafiles that you can download for free off the net. Often, companies release their engines to the open source community so we can hack and improve them. However, the original data files are kept proprietary. To this day, you still have to purchase doom.wad.


2.8. Side Scrollers

Side scrollers are similar to FPS but you view your character as a 2D figure who runs around various screens shooting at things or performing tasks. Examples would be Abuse for Linux and the original Duke Nukem. They don't necessarily have to be violent, like xscavenger, a clone of the old 8-bit game Lode Runner.


2.9. Third Person Shooters

Similar to FPS, but you view your character in third person and in 3D. On modern third person shooters you can usually do some really kick-butt maneuvers like Jackie Chan style back flips and side rolls. The canonical example would be Tomb Raider. On the Linux platform, we have Heretic 2 and Heavy Metal FAKK2.


2.10. Role Playing Game (aka RPG)

Anyone who has played games like Dungeons & Dragons or Call of Cthulhu knows exactly what an RPG is. You play a character, sometimes more than one, characterized by traits (eg strength, dexterity), skills (eg explosives, basket weaving, mechanics) and properties (levels, cash). As you play, the character becomes more powerful and the game adjusts itself accordingly, so instead of fighting orcs, at high levels you start fighting black dragons. The rewards increase correspondingly. At low levels you might get some gold pieces as a reward for winning a battle. At high levels, you might get a magic sword or a kick-butt assault rifle.

RPG's generally have a quest with a well defined ending. In nethack you need to retrieve the amulet of Yendor for your god. In Ultima II, you destroy the evil sorceress Minax. At some point, your character becomes powerful enough that you can `go for it' and try to complete the quest.

While the insanely popular Ultima series, written by Richard Garriot (aka Lord British) for Origin, was not the first RPG, it popularized and propelled the RPG genre into mainstream. Ultima I was released in 1987 and was the game that launched 9 (depending on how you want to count them) very popular sequels, finishing with Ultima IX: Ascension. You can play Ultima VII under Linux with Exult (Section 11.7).

The canonical RPG on Linux is Rogue (the ncurses library started life as a screen handling routine for Rogue!) and it has infinite variants like Zangband and Nethack (which has many variants itself). Some RPG's are quite complicated and great feats of programming. There seems to be a deficiency of commercial RPGs for Linux. Not counting the rogue variants, there's also a deficiency of open source RPGs too.


3. Libraries

We'll run through the different gaming libraries you'll see under Linux.


3.1. What is Glide2?

Glide2 is a low level graphics API and driver that accesses 3D hardware accelerated functions on 3dfx's Voodoo I, II and III cards, under XFree86 3.x. A program can only use the special hardware accelerated features of these cards by using the Glide2 library in one of two ways:

3dfx opened up the specifications and source code to the open source community. This allowed Daryll Strauss to port Glide2 to Linux which enabled XFree86 3.x users to use Voodoo I, II and III cards under Linux.

Since Glide2 accesses the video card directly, Glide2 applications will either need to be run by root or be setuid root. A way around this was to create the kernel 3dfx module. This module (and its device file /dev/3dfx) allows Glide2 graphical hardware acceleration for non-root users of non-setuid applications.

Unfortunately, Glide2 is also a dead issue. It's only used for Voodoo I, II, III boards (which are becoming outdated), under XFree86 3.x (most people use XFree86 4.x). And since 3dfx is now a defunct company, it's a sure bet that no more work will be done on Glide2 and no more games will be written using Glide2.


3.2. What is Glide3?

Unlike Glide2, Glide3 is not an API used for game programming. It exists only to support DRI on Voodoo III, IV and V boards under XFree86 4.x. None of the games which use Glide2 will work with Glide3. This shouldn't be a surprise since Glide2 and Glide3 support different video cards and different versions of XFree86. The only video card that can use both Glide2 (under XFree86 3.x) and Glide3 (under XFree86 4.x) is the Voodoo III. It's reported that a Voodoo III using Glide2 will outperform a Voodoo III using Glide3.

When you use a Voodoo III, IV or V under XFree86 4.x, you want to use a version of Mesa (see Section 3.4) which was compiled to use Glide3 as a backend to ensure hardware accelerated OpenGL on your system.


3.3. What is OpenGL?

OpenGL is a high level graphics programming API originally developed by SGI, and it became an industry standard for 2D and 3D graphics programming. It's defined and maintained by the Architectural Revision Board (ARB), an organization which include representatives from SGI, IBM, DEC, and Microsoft. OpenGL provides a powerful, complete and generic feature set for 2D and 3D graphics operations.

There are 3 canonical parts to OpenGL:

OpenGL is not only an API, it's also an implementation, written by SGI. The implementation tries to use hardware acceleration for various graphics operations whenever available, which depends on what videocard you have in you computer. If hardware acceleration is not possible for a specific task, OpenGL falls back on software rendering. This means that when you get OpenGL from SGI, if you want any kind of hardware acceleration at all, it must be OpenGL written and compiled specifically for some graphics card. Otherwise, all you'll get is software rendering. The same thing is true for OpenGL clones, like Mesa.

OpenGL is the open source equivalent to Direct3D, a component of DirectX (Section 3.14). The important difference being that since OpenGL is open (and DirectX is closed), games written in OpenGL are much easier to port to and co-develop on Linux than games written using Direct X.


3.4. What is Mesa?

Mesa <http://www.mesa3d.org&gt; is a free implementation of the OpenGL API, designed and written by Brian Paul. While it's not officially certified (that would take more money than an open source project has), it's an almost fully compliant OpenGL implementation conforming to the ARB specifications. It's reported that Mesa is even faster than SGI's own OpenGL implementation.

Just like OpenGL, Mesa makes use of hardware acceleration whenever possible. When a particular graphics task isn't able to be hardware accelerated by the video card, it's software rendered; the task is done by your computer's CPU instead. This means that there are different builds of Mesa depending on what kind of video card you have. Each build uses a different library as a backend renderer. For example, if you have a Voodoo I, II or III card under XFree86 3.x, you'd use mesa+glide2 (written by David Bucciarelli) which is the Mesa implementation of OpenGL that uses Glide2 as a backend to render for graphical operations.


3.5. What is DRI?

Graphics rendering has 3 players: the client application (like Quake 3), the X server and the hardware (the graphics card). Previously, client applications were prohibited from writing directly to hardware, and there was a good reason for this. A program that is allowed to directly write to hardware can crash the system in any number of ways. Rather than trusting programmers to write totally bug free, cooperative programs that access hardware, Linux simply disallowed it. However, that changed under X 4.x with DRI (Direct Rendering Infrastructure <http://www.dri.sourceforge.net&gt;. DRI allows X clients to write 3D rendering information directly to the video card in a safe and cooperative manner.

DRI gets the X server out of the way so the 3D driver (Mesa or OpenGL) can talk directly to the hardware. This speeds things up. The 3D rendering information doesn't even have to be hardware accelerated. On a technical note, this has a number of virtues.


3.6. What is GLX?

GLX is the X extension used by OpenGL programs, it is the glue between the platform independent OpenGL and platform dependent X.


3.7. What is Utah GLX?

Utah-GLX is the precursor to DRI. It makes some different design decisions regarding separation of data and methods of accessing the video card like relying on root access rather than creating the kernel infrastructure for secure access. It provides support for a few cards which are not well supported by DRI like the ATI Rage Pro family, S3 Virge (although anyone using this for gaming is, well, nuts), and an open source TNT/TNT2 driver (which is very incomplete). The TNT/TNT2 driver is based on reverse-engineering of the obfuscated source code release of the X 3.3 drivers by nVidia. However, they're really incomplete, and effectively, unusable.


3.8. What is xlib?

Every once in awhile you'll see some sicko (said with respect) write a game in xlib. It is a set of C libraries which comprise the lowest level programming interface for XFree86. Any graphics programming in X ultimately makes use of the xlib library.

It's not an understatement to say that xlib is long winded, arcane and complicated. Because of this, there are lots of libraries like SDL (Section 3.10) for 2D graphics, OpenGL (Section 3.3) for 3D graphics and widget sets (Section 3.9) for widgets within windows which hide the details of different aspects of xlib programming.

While some games are written in xlib, like the Doom Editor Yadex, xlib itself is not a serious game writing library. Most games don't need the low-level interface that xlib provides. In addition, by using the higher level libraries, a game writer can develop his game on multiple platforms, even ones that don't use XFree86.


3.9. What is a widget set?

Widgets are objects that make up a GUI application's interface. They include things like text entry boxes, pulldown menus, slider bars, radio buttons and much more. A widget set is a collection of related widgets that are designed to have a common interface and a consistant "feel". Gtk is the canonical widget set on Linux, but there are many others like fltk (a small C++ widget set), Xaw, Qt (the widget set of KDE), and Motif (the widget set used by Netscape). Motif used to be the king of widget sets in the Unix world, but it was very expensive to license. The Open Group finally opened up Motif's license for open source operating systems, but it was too little too late. There are many completely open source widget sets which are more complete and much nicer looking than Motif, including Lesstif, a totally free Motif clone.


3.10. What is SDL (Simple DirectMedia Layer)?

SDL <http://www.libsdl.org&gt; is a library by Sam Lantiga (graduate of UCD, yeah!). It's actually a meta-library, meaning that not only is it a graphics library which hides the details of xlib programming, it provides an easy interface for sound, music and event handling. It's LGPL'd and provides joystick and OpenGL support as well. Unlike xlib (Section 3.8), SDL is very suited for game programming.

The most striking part of SDL is that it's a cross platform library. Except for a few details, a program written in SDL will compile under Linux, MS Windows, BeOS, MacOS, MacOS X, Solaris, IRIX, FreeBSD, QNX and OSF. There are SDL extensions written by various people to do things like handle any graphics format you care to mention, play mpegs, display truetype fonts, sprite handling and just about everything under the sun. SDL is an example of what all graphics libraries should strive for.

Sam had an ulterior motive for writing such a cool library. He was the lead programmer for Loki Software (he now codes for Blizzard Software), which used SDL in all of its games except for Quake3.


3.11. What is GGI?

GGI <http://www.ggi-project.org&gt; is a project which aims to implement a graphics abstraction layer in lower level code, put graphics hardware support into a common codebase, and bring higher stability and portability to graphics applications. LibGGI applications run on SVGAlib, fb, and X servers among others. Judging from their screenshots, this is quite a powerful library.

Applications that use LibGGI directly include Heroes, Ultrapoint, Quake, and Berlin. Most applications that use SVGALib can be run on X or any other LibGGI backend by using a wrapper library which re-implements SVGALib (Section 3.12) using LibGGI. SDL (Section 3.10) and clanlib (Section 3.15) applications can display on LibGGI but often the native drivers for these libraries are faster, however it's a good way to get SDL, clanlib, and SVGALib applications to run where they would not before.

GGI has a sister project, KGI, which is developing a kernel-level alternative to systems like the linux framebuffer and the DRI. This project is much less far along than LibGGI itself, but promises to combine DRI-level speeds and the stability and security UNIX users expect.


3.12. What is SVGAlib? Frame buffer? Console?

The console is the dark non-graphical screen you look at when your computer first boots up (and you don't have xdm or gdm running). This is opposed to the X environment which has all sorts of GUI things like xterms. It's a common misconception that X means graphics and console means no graphics. There are certainly graphics on the console—we will discuss the two most common ways to achieve this.

SVGAlib is a graphics library that lets you draw graphics on the console. There are many graphical applications and games that use SVGAlib like zgv (a console graphical image viewer), prboom and hhexen. I happen to be a fan of this library and of graphical console games in general; they are extremely fast, fullscreen and compelling. There are three downsides to SVGAlib. First, SVGAlib executables need to be run by root or be setuid root, however, the library releases root status immediately after the executable begins to run. Secondly, SVGAlib is video card dependent–if your video card isn't supported by SVGAlib, you're out of luck. Third, SVGAlib is Linux only. Games written in SVGAlib will only work on Linux.

Frame buffers are consoles implemented by a graphics mode rather than a BIOS text mode. Why simulate text mode in a graphical environment? This allows us to run graphical things in console, like allowing us to choose any font we want the console to display (which is normally set by BIOS). There's a good Framebuffer HOWTO available from LDP. Graphical console games written using the frame buffer suffer from the same deficiencies of the SVGA library: not all hardware is supported and the code will only run on Linux.


3.13. What is OpenAL?

OpenAL <http://www.openal.org&gt; aims to be for sound what OpenGL is for graphics. It started as a joint project between Loki Software and Creative Labs, setting out to be a vendor neutral and cross platform API for audio - the audio equivalent of OpenGL (Section 3.3). Loki is no longer in business, but Creative and the Open Source community have kept the project alive. It is licensed LGPL and the specs can be obtained for free from the OpenAL website. It has support from nVidia (nForce2/3 based motherboards come with OpenAL MS Windows libraries for the on-board audio), Apple has added OpenAL to their audio framework for OSX and it can also be found powering the Epic Games Unreal Engine

Currently, it's not all cross-platform goodness. There is almost no support for enhancements like EAX or any hardware acceleration on Linux, though it does it exist in the Windows implementation. However, if you have a Creative SoundBlaster or Audigy sound card (with an emu10x chip), and you use ALSA sound drivers, you can get OpenAL libraries from http://www.lost.org.uk that provide hardware acceleration and decent surround support.


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:: 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 (D3D):: 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:: 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:: DirectInput gives support for gaming input devices such as joysticks.DirectPlay:: DirectPlay gives support for simplified networking for multiplayer gaming.DirectShow:: DirectShow provides support for movie files like AVI and MPG. It was a separate API from DirectX, but was integrated with DirectX 8.DirectSetup:: 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&gt; 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&gt;.


3.15. Clanlib

ClanLib is a medium level development kit. At its lowest level, it provides a platform independent (as much as that is possible in C++) way of dealing with display, sound, input, networking, files, threading and such. ClanLib builds a generic game development framework, giving you easy handling of resources, network object replication, graphical user interfaces (GUI) with theme support, game scripting and more.


4. XFree86 and You

If you're going to game under X, it's crucial that you know a bit about X. The "X Window User HOWTO", and especially "man XF86Config" are required reading. Don't short change yourself; read them. They have an extremely high "information to space" ratio. Many problems can be fixed easily if you know your way around XF86Config (or XF86Config-4).


4.1. Getting information about your X system

Whether you're trying to diagnose an X problem or requesting help from a mailing list or Usenet newsgroup, you'll want to have as much information available as possible. These are a set of tools you can use to obtain that information.


4.1.1. Probeonly

One of the best diagnostic tools and sources of information about your X system is probeonly output. To use it, kill X if it's already running and from a console, type: