diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-11-25 06:21:26 +0100 |
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-11-25 06:21:26 +0100 |
| commit | 3f95bc6b463f629c620ba5811ca3ce53ed9c03a2 (patch) | |
| tree | 8e2637270472b3ff787f95b24c9567d0c4d3df2b /src/renderer/Renderer.hpp | |
| parent | 746819470de51c4f7331b64980f3da9bfb750a12 (diff) | |
add MemoryManager, enhance cmake,compile.sh
Diffstat (limited to 'src/renderer/Renderer.hpp')
| -rw-r--r-- | src/renderer/Renderer.hpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/renderer/Renderer.hpp b/src/renderer/Renderer.hpp index da57e29..8981826 100644 --- a/src/renderer/Renderer.hpp +++ b/src/renderer/Renderer.hpp @@ -1,8 +1,10 @@ #pragma once +#include <games/Game.hpp> #include <common/math.hpp> #include <common/Font.hpp> #include <common/shapes.hpp> +#include <common/MemoryManager.hpp> #include <SDL3/SDL.h> #include <SDL3/SDL_video.h> @@ -45,9 +47,9 @@ struct REntity_Circle { Color color; }; -struct REntity_Text { +struct REntity_String32 { REntityType type; - std::u32string& text; + String32Id id; Font& font; V2F32 pos; Color color; @@ -59,10 +61,10 @@ union REntity { REntity_AlphaBitmap bitmap; REntity_Rectangle rect; REntity_Circle circle; - REntity_Text text; + REntity_String32 string32; }; -struct RZBuffEntry { +struct RSortEntry { uint32_t z; uint32_t entity_index; }; @@ -85,7 +87,7 @@ public: void PushAlphaBitmap(AlphaBitmap& bitmap, V2F32 pos, Color color, uint32_t z); void PushRectangle(Rectangle rect, Color color, uint32_t z); void PushCircle(Circle circle, Color color, uint32_t z); - void PushText(std::u32string& text, Font& font, V2F32 pos, Color color, uint32_t z); + void PushString32(String32Id id, Font& font, V2F32 pos, Color color, uint32_t z); /* helper functions */ @@ -108,7 +110,7 @@ public: Color m_clear_color {}; std::vector<REntity> m_render_entities; - std::vector<RZBuffEntry> m_z_buff; + std::vector<RSortEntry> m_sort_entries; std::unique_ptr<RSoftwareBackend> m_backend; friend class RSoftwareBackend; |
