4 #include "include_opengl.h"
7 #include <unordered_map>
18 unsigned get(GLenum shaderType);
21 std::unordered_map<GLenum, unsigned> _shaderTypes;
31 Shader(
const std::string& name);
64 bool link(
const std::string& out);
70 bool link(
int numLocations,
const std::string* out);
105 void preprocess(
unsigned numKeys,
const std::regex* keys,
const std::string* values);
107 const std::string& getName()
const;
109 GLuint getProgram()
const;
113 GLuint _programHandle;
114 GLuint _shaderHandles[8];
115 bool _compiled, _linked;
118 const GLchar** _varyings;
121 std::string _source[8];
122 std::string _sourceFolder[8];
124 void processIncludes(std::string& source,
const std::string& folder);
126 std::string getShaderTypeString(GLint type);
130 static GLenum SHADER_TYPES[8];
bool compileShaders()
Definition: Shader.cpp:118
bool attachShaderSource(int type, const std::string &source)
Definition: Shader.cpp:48
GLint getSubroutineUniformLocation(GLenum shaderType, const std::string &name)
Definition: Shader.cpp:246
bool attachShaderFile(int type, const std::string &path)
Definition: Shader.cpp:60
void bind() const
Definition: Shader.cpp:232
bool link()
Definition: Shader.cpp:172
GLuint getSubroutineIndex(GLenum shaderType, const std::string &name)
Definition: Shader.cpp:251
void unbind() const
Definition: Shader.cpp:236
GLint getUniformLocation(const std::string &name) const
Definition: Shader.cpp:241
void setTransformFeedbackVaryings(int numVaryings, const GLchar **varyings, GLenum mode)
Definition: Shader.cpp:156
GLint getAttribLocation(const std::string &name) const
Definition: Shader.cpp:256