#ifndef TEXTSHADER_H
#define TEXTSHADER_H

#include "glcxx.hpp"
#include <memory>

class TextShader
{
public:
    TextShader();

    void use() { m_program->use(); }

    void set_viewport_size(int width, int height)
    {
        glUniform2i(m_uniforms.viewport_size, width, height);
    }

    void set_texture(int texture)
    {
        glUniform1i(m_uniforms.texture, texture);
    }

    void set_color(float r, float g, float b, float a)
    {
        glUniform4f(m_uniforms.color, r, g, b, a);
    }

    void set_position(int x, int y)
    {
        glUniform2i(m_uniforms.position, x, y);
    }

protected:
    std::shared_ptr<glcxx::Program> m_program;

    struct
    {
        GLint viewport_size;
        GLint texture;
        GLint color;
        GLint position;
    } m_uniforms;
};

#endif
