2025-10-04 12:22:21 +02:00
2025-09-30 16:12:38 +02:00
2025-09-30 16:12:38 +02:00
2025-09-30 16:12:38 +02:00
2025-10-04 12:22:21 +02:00
2025-10-04 12:22:21 +02:00
2025-10-02 17:32:57 +02:00
2025-10-04 12:22:13 +02:00
2025-10-02 17:06:06 +02:00

Project Description

This is a basic future game engine for OpenGL 3D rendered games

Building on Windows

In order to configure and run project on windows platform accomplish several steps.

Configuring

cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Release

Building

cmake --build build --config Release

Static Linking

For static linking you just need to modify the configure command as follows:

cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Release

Multi-GPU Devices

If you want to use non-primary GPU on your device when launching the game specifically on Linux you should specify additional environment variables before running. For example in my case I have a hybrid gaming laptop with 2 GPUs AMD from CPU and NVIDIA discrete.

The run command in that case would look following:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./build/CodingGame

TODO List

Optimizations

🚀 Summary of Speedups

  • Replace toElement / toMtlElement string comparisons with char-based switches.
  • Replace std::stoi with a custom fast Parser::TakeIndex.
  • Pre-reserve vectors for vertices, normals, texcoords, meshes.
  • Load whole file into memory before parsing (fastest for large OBJs).
  • Defer texture loading until after parsing.
  • Store material pointers in meshes → no runtime lookups in render.
  • Inline parsing functions.
Description
OpenGL + SDL3 based 3D game
Readme 234 MiB
Languages
C 77.9%
C++ 18.6%
GLSL 2.1%
CMake 1.4%