removed unnecessary factory pattern

This commit is contained in:
Lauchmelder 2021-12-23 04:55:19 +01:00
parent 711d18e718
commit 5875f1246f
9 changed files with 55 additions and 71 deletions

View file

@ -11,7 +11,7 @@ inline
namespace lol
{
AbstractShader::AbstractShader(const std::string& vertexShader, const std::string& fragmentShader) :
UniqueShader::UniqueShader(const std::string& vertexShader, const std::string& fragmentShader) :
id(0)
{
GLint success;
@ -71,17 +71,17 @@ namespace lol
glDeleteShader(vertexShaderID);
}
AbstractShader::~AbstractShader()
UniqueShader::~UniqueShader()
{
glDeleteProgram(id);
}
void AbstractShader::Use()
void UniqueShader::Use()
{
glUseProgram(id);
}
void AbstractShader::SetUniform(const std::string& name, const glm::mat4& value)
void UniqueShader::SetUniform(const std::string& name, const glm::mat4& value)
{
GLint location = glGetUniformLocation(id, name.c_str());
if (location == -1)
@ -90,7 +90,7 @@ namespace lol
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(value));
}
void AbstractShader::SetUniform(const std::string& name, const glm::vec4& value)
void UniqueShader::SetUniform(const std::string& name, const glm::vec4& value)
{
GLint location = glGetUniformLocation(id, name.c_str());
if (location == -1)