protegon is a fast, modular 2D game engine written in C++20, using OpenGL for rendering and SDL2 for input, audio, and font support. Designed for flexibility and performance, it gives you full control over your game while providing helpful abstractions to get you started quickly.
- 🔺 Custom Batch Renderer — Efficient rendering with minimal draw calls.
- ✨ Shader Support — Easily integrate and manage GLSL shaders.
- 🎬 Scene & Camera System — Organize your game logic into manageable scenes with camera control.
- 🧱 Entity Component System — Lightweight ECS for scalable gameplay architecture.
- 🔊 Audio Support — Music and sound playback using SDL_mixer.
- 🖱️ Input Handling — Mouse and keyboard input built in.
- 🧮 Math Library — Vectors, matrices, quaternions, and more.
- 🧲 Collision Detection — Built-in physics utilities for 2D collisions.
- 🎛️ UI Elements — Basic UI widgets like buttons.
- 🕒 Timers & Tweens — Time-based animations and smooth transitions.
- 🎲 Randomness & Noise — Fractal noise and RNG utilities.
- 📦 Resource Managers — Manage textures, fonts, shaders, and more.
- 🧪 Debug Tools — Function profiling, performance logging, and development helpers.
- C++20 or newer
- CMake 3.20+
- A C++ compiler + build system (Visual Studio, Ninja, Make, etc.)
Clone or add protegon as a submodule:
git clone https://github.com/yourusername/protegon.git
# or
git submodule add https://github.com/yourusername/protegon.git Then, in your CMakeLists.txt:
add_subdirectory(<repository_directory> binary_dir)
add_protegon_to(<target_name>)
# (optional) create symlink to resources folder
create_resource_symlink(<target_name> <source_parent_dir> <destination_parent_dir> <directory_name>) -
Clone the repository:
git clone https://github.com/yourusername/protegon.git && cd protegon -
Create and enter a build directory:
mkdir build
cd build cmake .. -G "Visual Studio 17 2022" Open the generated .sln, set your project as the startup project, then Build & Run.
cmake .. -G Ninja
ninja
./your_project_name.exe cmake .. -G Xcode
make
./your_project_name.exe cmake .. -G "Unix Makefiles"
make
./your_project_name.exe 💡 Tip: On Linux, you may need to install
Homebrewor development packages for SDL2 and OpenGL.
Verify setup:
emcc --version
ninja --version # or gcc --version | Script | Description |
|---|---|
./build-emscripten.sh |
Builds WebGL version (HTML, WASM) |
./run-emscripten.sh |
Serves locally via emrun |
./build-run-emscripten.sh |
Combines build and run |
./zip-for-itch.sh |
Creates .zip for Itch.io uploads |
./build-itch.sh |
Builds and zips for Itch.io |
If you see:
- If you get the error
A required privilege is not held by the clientwhen creating a symlink usingcreate_resource_symlinkon Windows, turn on Developer mode.