matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
MainController.hpp
Go to the documentation of this file.
1
2#ifndef MAINCONTROLLER_HPP
3#define MAINCONTROLLER_HPP
4
5namespace engine::test::app {
7 public:
8 void on_key(engine::platform::Key key) override;
9
10 void on_mouse_move(engine::platform::MousePosition position) override;
11 };
12
14 void initialize() override;
15
16 bool loop() override;
17
18 void poll_events() override;
19
20 void update() override;
21
22 void begin_draw() override;
23
24 void draw() override;
25
26 void end_draw() override;
27
28 void draw_skybox();
29
30 void draw_backpack();
31
32 void update_camera();
33
34 float m_backpack_scale{1.0f};
35 bool m_draw_gui{false};
36 bool m_cursor_enabled{true};
37 };
38}
39#endif //MAINCONTROLLER_HPP
Controllers are a hook into the App main loop execution. By overriding virtual functions of this clas...
Definition Controller.hpp:42
Represents the state of the key in a given frame.
Definition Input.hpp:154
Platform events callback object. Extend this class and override the methods you want to be called by ...
Definition PlatformEventObserver.hpp:17
Definition MainController.hpp:13
bool loop() override
Checks whether the main loop should continue. Executes in the core::App::loop.
Definition MainController.cpp:26
void draw() override
Draw the world state. Executes in the core::App::draw.
Definition MainController.cpp:50
void update() override
Update the controller state and prepare for drawing. Executes in the core::App::update.
Definition MainController.cpp:42
float m_backpack_scale
Definition MainController.hpp:34
void draw_backpack()
Definition MainController.cpp:59
bool m_cursor_enabled
Definition MainController.hpp:36
void begin_draw() override
Perform preparation for drawing. Executes in the core::App::draw, before Controller::draw.
Definition MainController.cpp:46
void initialize() override
Initializes the controller. Executes in the core::App::initialize.
Definition MainController.cpp:17
void draw_skybox()
Definition MainController.cpp:70
bool m_draw_gui
Definition MainController.hpp:35
void update_camera()
Definition MainController.cpp:76
void poll_events() override
Process internal and external events. Executes in the core::App::poll_events.
Definition MainController.cpp:34
void end_draw() override
Finalize drawing. Executes in the core::App::draw, after Controller::draw.
Definition MainController.cpp:55
Definition MainController.hpp:6
void on_mouse_move(engine::platform::MousePosition position) override
Called by PlatformController for every frame in which the mouse moved.
Definition MainController.cpp:13
void on_key(engine::platform::Key key) override
Called by PlatformController for every frame in an event occured on the keyboard or mouse key.
Definition MainController.cpp:9
Definition GUIController.hpp:6
Represents mouse position in a given frame relative to the top left corner of the screen.
Definition Input.hpp:237