massive rewrite
This commit is contained in:
parent
4c1c151422
commit
5811d3676a
18 changed files with 442 additions and 151 deletions
|
@ -11,7 +11,7 @@ inline
|
|||
namespace lol
|
||||
{
|
||||
|
||||
UniqueShader::UniqueShader(const std::string& vertexShader, const std::string& fragmentShader) :
|
||||
Shader::Shader(const std::string& vertexShader, const std::string& fragmentShader) :
|
||||
id(0)
|
||||
{
|
||||
GLint success;
|
||||
|
@ -71,17 +71,22 @@ namespace lol
|
|||
glDeleteShader(vertexShaderID);
|
||||
}
|
||||
|
||||
UniqueShader::~UniqueShader()
|
||||
Shader::~Shader()
|
||||
{
|
||||
glDeleteProgram(id);
|
||||
}
|
||||
|
||||
void UniqueShader::Use()
|
||||
void Shader::Bind()
|
||||
{
|
||||
glUseProgram(id);
|
||||
}
|
||||
|
||||
void UniqueShader::SetUniform(const std::string& name, const glm::mat4& value)
|
||||
void Shader::Unbind()
|
||||
{
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void Shader::SetUniform(const std::string& name, const glm::mat4& value)
|
||||
{
|
||||
GLint location = glGetUniformLocation(id, name.c_str());
|
||||
if (location == -1)
|
||||
|
@ -90,7 +95,7 @@ namespace lol
|
|||
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(value));
|
||||
}
|
||||
|
||||
void UniqueShader::SetUniform(const std::string& name, const glm::vec4& value)
|
||||
void Shader::SetUniform(const std::string& name, const glm::vec4& value)
|
||||
{
|
||||
GLint location = glGetUniformLocation(id, name.c_str());
|
||||
if (location == -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue