31 lines
493 B
C
31 lines
493 B
C
#pragma once
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
SDL_Event event;
|
|
bool is_running;
|
|
bool framebuffer_dirty;
|
|
SDL_Rect dirty_rect;
|
|
uint16_t width, height;
|
|
uint32_t *framebuffer;
|
|
} game_state_t;
|
|
|
|
extern game_state_t *game_state;
|
|
|
|
bool
|
|
engine_init(
|
|
uint32_t window_width,
|
|
uint32_t window_height,
|
|
const char window_name[],
|
|
void (*engine_poll_events)(void),
|
|
void (*engine_update_framebuffer)(void)
|
|
);
|
|
|
|
void
|
|
engine_start();
|
|
|
|
void
|
|
engine_stop(); |