An open API service indexing awesome lists of open source software.

https://github.com/canreader/sleakengine

Open source, modular 3D game engine built with C++23 supporting DirectX 11, DirectX 12, OpenGL, and Vulkan through a unified rendering interface. Features an ECS architecture, scene management, and cross-platform support.
https://github.com/canreader/sleakengine

3d-engine cmake cpp cross-platform directx entity-component-system game-engine graphics imgui opengl rendering-engine sdl3 vulkan

Last synced: about 1 month ago
JSON representation

Open source, modular 3D game engine built with C++23 supporting DirectX 11, DirectX 12, OpenGL, and Vulkan through a unified rendering interface. Features an ECS architecture, scene management, and cross-platform support.

Awesome Lists containing this project

README

          


SleakEngine

SleakEngine


Open-source 3D game engine library built with C++23


Multi-backend rendering • Component-based ECS • Cross-platform


Stars
License
C++23


DirectX 11
DirectX 12
OpenGL
Vulkan
Platform

---

## About

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](https://github.com/CanReader/SleakEngine-Empty)** starter template, which pulls this repo in as a git submodule.

## Features

**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`, `ObjectPtr`, `WeakPtr`) and containers (`List`, `HashTable`, `Queue`, `Graph`)

## Templates

Get started quickly with a project template:

| Template | Description | Status |
|---|---|---|
| [Empty Template](https://github.com/CanReader/SleakEngine-Empty) | 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 |

## Using SleakEngine in Your Project

The recommended way is to add this repo as a git submodule:

```bash
git submodule add https://github.com/CanReader/SleakEngine.git Engine
git submodule update --init --recursive
```

Then in your root `CMakeLists.txt`:

```cmake
add_subdirectory(Engine)
```

Link against the `Engine` target from your game library.

Or use the **[SleakEngine-Empty](https://github.com/CanReader/SleakEngine-Empty)** template which has this all set up.

## Building Standalone

To build the engine library on its own:

```bash
git clone --recursive https://github.com/CanReader/SleakEngine.git
cd SleakEngine
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
```

## Repository Structure

```
SleakEngine/
└── Engine/
├── include/ Public & private headers
├── src/ Implementation
├── assets/shaders/ Default shaders
└── vendors/ All third-party dependencies
```

## Vendored Dependencies

| Library | Purpose |
|---|---|
| [SDL3](https://www.libsdl.org/) | Windowing, input, platform abstraction |
| [glm](https://github.com/g-truc/glm) | Mathematics |
| [spdlog](https://github.com/gabime/spdlog) / [fmt](https://github.com/fmtlib/fmt) | Logging |
| [Dear ImGui](https://github.com/ocornut/imgui) | Debug UI |
| [nlohmann/json](https://github.com/nlohmann/json) | JSON serialization |
| [yaml-cpp](https://github.com/jbeder/yaml-cpp) | YAML configuration |
| [glad](https://glad.dav1d.de/) | OpenGL loading |

## Contributing

Contributions are welcome. Fork the repository, create a feature branch, and open a pull request.

## License

SleakEngine is released under the [MIT License](LICENSE).