Skip to content

CanReader/SleakEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

153 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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: InitializeOnEnableUpdate / FixedUpdate / LateUpdateOnDisableOnDestroy
  • 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>)

Templates

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

Using SleakEngine in Your Project

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 --recursive

Then 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.

Building Standalone

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 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 Windowing, input, platform abstraction
glm Mathematics
spdlog / fmt Logging
Dear ImGui Debug UI
nlohmann/json JSON serialization
yaml-cpp YAML configuration
glad 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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors