Open-source 3D game engine library built with C++23
Multi-backend rendering • Component-based ECS • Cross-platform
SleakEngine is the core engine library for building 3D applications. This repository contains only the engine itself — rendering, ECS, input, math, scene management, and all vendored dependencies.
To create a game project, use the SleakEngine-Empty starter template, which pulls this repo in as a git submodule.
Rendering
- Four graphics backends behind a single abstract interface — DirectX 11, DirectX 12, OpenGL, Vulkan
- Factory-pattern renderer selection at runtime
- Deferred command queue for batched, order-independent draw submission
Entity-Component System
- GameObjects composed of pluggable Components (Transform, Mesh, Material, Camera, and custom)
- Full component lifecycle:
Initialize→OnEnable→Update/FixedUpdate/LateUpdate→OnDisable→OnDestroy - Parent-child hierarchies with recursive transforms
- Tag-based object queries and deferred destruction safe for use during update loops
Scene Management
- State-driven scene lifecycle: Unloaded → Loading → Active → Paused → Unloading
- Scenes own their objects — automatic cleanup on unload
- Seamless scene switching with
SetActiveScene()
Engine Core
- Fixed timestep physics at 60 Hz, decoupled variable-rate rendering
- SDL3-based windowing and input across platforms
- spdlog-backed logging with severity macros (
SLEAK_LOG,SLEAK_WARN,SLEAK_ERROR,SLEAK_FATAL) - ImGui debug overlay with camera controls, performance metrics, and scene inspection
- Custom smart pointers (
RefPtr<T>,ObjectPtr<T>,WeakPtr<T>) and containers (List<T>,HashTable<K,V>,Queue<T>,Graph<T>)
Get started quickly with a project template:
| Template | Description | Status |
|---|---|---|
| Empty Template | Minimal starter with a blank scene | Available |
| First Person Template | First-person camera and movement | Coming soon |
| Third Person Template | Third-person camera and character controller | Coming soon |
| Top Down Template | Top-down camera and controls | Coming soon |
The recommended way is to add this repo as a git submodule:
git submodule add https://github.com/CanReader/SleakEngine.git Engine
git submodule update --init --recursiveThen in your root CMakeLists.txt:
add_subdirectory(Engine)Link against the Engine target from your game library.
Or use the SleakEngine-Empty template which has this all set up.
To build the engine library on its own:
git clone --recursive https://github.com/CanReader/SleakEngine.git
cd SleakEngine
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build buildSleakEngine/
└── Engine/
├── include/ Public & private headers
├── src/ Implementation
├── assets/shaders/ Default shaders
└── vendors/ All third-party dependencies
| Library | Purpose |
|---|---|
| SDL3 | Windowing, input, platform abstraction |
| glm | Mathematics |
| spdlog / fmt | Logging |
| Dear ImGui | Debug UI |
| nlohmann/json | JSON serialization |
| yaml-cpp | YAML configuration |
| glad | OpenGL loading |
Contributions are welcome. Fork the repository, create a feature branch, and open a pull request.
SleakEngine is released under the MIT License.
