#pragma once #include #include #include #include #include namespace scwx { namespace qt { namespace gl { enum class TextAlign { Left, Center, Right }; class TextShaderImpl; class TextShader { public: explicit TextShader(std::shared_ptr context); ~TextShader(); TextShader(const TextShader&) = delete; TextShader& operator=(const TextShader&) = delete; TextShader(TextShader&&) noexcept; TextShader& operator=(TextShader&&) noexcept; bool Initialize(); void RenderText(const std::string& text, float x, float y, float scale, const glm::mat4& projection, const boost::gil::rgba8_pixel_t& color, std::shared_ptr font, GLuint textureId, TextAlign align = TextAlign::Left); void SetProjection(const glm::mat4& projection); private: std::unique_ptr p; }; } // namespace gl } // namespace qt } // namespace scwx