aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r--src/crepe/facade/SDLContext.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h
index 8f4760e..7c791f2 100644
--- a/src/crepe/facade/SDLContext.h
+++ b/src/crepe/facade/SDLContext.h
@@ -17,11 +17,14 @@
#include "api/KeyCodes.h"
#include "api/Sprite.h"
#include "api/Transform.h"
-
#include "EventData.h"
+#include "FontFacade.h"
+
namespace crepe {
class Texture;
+class Text;
+class Font;
class Mediator;
/**
@@ -69,6 +72,12 @@ public:
const double & scale;
};
+ struct RenderText {
+ const Text & text;
+ const Font & font;
+ const Transform & transform;
+ };
+
public:
/**
* \brief Gets the singleton instance of SDLContext.
@@ -184,6 +193,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();
@@ -344,6 +360,22 @@ private:
{SDL_SCANCODE_RALT, Keycode::RIGHT_ALT},
{SDL_SCANCODE_RGUI, Keycode::RIGHT_SUPER},
{SDL_SCANCODE_MENU, Keycode::MENU}};
+
+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);
};
} // namespace crepe