/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* text.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:09:04 by maldavid #+# #+# */ /* Updated: 2024/01/18 09:37:42 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __MLX_TEXT__ #define __MLX_TEXT__ #include #include #include #include #include #include namespace mlx { class Text { public: Text() = default; void init(std::string text, FontID font, std::vector vbo_data, std::vector ibo_data); void bind(class Renderer& renderer) noexcept; inline FontID getFontInUse() const noexcept { return _font; } void updateVertexData(int frame, std::vector vbo_data); inline uint32_t getIBOsize() noexcept { return _ibo.getSize(); } inline const std::string& getText() const { return _text; } void destroy() noexcept; ~Text() = default; private: std::array _vbo; C_IBO _ibo; std::string _text; FontID _font = nullfont; }; } #endif