b494f68d0c
Now using GLFW3 instead of the custom window class. This library looks like it will make development much simpler and will make it so that I am less worried about my windows code breaking. Currently setup the http://antongerdelan.net/opengl/hellotriangle.html tutorial in the MySimpleScene. Will probably create another scene file to try to get the object oriented stuff working.
33 lines
484 B
C++
33 lines
484 B
C++
#include "ShaderProgram.h"
|
|
|
|
ShaderProgram::ShaderProgram()
|
|
{
|
|
m_program = glCreateProgram();
|
|
}
|
|
|
|
ShaderProgram::~ShaderProgram()
|
|
{
|
|
glDeleteProgram(m_program);
|
|
}
|
|
|
|
void ShaderProgram::attach_shader(const Shader& shader)
|
|
{
|
|
glAttachShader(m_program, shader.get_shader());
|
|
}
|
|
|
|
void ShaderProgram::link()
|
|
{
|
|
glLinkProgram(m_program);
|
|
// TODO: Error handling
|
|
}
|
|
|
|
void ShaderProgram::use() const
|
|
{
|
|
glUseProgram(m_program);
|
|
}
|
|
|
|
GLuint ShaderProgram::get_program() const
|
|
{
|
|
return m_program;
|
|
}
|