13 #include <key_definitions.hpp>
14 #include <key_event.hpp>
15 #include <message_bus.hpp>
16 #include <task_manager.hpp>
17 #include <SDL_events.h>
18 #include <SDL_haptic.h>
24 struct controller_analog_inputs {
25 int16_t left_trigger = 0;
26 int16_t right_trigger = 0;
27 int16_t right_stick_vertical = 0;
28 int16_t right_stick_horizontal = 0;
29 int16_t left_stick_vertical = 0;
30 int16_t left_stick_horizontal = 0;
33 struct button_and_mouse_controls {
34 int32_t mouse_x = 0, mouse_y = 0;
35 int16_t mouse_scroll = 0;
38 bool *keyboard_sdl_raw{};
40 uint32_t v_width = 1, v_height = 1;
41 uint32_t r_width = 1, r_height = 1;
43 float ratio_w = 1, ratio_h = 1;
45 int16_t left_stick_horizontal_threshold = 0;
46 int16_t left_stick_vertical_threshold = 0;
48 int16_t right_stick_horizontal_threshold = 0;
49 int16_t right_stick_vertical_threshold = 0;
51 int16_t left_trigger_threshold = 0;
52 int16_t right_trigger_threshold = 0;
59 std::vector<SDL_GameController *> controllers;
60 std::vector<SDL_Haptic *> controllers_haptic;
61 struct button_and_mouse_controls controls{};
62 struct button_and_mouse_controls controls_prev_frame;
63 struct controller_analog_inputs controller_analog_inputs;
64 struct controller_analog_inputs controller_analog_inputs_prev_frame;
67 ska::bytell_hash_map<ST::key, uint8_t> registered_keys;
70 std::string composition;
71 bool text_input =
false;
73 bool key_event(ST::key, ST::key_event k_event)
const;
75 void handle_messages();
79 void take_controller_input();
81 void take_mouse_input();
84 static void update_task(
void* mngr);
The central messaging system of the engine. All subsystem make extensive use of it.
This class handles a small queue for messages.
The Task Manager handles all things multi-threaded in the engine.