2026-10-20 16:22:10 +02:00
2026-10-20 16:22:10 +02:00
2026-10-20 16:22:10 +02:00
2026-10-20 16:22:10 +02:00
2026-10-20 16:22:10 +02:00
2026-10-18 21:41:15 +02:00
2026-10-04 20:47:34 +02:00
IDK
2026-10-14 22:31:56 +02:00
2026-10-19 12:49:30 +02:00
2026-10-05 11:33:57 +02:00

MyEngine

A C++20 game engine project built with CMake and OpenGL.

Requirements

Ubuntu with the following packages installed:

  • CMake >= 3.20
  • GCC / G++
  • Make or Ninja
  • OpenGL development libraries
  • GLFW3
  • GLM
  • spdlog
  • fmt

Install the dependencies with:

sudo apt update

sudo apt install \
    build-essential \
    cmake \
    ninja-build \
    libglfw3-dev \
    libglm-dev \
    libspdlog-dev \
    libfmt-dev \
    libgl1-mesa-dev \
    libimgui-dev

Building

Clone the repository and enter the project directory:

git clone <repository-url>
cd DeerithEngine

Create a separate build directory:

cmake -S . -B build -G Ninja

Build the project:

cmake --build build

The project uses C++20.

Running

After a successful build, run the sandbox application with:

./build/sandbox/Sandbox

If the executable is generated in a different location depending on the CMake configuration, you can find it with:

find build -type f -executable -name "Sandbox"

Then execute the resulting path.

Project Structure

MyEngine/
├── CMakeLists.txt
│
├── deerith_engine_core/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── deerith/
│   └── src/
│
├── deerith_engine_client/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── deerith/
│   ├── src/
│   └── shaders/
│
├── sandbox/
│   ├── CMakeLists.txt
│   └── src/
│       └── main.cpp
│
└── build/

The build/ directory is generated by CMake and should not be committed to Git.

CMake Targets

DeerithCore

DeerithCore is the engine's core library.

Dependencies:

  • spdlog
  • fmt

It exposes its headers through:

deerith_engine_core/include

DeerithClient

DeerithClient contains the graphics/client-side engine functionality.

Dependencies:

  • DeerithCore
  • OpenGL
  • GLFW
  • GLM

It also copies the engine shaders into the build directory automatically.

Sandbox

Sandbox is the executable used to test and develop the engine.

It links against:

DeerithClient

Shader Files

Shaders are located in:

deerith_engine_client/shaders/

CMake automatically copies them to the corresponding build directory:

build/deerith_engine_client/shaders/

This is done by the DeerithClientShaders custom target.

Clean Build

To completely remove the generated build files:

rm -rf build

Then configure and build again:

cmake -S . -B build -G Ninja
cmake --build build

Debug Build

For a Debug build:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Run the application:

./build/sandbox/Sandbox

Release Build

For a Release build:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build

Development

When adding new .cpp files to the engine, CMake automatically detects them through GLOB_RECURSE with CONFIGURE_DEPENDS.

After adding or removing source files, rebuild normally:

cmake --build build

If CMake does not detect a project configuration change correctly, reconfigure:

cmake -S . -B build -G Ninja
Description
No description provided
Readme 914 KiB
Languages
C++ 57.6%
C 42%
CMake 0.2%
GLSL 0.2%