Phyzix
Loading...
Searching...
No Matches
Application.h
1//
2// Created by shams on 8/5/24.
3//
4
5#ifndef C0_APPLICATION_H
6#define C0_APPLICATION_H
7
8#include "app/engine/Scene.h"
9#include "app/engine/Camera.h"
10#include "os/os.h"
11#include "app/engine/StaticObject.h"
12#include "lcd_st7735/lcd.h"
13#include "app/lib/rtti.h"
14
15
21private:
22 static Scene * scene;
23 static Camera * camera;
25 Application() {
26 scene = nullptr;
27 camera = nullptr;
28 last_tick = Tick;
29 last_render_tick = 0;
30 };
31
32public:
33 static uint32_t last_tick;
34 static uint32_t last_render_tick;
35
36 RuntimeBaseType getBaseType() const override {
37 return RuntimeBaseType::APPLICATION;
38 }
39
40 static Application& getInstance() {
41 static Application instance; // Guaranteed to be destroyed.
42 // Instantiated on first use.
43 return instance;
44 }
45
46 Application(Application const&) = delete;
47 void operator = (Application const&) = delete;
48
52 [[noreturn]] static void update();
53
57 [[noreturn]] static void render();
58
62 [[noreturn]] static void game();
63};
64
65#endif //C0_APPLICATION_H
This class is the main class of the application, it is a singleton class that manages the game loop,...
Definition Application.h:20
static void update()
This function should run in a separate thread, be scheduled every small time increments to update dyn...
Definition Application.cpp:104
static void game()
This function should run in a separate thread, be scheduled whenever scene changes,...
Definition Application.cpp:175
static void render()
This function should run in a separate thread, be scheduled whenever display should show a new frame ...
Definition Application.cpp:118
Definition Camera.h:12
Base class for runtime type identification.
Definition rtti.h:38
Enum class to identify the base type of a class for runtime type identification.
Definition Scene.h:15