refactor SDL out of core files
This commit is contained in:
parent
82ed6b4ea9
commit
9d183341ae
21 changed files with 1419 additions and 1028 deletions
49
src/pxl8_game.h
Normal file
49
src/pxl8_game.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
|
||||
#include "pxl8_cart.h"
|
||||
#include "pxl8_gfx.h"
|
||||
#include "pxl8_hal.h"
|
||||
#include "pxl8_script.h"
|
||||
#include "pxl8_types.h"
|
||||
#include "pxl8_ui.h"
|
||||
|
||||
typedef enum pxl8_game_result {
|
||||
PXL8_GAME_CONTINUE,
|
||||
PXL8_GAME_SUCCESS,
|
||||
PXL8_GAME_FAILURE
|
||||
} pxl8_game_result;
|
||||
|
||||
typedef struct pxl8_game {
|
||||
const pxl8_hal* hal;
|
||||
|
||||
pxl8_cart* cart;
|
||||
pxl8_color_mode color_mode;
|
||||
pxl8_gfx* gfx;
|
||||
pxl8_resolution resolution;
|
||||
pxl8_script* script;
|
||||
pxl8_ui* ui;
|
||||
|
||||
i32 frame_count;
|
||||
u64 last_time;
|
||||
f32 time;
|
||||
|
||||
bool repl_mode;
|
||||
bool running;
|
||||
bool script_loaded;
|
||||
char script_path[256];
|
||||
|
||||
pxl8_input_state input;
|
||||
pxl8_script_repl* repl;
|
||||
} pxl8_game;
|
||||
|
||||
typedef struct pxl8_game_callbacks {
|
||||
pxl8_game_result (*init)(pxl8_game* game, i32 argc, char* argv[]);
|
||||
pxl8_game_result (*update)(pxl8_game* game);
|
||||
pxl8_game_result (*frame)(pxl8_game* game);
|
||||
void (*quit)(pxl8_game* game);
|
||||
} pxl8_game_callbacks;
|
||||
|
||||
pxl8_game_result pxl8_init(pxl8_game* game, i32 argc, char* argv[]);
|
||||
pxl8_game_result pxl8_update(pxl8_game* game);
|
||||
pxl8_game_result pxl8_frame(pxl8_game* game);
|
||||
void pxl8_quit(pxl8_game* game);
|
||||
Loading…
Add table
Add a link
Reference in a new issue