Skip to content
monjarisPublic

About

Modern cross-platform game/graphics framework written in C++23

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Repository files navigation

vexa

Modern C++23 graphics/multimedia framework on top of SDL3.

Windowing, events, 2D/3D rendering, timing. Opinionated API, low boilerplate.

Requirements

  • C++23 compiler (clang/gcc)

  • xmake

  • CMake + Ninja (used only to build vendored code)

  • thats all!

Build

./build.sh dev          # debug
./build.sh              # release

SDL3 is compiled from vendor/SDL3 into a static library and linked into libvexa.so. You do not need a system SDL3 package.

Minimal example

#include <vexa/vexa.hpp>

using namespace vexa;

int main()
{
    // Initialize Vexa
    initCores(Core::VIDEO);

    // create a window with 1280x720 size and default renderer
    auto window = Window{}
        .setSize({1280, 720})
        .setRenderer({})
        .create();

    auto& gfx = window.renderer();

    bool running = true;
    while (running)
    {
        while (auto event = Event::Poll()) {
            switch (event->type()) {
                case Event::QUIT: { running = false; break; }
                default: {}
            }
        }

        gfx.start(Color::BLACK);

        gfx.rectFill(Rect{480, 200, 320, 320}, Color::CYAN);

        gfx.finish();
        time::sleep(time::Millis(16.67));
    }

}

Creating examples for vexa

  1. clone this repo
  2. find examples.lua file
  3. add your own example name to the examples list
  4. go to examples/ directory and copy-paste _example_template_.cpp
  5. change file name to <name-added-to-list>.cpp
  6. fill example header, code an example

note: If you want to publish, fork the repo and do the same steps then make a PR, i will accept it!

Layout

  • include/vexa/ public headers
  • src/ sources files
  • vendor/ vendored code
  • scripts/ xmake related scripts

License (MIT)

See License.

If you use this project, a mention or credit would be greatly appreciated (but is not required beyond the license terms).

About

Modern cross-platform game/graphics framework written in C++23

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages