A basic multithreading game engine, with collection of simple demonstration games.
This was my first foray into low-level graphics programming, my first big c++ project and was the product of the dissertation for my Software Engineering BSc.
Aside from getting my head around the ins and outs of graphics programming, this project taught me a couple of lessons about writing software.
Always. Have. A. Goal. - It's not enough to specify a feature or use case and just 'code till it's done'. Brains are dumb, and I'll forget what I was working towards, and write a bunch of code that I'll never use (like a lot of the code in this project). Meeting smaller goals gives a tangible feeling of progress, which is a bonus.
Know your tools - I spent many an evening smashing my head against the keyboard trying to fix inexplicable bugs, because I didn't really understand how CMAKE, or the C++ build process worked. Having more than a surface-level understanding savs time in the long term!
Unit testing is a godsend in large projects - I gave up on unit testing fairly early on, I thought it took to long to run. Once you start to hit several layers of abstraction, you start to regret not having it.
Runs multiple different games at once (under the same process), with each game being run by several of its own threads, concurrently handling game logic and rendering.
It's a simple framework for games, providing utility for object creation, and automatically handling window creation and rendering.
Ideally, it functions as an example of how to handle multithreading with GLFW, if somewhat bloated!
Uses: OpenGL, GLFW, GLAD, GLM, Doxygen
This project is fully documented with Javadoc-style comments.
To generate documentation, run:
cd [project root]
doxygen Doxyfile
doxygen will then spit out HTML and LaTeX documentation in docs/ .
By the end of this section, your source folder should look something like this
docs
include/
glad/
GLFW/
gml/
KHR/
src/
tests/
...
Depending on what drivers are installed, you should already have this installed. For a full list of packages that contain this, run
apt-file search libGL.so
Virtualbox additions definitely has this dependency, so if you really can't get this to work, try compiling it in a virtualbox dev environment.
You'll need the x11 window manager dev tools to build this.
sudo apt-get install x11-dev
GLFW is the wrapper library for OpenGL, for things like window management.
If you're on Linux, you'll need to compile GLFW yourself as most package manager versions are out of date. You'll need to download the source files, then run:
cmake .
make install
this will place a compiled version of the library into your libs folder :)
There are pre-compiled versions of GLFW for windows available, though you'll have to modify some of the linux-specific dependencies in cmakelists to get it to compile.
An OpenGL maths utility used by the rendering module to calculate complicated stuff like perspective and field of view.
You'll have to get a copy from the GLM site.
Generate a version of the glad loader through their web form, and drop it into the includes directory.
You need to use cmake to build this project. It should work with up to date versions of g++, gcc and make.
Compiling the project will spit out two executables, one is the program itself, one is a test suite.
- Create a new folder inside src/Games
- Create two new classes, inheriting from Core and GameLogic respectively.
- Include boilerplate constructors (see Demo Game 1)
- Import any required classes from renderables/
- Write game logic code in GameLogic
- Add game to launcher in Main.cpp