diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 13:31:10 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 13:31:10 +0100 |
commit | 1a81eab8c0c4c0b6f7102ebceb68f259cfc595bb (patch) | |
tree | f3d62919e49cf154ff7e2a21606379b3db626440 /src/crepe/facade/SDLContext.h | |
parent | 1d182abe4278b6bf4410cb25a9ae41f501833990 (diff) | |
parent | 81404db80bbf9463c3d535ae389e7fbb753a902c (diff) |
Merge branch 'master' into loek/scripts
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r-- | src/crepe/facade/SDLContext.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index 8f4760e..b687f87 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -17,8 +17,10 @@ #include "api/KeyCodes.h" #include "api/Sprite.h" #include "api/Transform.h" +#include "types.h" #include "EventData.h" +#include "FontFacade.h" namespace crepe { class Texture; @@ -242,10 +244,24 @@ private: CameraAuxiliaryData cam_aux_data; private: + //! instance of the font_facade + FontFacade font_facade{}; + +public: + /** + * \brief Function to Get asset from font_family + * + * This function uses the FontFacade function to convert a font_family to an asset. + * + * \param font_family name of the font style that needs to be used (will return an asset with default font path of the font_family doesnt exist) + * + * \return asset with the font style absolute path + */ + Asset get_font_from_name(const std::string & font_family); //! variable to store the state of each key (true = pressed, false = not pressed) keyboard_state_t keyboard_state; //! lookup table for converting SDL_SCANCODES to Keycodes - const std::unordered_map<SDL_Scancode, Keycode> LOOKUP_TABLE + const std::unordered_map<SDL_Scancode, Keycode> lookup_table = {{SDL_SCANCODE_SPACE, Keycode::SPACE}, {SDL_SCANCODE_APOSTROPHE, Keycode::APOSTROPHE}, {SDL_SCANCODE_COMMA, Keycode::COMMA}, |