diff options
author | heavydemon21 <48092678+heavydemon21@users.noreply.github.com> | 2024-12-19 16:24:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-19 16:24:53 +0100 |
commit | c737b01035cb62712b1dabcfef6f5014bdc882d1 (patch) | |
tree | 74c84fbf6715a4a47154d79e3c8df2c312eca1d4 /src/crepe/facade/SDLContext.h | |
parent | 794efc4ef7a44b190a4d9ecc2dd84a66c62ab005 (diff) | |
parent | 1b98253b58a077618aabcf9dfe073495b8db8d4f (diff) |
Merge pull request #86 from lonkaars/niels/UI
Text rendering
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r-- | src/crepe/facade/SDLContext.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index b687f87..e570073 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -12,18 +12,21 @@ #include <unordered_map> #include "../types.h" +#include "EventData.h" #include "api/Camera.h" #include "api/Color.h" #include "api/KeyCodes.h" #include "api/Sprite.h" #include "api/Transform.h" -#include "types.h" #include "EventData.h" #include "FontFacade.h" +#include "types.h" namespace crepe { class Texture; +class Text; +class Font; class Mediator; /** @@ -71,12 +74,11 @@ public: const double & scale; }; -public: - /** - * \brief Gets the singleton instance of SDLContext. - * \return Reference to the SDLContext instance. - */ - static SDLContext & get_instance(); + struct RenderText { + const Text & text; + const Font & font; + const Transform & transform; + }; public: SDLContext(const SDLContext &) = delete; @@ -186,6 +188,13 @@ public: */ void draw(const RenderContext & ctx); + /** + * \brief draws a text to the screen + * + * \param data Reference to the rendering data needed to draw + */ + void draw_text(const RenderText & data); + //! Clears the screen, preparing for a new frame. void clear_screen(); |