C++ game engine development resources for educational purposes.
This repo is work in progress and is not even half finished, but you still can find some useful links and code examples here.
SDL is a cross-platform library for creating a window and handling window events (keyboard presses, mouse clicks, etc.).
OpenGL loading library called glad helps with OpenGL integration.
Alternative libraries:
Code examples:
- Window.h - window is abstracted. Because of this abstraction we can implement window using any library and swap it for another later if needed.
- SDLWindow.cpp - window implementation using SDL library.
To be able to handle user input: key presses, mouse movements and clicks, etc. you will need to handle window events.
Code examples:
- Events - directory contains custom defined events. We define our custom events in order to not depend on any library, this way we could swap SDL for some other library relatively easily.
- SDLWindow.cpp -
HandleEvents()
method transforms SDL events into our custom defined events.
Any engine needs some kind of UI for development and debugging purposes.
Dear ImGui is one of the best libraries for creating UIs in C++.
Entity Component System is a software architectural pattern for the representation of game world objects.
EnTT is one of the most popular ECS libraries in C++.
Resources:
Libraries:
glm math library for graphics software based on the OpenGL Shading Language (GLSL) specifications.
For creating tiles, maps, etc.
Tools:
Libraries:
Resources:
It's important to have extensive logs in your application to understand what is happening and when.
spdlog is one of the libraries that can be used for logging.
Code examples:
- Log.h - logger is abstracted so we can use any library we want.
Rendering large amounts of objects can affect performance. Batch rendering is an optimization technique to make your game faster.
Resources:
Data locality, or locality of reference, is the tendency of a processor to access the same set of memory locations repetitively over a short period of time.
We can utilize this knowledge together with optimizations like Data-oriented design to improve performance when processing large arrays of data.
Resources:
TODO
Resources:
- opengameart.org - free game art
- MagicaVoxel - GPU-based voxel art editor
- GoNorth - a web application used for planning the story and world of RPGs or other open world games.
- How To Make A Game In C++ & SDL2 From Scratch!
- Game Engine Tutorial - a lot of the code in this repo is inspired by this tutorial series.
- Networking in C++ Part #1: MMO Client/Server, ASIO & Framework Basics