Skip to content

Commit

Permalink
GameEngine.h:
Browse files Browse the repository at this point in the history
* Added two new event functions:
  - on_enter_game_loop().
  - on_exit_game_loop().
  • Loading branch information
razterizer committed Nov 15, 2024
1 parent 5392574 commit bd48d83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GameEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class GameEngine
virtual void on_quit() {}
virtual void on_exit_title() {}
virtual void on_exit_instructions() {}
virtual void on_enter_game_loop() {}
virtual void on_exit_game_loop() {}
virtual void on_enter_game_over() {}
virtual void on_exit_game_over() {}
virtual void on_enter_you_won() {}
Expand Down Expand Up @@ -285,8 +287,10 @@ class GameEngine

// RT-Loop
clear_screen();
on_enter_game_loop();
auto update_func = std::bind(&GameEngine::engine_update, this);
Delay::update_loop(real_fps, update_func);
on_exit_game_loop();
}

float get_real_fps() const { return real_fps; }
Expand Down

0 comments on commit bd48d83

Please sign in to comment.