Adding shader class.

This commit is contained in:
Faerbit 2014-10-23 00:52:04 +02:00
parent a807e1369a
commit 1d924bd2b0
2 changed files with 31 additions and 0 deletions

14
shader.cc Normal file
View File

@ -0,0 +1,14 @@
#include "shader.hh"
Shader::Shader(std::string filePath, Model model) {
reference = ACGL::OpenGL::ShaderProgramCreator(filePath).attributeLocations(
model.getReference()->getAttributeLocations()).create();
reference->use();
}
Shader::~Shader() {
}
ACGL::OpenGL::SharedShaderProgram Shader::getReference() {
return reference;
}

17
shader.hh Normal file
View File

@ -0,0 +1,17 @@
#ifndef SHADER_HH_INCLUDED
#define SHADER_HH_INCLUDED
#include "model.hh"
#include <string>
#include <ACGL/OpenGL/Creator/ShaderProgramCreator.hh>
class Shader {
public:
Shader(std::string filePath, Model model);
ACGL::OpenGL::SharedShaderProgram getReference();
~Shader();
private:
ACGL::OpenGL::SharedShaderProgram reference;
};
#endif