/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* text_manager.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/06 16:24:11 by maldavid #+# #+# */ /* Updated: 2024/01/16 09:04:05 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __MLX_TEXT_MANAGER__ #define __MLX_TEXT_MANAGER__ #include #include #include #include #include #include #include #include #include #include namespace mlx { class TextManager { public: TextManager() = default; void init(Renderer& renderer) noexcept; std::pair registerText(int x, int y, uint32_t color, std::string str); inline void clear() { _text_descriptors.clear(); /*TextLibrary::get().clearLibrary();*/ } void loadFont(Renderer& renderer, const std::filesystem::path& filepath, float scale); void destroy() noexcept; ~TextManager() = default; private: std::unordered_set _text_descriptors; std::vector _font_set; Font* _font_in_use = nullptr; }; } #endif