#pragma once #include #include #include #include #include #include #include "fileCommon.h" #include "window.h" #define WHITE {255, 255, 255, SDL_ALPHA_OPAQUE} class Text { private: std::string buffer; TTF_Font *loadedFont = nullptr; SDL_Surface *textRenderingSurface = nullptr; SDL_Color color = {}; SDL_Texture *font_texture = nullptr; /// ToDo: Replace with dynamic settings / loaded font fs::path fontPath; public: SDL_AppResult OpenFont(const fs::path &font); bool SetText(const std::string &text, const Window *win, SDL_FRect rect); void Render() const; void CloseFont() const { TTF_CloseFont(loadedFont); } };