Implemented ShaderProgramBuilder
This commit is contained in:
28
source/shader/include/ShaderProgramBuilder.hpp
Normal file
28
source/shader/include/ShaderProgramBuilder.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <GL/glew.h>
|
||||
|
||||
namespace ugly{
|
||||
|
||||
class ShaderProgramBuilder {
|
||||
public:
|
||||
class Error: public std::runtime_error{
|
||||
public:
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
public:
|
||||
ShaderProgramBuilder();
|
||||
~ShaderProgramBuilder();
|
||||
void reset();
|
||||
ShaderProgramBuilder &attachFromMemory(GLenum type, const GLchar *string, GLint length = 0);
|
||||
ShaderProgramBuilder &attachFromFile(GLenum type, const char *filename);
|
||||
GLuint link();
|
||||
|
||||
private:
|
||||
GLuint mProgram;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user