aboutsummaryrefslogtreecommitdiff
path: root/src/renderer/Renderer.hpp
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-10-16 15:33:06 +0200
committerfschildt <florian.schildt@protonmail.com>2025-10-16 15:33:06 +0200
commita873df7a66dc1831cee4eae2d998abed88246268 (patch)
treec19cd079ce106e1431d64c34babf4ef59cf71723 /src/renderer/Renderer.hpp
parent9f2845b12135c32dde91e58afc1193d54333ec9f (diff)
renderer: introduce text rendering
Diffstat (limited to 'src/renderer/Renderer.hpp')
-rw-r--r--src/renderer/Renderer.hpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/renderer/Renderer.hpp b/src/renderer/Renderer.hpp
index b825681..515e1da 100644
--- a/src/renderer/Renderer.hpp
+++ b/src/renderer/Renderer.hpp
@@ -22,34 +22,44 @@ enum REntityType : int32_t {
REntityType_Rectangle,
REntityType_AlphaBitmap,
REntityType_Circle,
+ REntityType_Text,
};
+
struct REntity_AlphaBitmap {
REntityType type;
- V3F32 pos;
AlphaBitmap& bitmap;
+ V3F32 pos;
Color color;
};
struct REntity_Rectangle {
REntityType type;
Rectangle rect;
- float z;
Color color;
};
struct REntity_Circle {
REntityType type;
Circle circle;
- float z;
Color color;
};
+struct REntity_Text {
+ REntityType type;
+ std::u32string& text;
+ Font& font;
+ V3F32 pos;
+ Color color;
+};
+
+
union REntity {
REntityType type;
REntity_AlphaBitmap bitmap;
REntity_Rectangle rect;
REntity_Circle circle;
+ REntity_Text text;
};
struct RSortEntry {
@@ -69,9 +79,10 @@ public:
void Reset();
void Clear(Color color);
- void PushRectangle(Rectangle rect, float z, Color color);
void PushAlphaBitmap(AlphaBitmap& bitmap, V3F32 pos, Color color);
- void PushCircle(Circle circle, float z, Color color);
+ void PushRectangle(Rectangle rect, Color color, float z);
+ void PushCircle(Circle circle, Color color, float z);
+ void PushText(std::u32string& text, Font& font, V3F32 pos, Color color);
/* helper functions */
@@ -98,6 +109,8 @@ public:
public:
+ SDL_Window* m_window;
+
int32_t m_screen_w;
int32_t m_screen_h;