From 87c41870e7e66308ee0c74270e1f91f4943bd733 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 9 Dec 2024 13:46:45 +0100 Subject: testing window events --- src/crepe/facade/SDLContext.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src/crepe/facade/SDLContext.h') diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index 0f503f3..98be988 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -9,6 +9,7 @@ #include #include #include +#include #include "api/Camera.h" #include "api/Color.h" @@ -134,14 +135,14 @@ private: * \return Events that occurred since last call to `get_events()` */ std::vector get_events(); - /** - * \brief Fills event_list with triggered window events - * - * This method checks if any window events are triggered and adds them to the event_list. - * - */ - void handle_window_event(const SDL_WindowEvent& window_event, - std::vector& event_list); + // /** + // * \brief Fills event_list with triggered window events + // * + // * This method checks if any window events are triggered and adds them to the event_list. + // * + // */ + // void handle_window_event(const SDL_WindowEvent& window_event, + // std::vector& event_list); /** * \brief Converts an SDL key code to the custom Keycode type. * @@ -152,8 +153,19 @@ private: * \return The corresponding `Keycode` value or `Keycode::NONE` if the key is unrecognized. */ Keycode sdl_to_keycode(SDL_Keycode sdl_key); - static const std::array& get_lookup_table(); - std::array get_keyboard_state(); + /** + * \brief Retrieves the current state of the keyboard. + * + * This method returns the state of all keys on the keyboard, represented as a + * `std::array` of boolean values. Each element of the array corresponds to a + * specific key defined in the `Keycode` enum, and the value indicates whether + * the key is currently pressed (true) or not pressed (false). + * + * \return A `std::array` representing the state of + * each key on the keyboard, where `true` means the key is pressed, and + * `false` means it is not pressed. + */ + std::array get_keyboard_state(); /** * \brief Converts an SDL mouse button code to the custom MouseButton type. * -- cgit v1.2.3