Skip to content

codebycruz/qun

Repository files navigation

qun

This is an attempt to make a simple game engine / renderer using modern OpenGL (4.5) and C++ (23)

Why?

  • To finally properly learn OpenGL, instead of jumping straight into newer abstractions like wgpu
  • As an exercise in writing idiomatic, modern C++, as I mostly write Rust

Features

  • GLSL Shader Hotreloading
  • Dynamic entity manipulation making use of EnTT
  • Support for meshes with multiple materials
  • Obj and glTF file formats for asset imports
  • Heavy use of ECS paradigms (plugins, systems, resources)
  • Use of results (std::expected) over traditional C++ exceptions

Sample

sample

int main() {
  auto game = std::make_unique<Game>();
  game->addPlugin(DefaultPlugins());
  game->addPlugin(plugins::DebugCamController());
  game->addSystem(Schedule::Startup, scenes::test::startup);
  game->addSystem(Schedule::Update, scenes::test::update);

  auto result = game->start();
  if (!result.has_value()) {
    std::println(stderr, "Failed to start game: {}", result.error());
    return EXIT_FAILURE;
  }

  return EXIT_SUCCESS;
}

Building

  1. You must clone the repository with submodules, as some dependencies are submodules.
git clone https://github.com/codebycruz/qun --recurse-submodules
  1. Install extra dependencies with vcpkg install

  2. To build, configure with CMake and build with Ninja.

  3. Build with Ninja in the /release directory

  4. Run /release/qun with cwd as the /release directory

I recommend doing your configuration via your IDE, I use VSCode.

There are additionally automatic builds via Github Actions you can find here.

Troubleshooting

Error Solution
libdecor-gtk-WARNING: Failed to initialize GTK. Either run the program outside VSCode or force VSCode to use Wayland (code --enable-features=UseOzonePlatform --ozone-platform=wayland)

About

An ECS based renderer & game engine written in modern C++

Topics

Resources

License

Stars

Watchers

Forks