Nimbin[12]?SDL & Graphics / sdl_runtime_compiler / src/core/game.hpp

sdl_runtime_compiler git · main

SDL3 game for running and compiling code at runtime

sdl3 c++ compiler dlopen cmake · first commit 2026-04-19 · last commit 2026-07-03 (3 months ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-runtime-compiler

C++ 72.3% C 26.2%
git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gz
src/core/game.hpp 601 B · 32 lines raw
#pragma once

#include <SDL3/SDL.h>
#include <cpputils/unique_ptr.hpp>
#include <memory>

#include "rendering/gl_renderer.hpp"
#include "states/istate.hpp"
#include "utils/globals.hpp"

namespace
Nimbin
{

class Game
{
    GlRendererPtr _gl_renderer{};
    cpputils::unique_ptr<IState>
                  _state;
    SDL_Window*   _window     {};
public:
    ~Game();

    void change_State (cpputils::unique_ptr<IState> next);
    void handle_Event (const SDL_Event& event);
    bool init     ();
    void update   (double dt_ns);
    void render   ();
    void shutdown ();
};

} // namespace Nimbin