#ifndef RECTSHADER_H
#define RECTSHADER_H

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

class RectShader
{
public:
    RectShader();

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

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

    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);
    }

    void set_size(int x, int y)
    {
        glUniform2i(m_uniforms.size, x, y);
    }

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

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

#endif
