#pragma once

#include <unordered_map>
#include <memory>

class DrawingContext;
class OpenGlFontTexture;
class OpenGlShaderProgram;

class TextData;
class SceneText;

class OpenGlTextPainter
{
public:
    OpenGlTextPainter();

    void paint(SceneText* text, DrawingContext* context);

private:
    void initializeShader();
    void initializeTextures(const TextData& textData, DrawingContext* context);

    void initializeBuffers();

    unsigned mVertexBuffer{0};
    unsigned mVertexArray{0};
    std::unique_ptr<OpenGlShaderProgram> mShaderProgram;
    std::unordered_map<char, std::unique_ptr<OpenGlFontTexture> > mFontTextures;
};
