19 lines
717 B
C++
19 lines
717 B
C++
#include "RectShader.h"
|
|
#include "Runtime.h"
|
|
|
|
RectShader::RectShader()
|
|
{
|
|
std::string v_path = Runtime::find(Runtime::SHADER, "rect.v");
|
|
std::string f_path = Runtime::find(Runtime::SHADER, "rect.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.color = m_program->get_uniform_location("color");
|
|
m_uniforms.position = m_program->get_uniform_location("position");
|
|
m_uniforms.size = m_program->get_uniform_location("size");
|
|
}
|