first commit

This commit is contained in:
saarsena@gmail.com 2026-04-02 03:41:50 -04:00
commit 5c7d1905a9
25 changed files with 4034 additions and 0 deletions

52
include/game.hpp Normal file
View file

@ -0,0 +1,52 @@
/**
* @file game.hpp
* @brief Main game state and context
*/
#pragma once
#include <SDL3/SDL.h>
#include <flecs.h>
struct WindowConfig {
const char *title = "RIDGE RACER 37";
int width = 1280;
int height = 720;
SDL_WindowFlags flags = 0;
};
struct PipelineState;
/**
* @brief Game context containing all core resources
*/
struct GameContext {
// SDL Resources
SDL_Window *window = nullptr;
SDL_Renderer *renderer = nullptr;
// FLECS World (C++ wrapper)
flecs::world ecs;
// Timing
uint64_t last_time = 0;
float delta_time = 0.0f;
// State
bool running = true;
bool paused = false;
// Window info
int window_width = 0;
int window_height = 0;
// Pipeline visualization
PipelineState *pipeline = nullptr;
};
bool game_init(GameContext &ctx, const WindowConfig &config);
void game_shutdown(GameContext &ctx);
void game_process_events(GameContext &ctx);
void game_update(GameContext &ctx);
void game_render(GameContext &ctx);
bool game_loop(GameContext &ctx);