#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(fs::path fontPath); bool SetText(std::string text, Window *window); void Render(); void CloseFont() { TTF_CloseFont(loadedFont); } };