add fps util for pxl8 in lua
This commit is contained in:
parent
7dd32ec453
commit
5637fa18c8
9 changed files with 57 additions and 76 deletions
|
|
@ -119,6 +119,7 @@ pxl8_game_result pxl8_init(pxl8_game* game, i32 argc, char* argv[]) {
|
|||
pxl8_script_set_gfx(game->script, game->gfx);
|
||||
pxl8_script_set_input(game->script, &game->input);
|
||||
pxl8_script_set_ui(game->script, game->ui);
|
||||
pxl8_script_set_game(game->script, game);
|
||||
|
||||
if (game->script_path[0] != '\0') {
|
||||
pxl8_result result = pxl8_script_load_main(game->script, game->script_path);
|
||||
|
|
@ -307,3 +308,7 @@ void pxl8_quit(pxl8_game* game) {
|
|||
pxl8_script_destroy(game->script);
|
||||
if (game->ui) pxl8_ui_destroy(game->ui);
|
||||
}
|
||||
|
||||
f32 pxl8_game_get_fps(const pxl8_game* game) {
|
||||
return game ? game->fps : 0.0f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue