Adding shader class.
This commit is contained in:
parent
a807e1369a
commit
1d924bd2b0
14
shader.cc
Normal file
14
shader.cc
Normal 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
17
shader.hh
Normal 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
|
Loading…
Reference in New Issue
Block a user