Quick Links

BLIG OpenGL/SDL Video Game

This project was developed primarily so I could learn about using OpenGL in combination with SDL (Simple DirectMedia Layer). Consequently, it is not a complete game or even terribly well written. It has numerous inefficiecies and is poorly documented. Nevertheless, you are welcome to use it as a reference in your own educational persuits and can even use it as a starting point to develop your own game if you like. Just be aware that it is distributed under the GPL version 2.0. Be sure to read the included license.txt file to understand your obligations under that license before using this code in your own project. Personally, I think you could make a really fun screensaver out of this code very easily.

The project is split into two pieces, the RealmLib library that provides some basic object oriented c++ wrappers for rendering shapes with OpenGL, and then the blig code itself. You can use the RealmLib library as a standalone starting point for your own project.


No need to type ./configure, just dive in and type 'make' and the project should build on most Linux systems. Of course you will need the appropriate development libraries installed. This includes the standard gcc/g++ and make utilites. Also you should install:

  • SDL development libraries
  • Mesa development libraries
  • libglu1-mesa Libraries
On a Debian or Ubuntu based system, these should all be available via Synaptic or apt-get. The Ubuntu forums are particulary helpful if you are not sure what to download or how to do it.

Note that you must also have hardware accellerated GLX support enabled to get any sort of useful framerate. Most Radeon or nVidia cards are well supported, though many Linux distributions do not install the hardware accelleration support by default. Check out the help forums and howto docs appropriate for your distribution (I found it rather easy on Ubuntu).


This is just reference code, and very alpha at that, so no install script is provided. Just run ./blig from within the build directory and it should work. It looks for image and data directories relative to its starting point, so if you do move the execututable, you should move those also or hack the code to look in the right place.


The program starts with your blimp floating motionless in a realm of endless sky with a bunch of other blimps flying around you. You can turn and move your blimp and even fire a cannon. There is currently no scoring or any real objective, but I've encluded some options for trying different resolutions and changing the number of blimps to test your video card's performance.
USAGE: blig [options]
  -fs                  : Go into fullscreen mode
  -wsize   : Select screen/window size
                       :   Valid choices are 640x480,
                       :   800x600, 1024x768, 1280x1024
  -cdepth      : Color depth.  Something like
                       :  16, 24, or 32.
  -ships       : number of ships to render
                       :   Should be between 3 and 500
From within the game/demo, you can use the following keys:
  Esc   = Exit
  Up    = Increase Altitude
  Down  = Decrease Altitude
  Left  = Turn Left
  Right = Turn Right
  A     = Increase Speed
  Z     = Decrease Speed
  Q     = Turn Cannon Left
  W     = Turn Cannon Right
  S     = Point Cannon Down
  X     = Point Cannon Up
  F     = Fire Cannon
  P     = Snap a screenshot
  I     = Pan Up
  M     = Pan Down
  1     = Select Ship # 1
  2     = Select Ship # 2
  3     = Select Ship # 3
  9     = Flip the instruments on screen
  0     = Flip the instruments off screen


The name blig was just an of-the-cuff decision derived from the word blimp and the letter G for GNU (Gimp was already taken). I suppose it could have been Glimp... Anyway, I'm sure I'll rename it to something very different if I ever make a real game out of it.


I have tentative plans to improve and extend this project into a real working video game. The intended outcome is a strat game with some realtime combat. Planned enhancements include:

  • Add sound support
  • Convert ship data files into XML so they are more easily extensible
  • Add more shape primitives to RealmLib, including one that can read model files like MD2.
  • Improve the game physics and collision detection
  • Create more instrument plug-ins for the instrument panel
  • Add panaramic sky scenery / cloudscapes
  • Hidden shape culling
  • Polygon reduction on distant shapes
  • Add color/textures to the explosions
  • An in game tool for customizing your blimps
  • Decouple the simulation processing rate from the render speed
  • Mouse based targeting system
  • A bunch of game logic additions to the simulation
  • Additional objects... floating fortresses and islands mostly.


If you have any feedback, problems, suggestions, etc... send them to blig@tux.glaci.com. I am particularly interested in the frame rates people see on different hardware configurations. Be sure to include screen resolution, color depth, and number of blimps in your message if you send that. I've been benchmarking with 800x600 resolution and 24 bit color depth with 20 to 150 blimps. That yields a consistant frame rate of around 40 to 30 fps respecitively on my GeForce 5200 card, 2.8GHz, 1GB RAM system running a 2.6.17 kernel and binary drivers from nVidia. I would love to compare that to performance on other configurations.

I hope you find this useful. Happy coding!

Thad Phetteplace