sdl3_3d_oop_basic_game git · main
SDL3 3D OOP basic game (entities, systems, CMake)
C++ 99%git clone https://git.christianimmanuel.de/sdl-graphics/sdl3_3d_oop_basic_game.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl3_3d_oop_basic_game/archive/sdl3_3d_oop_basic_game.tar.gzsrc/core/game.hpp raw
#pragma once
#include <SDL3/SDL.h>
#include "systems/input_system.hpp"
#include "systems/physics_system.hpp"
#include "entities/world.hpp"
#include "entities/player.hpp"
struct AppState {
SDL_Window* window{};
SDL_Renderer* renderer{};
Player player{};
PlayerInputState input{};
Camera camera{};
World world{};
double accumulator{};
double alpha{};
};
class Game {
public:
bool init();
void handleEvent(const SDL_Event& event);
void update(double dt_ns);
void render();
AppState& state();
void shutdown();
private:
AppState m_state{};
InputSystem m_input;
PhysicsSystem m_physics;
};