Antkeeper
0.0.1
|
Input manager implementation using SDL2. More...
#include <sdl-input-manager.hpp>
Public Member Functions | |
sdl_input_manager () | |
Constructs an SDL input manager. More... | |
~sdl_input_manager () override | |
Destructs an SDL input manager. More... | |
void | update () override |
Processes input events. More... | |
void | set_cursor_visible (bool visible) override |
Shows or hides the cursor. More... | |
void | set_relative_mouse_mode (bool enabled) override |
Enables or disables relative mouse mode. More... | |
![]() | |
virtual | ~input_manager ()=default |
Destructs an input manager. More... | |
const std::unordered_set< input::gamepad * > & | get_gamepads () noexcept |
Returns the set of registered gamepads. More... | |
const std::unordered_set< input::keyboard * > & | get_keyboards () noexcept |
Returns the set of registered keyboards. More... | |
const std::unordered_set< input::mouse * > & | get_mice () noexcept |
Returns the set of registered mice. More... | |
const ::event::dispatcher & | get_event_dispatcher () const noexcept |
Returns the event dispatcher associated with registered input devices. More... | |
::event::dispatcher & | get_event_dispatcher () noexcept |
Returns the event dispatcher associated with registered input devices. More... | |
Additional Inherited Members | |
![]() | |
static std::unique_ptr< input_manager > | instance () |
Allocates and returns an input manager. More... | |
![]() | |
void | register_device (input::device &device) |
Registers an input device. More... | |
void | register_gamepad (input::gamepad &device) |
Registers an input device. More... | |
void | register_keyboard (input::keyboard &device) |
Registers an input device. More... | |
void | register_mouse (input::mouse &device) |
Registers an input device. More... | |
void | unregister_device (input::device &device) |
Unregisters an input device. More... | |
void | unregister_gamepad (input::gamepad &device) |
Unregisters an input device. More... | |
void | unregister_keyboard (input::keyboard &device) |
Unregisters an input device. More... | |
void | unregister_mouse (input::mouse &device) |
Unregisters an input device. More... | |
![]() | |
::event::dispatcher | m_event_dispatcher |
Input manager implementation using SDL2.
Definition at line 33 of file sdl-input-manager.hpp.
app::sdl_input_manager::sdl_input_manager | ( | ) |
Constructs an SDL input manager.
Definition at line 30 of file sdl-input-manager.cpp.
|
override |
Destructs an SDL input manager.
Definition at line 53 of file sdl-input-manager.cpp.
|
overridevirtual |
Shows or hides the cursor.
visible | true to show the cursor, false to hide it. |
Implements app::input_manager.
Definition at line 321 of file sdl-input-manager.cpp.
|
overridevirtual |
Enables or disables relative mouse mode.
enabled | true to enable relative mouse mode, false to disable it. |
Implements app::input_manager.
Definition at line 330 of file sdl-input-manager.cpp.
|
overridevirtual |
Processes input events.
Implements app::input_manager.
Definition at line 61 of file sdl-input-manager.cpp.