Nimbin[12]?SDL & Graphics / SDL_Game_CPP / src/game/game_state.hpp

SDL_Game_CPP git · main

SDL game in C++

sdl game c++ · first commit 2026-03-24 · last commit 2026-03-24 (8 months ago) · synced 1 hour ago · upstream: codeberg.org/Studying_at_HsNR/SDL_Game_CPP

C++ 99.3%
git clone https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP.gitwget https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP/archive/SDL_Game_CPP.tar.gz
src/game/game_state.hpp 623 B · 30 lines raw
#pragma once

#include <SDL3/SDL.h>
#include <SDL3/SDL_mouse.h>

#include "audio/audio.hpp"
#include "cursor/animated_cursor.hpp"

class Game;
class Input;

enum class GameState_e {
    STATE_MODIFY,
    STATE_PLAYING,
    STATE_MENU_MAIN
};

class GameState {
public:
    virtual ~GameState() = default;
    virtual bool Init(Game*) = 0;
    virtual void handle_Events(SDL_Event&, Game*) = 0;
    virtual void Update(Game*) = 0;
    virtual void Render(Game*) = 0;
    bool is_Finished() const { return finished; }
protected:
    Audio* audio = nullptr;
    AnimatedCursor* cursor = nullptr;
    bool finished = false;
};