#include "FlatShader.h"
#include "Runtime.h"

FlatShader::FlatShader()
{
    std::string v_path = Runtime::find(Runtime::SHADER, "flat.v");
    std::string f_path = Runtime::find(Runtime::SHADER, "flat.f");

    m_program = glcxx::Program::create(
            glcxx::Shader::create_from_file(GL_VERTEX_SHADER, v_path.c_str()),
            glcxx::Shader::create_from_file(GL_FRAGMENT_SHADER, f_path.c_str()),
            "coords", 0);

    m_uniforms.viewport_size = m_program->get_uniform_location("viewport_size");
    m_uniforms.position = m_program->get_uniform_location("position");
    m_uniforms.color = m_program->get_uniform_location("color");
}
