LibBoredom is a utility library for games/graphical applications written in C++ using OpenGL with SDL for use under Linux and Windows. It's components were originally created for a game I was working on for a game programming competition, but was unable to finish due to time constraints. I figure this is a good way to turn what I had done into a releaseable product. As well, since it does not contain any gameplay related code, it is suitable for use in the Ludumdare LD48 game programming competitions or any other competition where utility libraries are allowed.
The purpose of LibBoredom is to alleviate the programmer from some repetitive programming required by nearly any GL/SDL game. There are various classes in the library, each with specific purposes. You can find more about each component below, as well as their specific class documentation.
The graphical utilities in LibBoredom represent the majority of it's use. The TextureFactory class is a wrapper for loading textures into OpenGL. It can be used directly by the programmer as well as is used by other graphical classes within LibBoredom. It also contains the capability to load textures to wxWindows bitmaps, however this code is commented out as I wanted to keep wxWindows from being a prerequisite for installing this library. If you want this code feel free to re-enable it.
For rendering objects, the Model class can load Milkshape 3d models and render to the screen. A ModelFactory wrapper class is provided. This allows you to load a group of models listed in an index file and reference them by name. See Index File Format for implementation details, and the example.
There are also 2 scene manipulation classes. Camera is a powerful class. Given a new set of co-ordinates, it will pan to that new position from it's old position. You call Camera to update the scene after glLoadIdentity(), and tell it to update it's position once per frame. The other scene class is Lights. Right now it just sets up the ambient lighting, but the plan is for this to be able to keep track of scene lighting however it's needed.
SDL's built in keyboard event handling is screaming for a wrapper class, and here it is. You set up an enum with your various keyboard events, and assign each event to a SDL_ key event. Calling InputHandler will update the state of the keyboard - which keys are down and which have been released. As long as the keyup event hasn't been sent, the key will be considering still pressed. The side-effect of this class is that any other SDL event's are ignored. If you need to handle any other events (window resize for example) edit the InputHandler code to deal with it as you need. I'll fix this in a later release to ignore all but keyboard events.
A very versatile methodology of programming game events is using priority queues. I provide an Event base class that keeps track of the event id and generic variables for the events. I also provide an EventQueue for dealing with time-based events.
The TextureFactory and ModelFactory class support loading indices from files to automatically load a list of resources with one command. The format of all these files are quite simple. However, the loading routine is really unforgiving. Screw up the format and you get a segfault. I'll fix it sometime, but really.. if you're programming a game the least you can do is not forget a semicolon :). The format for the Factories is as follows: Note the trailing colon. Also, the filename should be as seen by the executable or whatever the current directory is when the game is being run. The index number and the name are whatever you want, and you can call the factories to return the resource by name or index. See the specific help files for more details.
Below are links to more specific help, separated by class. This library is a very rough WIP. It's also not that high on my priority list right now, but if someone emails me complaining of a bug, I'll be quick to fix and respond. The idea of someone using it alone is enough motivation in that case :). I also welcome 3rd party bug submissions or feature additions. Send me whatever. My email address is: th0mas@sdf.lonestar.org. Thanks. Oh and my name is Tom. My website, if you found this somewhere else and aren't sure, is http://th0mas.sixbit.org.LibBoredom - Game Utility Library
Introduction
Purpose
Graphical Classes
Input Handling
Event Subsystem
index #:name:filename:Class Help
Model
TextureFactory
ModelFactory
Camera
Lights
InputHandler
Event
EventQueue
Contact