10 #include <main/main.hpp>
11 #include "metrics.hpp"
23 int main(
int argc,
char *argv[]) {
24 #elif defined(TESTING)
25 int ST_engine_main(
int argc,
char *argv[]) {
40 gConsole.set_log_level(ST::log_type::INFO | ST::log_type::SUCCESS | ST::log_type::ERROR);
46 window_manager gDisplay_manager(gMessage_bus, gTask_manager,
"ST");
47 drawing_manager gDrawing_manager(gDisplay_manager.get_window(), gMessage_bus);
54 gGame_manager.update();
58 const double LOGIC_UPDATE_RATE = 16.66666;
59 double total_time = 0;
66 gDisplay_manager.update();
69 while (gGame_manager.game_is_running()) {
71 frame_time = new_time - current_time;
72 current_time = new_time;
73 total_time += frame_time;
75 gMetrics.reset_accumulators();
77 if (total_time >= LOGIC_UPDATE_RATE) {
79 gInput_manager.update();
83 gGame_manager.update();
85 gMetrics.game_logic_time += game_logic_end - game_logic_begin;
88 gPhysics_manager.update(*gGame_manager.get_level());
90 gMetrics.physics_time += physics_end - physics_begin;
92 total_time -= LOGIC_UPDATE_RATE;
93 }
while (total_time >= LOGIC_UPDATE_RATE);
95 gAssets_manager.update();
96 gDisplay_manager.update();
97 gAudio_manager.update();
100 gFps.
update(current_time, frame_time);
102 gMetrics.frame_time = frame_time;
105 gDrawing_manager.update(*gGame_manager.get_level(), gFps.
get_value(), gConsole, gMetrics);
107 gMetrics.render_time = render_end - render_begin;
This object is responsible for loading/unloading assets.
static void update_task(void *arg)
This object is responsible for playing sounds and music.
This object represents the console window.
This object is responsible for issuing drawing commands and drawing the current level.
void update(double time, double frame_time)
This class is responsible for managing all levels and the lua backend, it is the heart of the engine.
The central messaging system of the engine. All subsystem make extensive use of it.
This class handles all physics related actions in the engine.
The Task Manager handles all things multi-threaded in the engine.
A timer used for keeping track of time in the main loop.
double time_since_start() const
This object is responsible for managing the window.