refactor a bit into pxl8 sys struct
This commit is contained in:
parent
b2682a2d40
commit
f19b06d705
10 changed files with 217 additions and 148 deletions
|
|
@ -1,22 +1,11 @@
|
|||
#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;
|
||||
|
|
@ -31,25 +20,12 @@ typedef struct pxl8_game {
|
|||
i32 fps_frame_count;
|
||||
f32 fps;
|
||||
|
||||
pxl8_input_state input;
|
||||
pxl8_script_repl* repl;
|
||||
|
||||
bool repl_mode;
|
||||
bool repl_started;
|
||||
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);
|
||||
f32 pxl8_game_get_fps(const pxl8_game* game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue