Some years ago, I was fascinated by the inner workings of the games I played. I already had learned C++, so I set out to find out more about the libraries and techniques specific to graphics programming.
Next, I read up on engine design. Of course, ambitious as I was, I aimed for a fully scalable multi-threaded engine. Had I wanted to create an actual game, this would have led to endless frustration (as any game programmer can tell you, writing an engine won't produce any quick results) Luckily, I just wanted to understand how those engines worked, so I didn't need any exciting results.
The TaskEngine library has two purposes: It manages the different threads of the engine and it allows those threads to communicate with each other. Several threading models and interactions are supported, for debugging even a single-threaded mode can be enforced.
Message passing uses the concept of "channels" (or topics) to which the threads can subscribe. Each channel can have multiple posters and subscribers, to support different usage models.
The following image gives a small overview of the design, click it to enlarge it:
The engine itself, OTE, is a bit more complicated. It basically consists of multiple threads for graphics (currently using OGRE), physics (OgreNewt), input (OIS) and game logic. Note that those subsystems could easily be replaced, e. g. using PhysX for physics calculations, since each thread only expose the standard public interface - the other threads know nothing about its inner workings.
Again, I have a diagramm (made using Dia) showing the design of OTE, this one a bit larger than the first:
While this engine was developed on Ubuntu, it should also run on Mac OS and Windows, or at least be easily portable, since it only uses portable libraries.