ST_engine  0.3-ALPHA
window_manager.hpp
1 /* This file is part of the "ST" project.
2  * You may use, distribute or modify this code under the terms
3  * of the GNU General Public License version 2.
4  * See LICENCE.txt in the root directory of the project.
5  *
6  * Author: Maxim Atanasov
7  * E-mail: maxim.atanasov@protonmail.com
8  */
9 
10 #ifndef WM_DEF
11 #define WM_DEF
12 
13 #include <string>
14 #include <message_bus.hpp>
15 #include <task_manager.hpp>
16 #include <SDL_surface.h>
17 #include <SDL_video.h>
18 
21 private:
22  SDL_Surface *icon{};
23  SDL_Window *window{};
24  SDL_DisplayMode DM{};
25  task_manager &gTask_manager;
26  message_bus &gMessage_bus;
27  int16_t height = 0;
28  int16_t width = 0;
29  subscriber msg_sub{};
30 
31  void set_fullscreen(bool arg);
32 
33  void handle_messages();
34 
35  void set_brightness(float arg);
36 
37  static void update_task(void *mngr);
38 
39 public:
40  window_manager(message_bus &gMessageBus, task_manager &gTask_manager, const std::string &window_name);
41 
43 
44  void update();
45 
46  SDL_Window *get_window();
47 };
48 
49 #endif //WM_DEF
The central messaging system of the engine. All subsystem make extensive use of it.
Definition: message_bus.hpp:29
This class handles a small queue for messages.
Definition: subscriber.hpp:20
The Task Manager handles all things multi-threaded in the engine.
This object is responsible for managing the window.
SDL_Window * get_window()
window_manager(message_bus &gMessageBus, task_manager &gTask_manager, const std::string &window_name)