36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
#ifndef OPENGL_SHADER_H
|
|
#define OPENGL_SHADER_H
|
|
|
|
#include <string>
|
|
#include <epoxy/gl.h>
|
|
//#include <glm/glm.hpp>
|
|
|
|
class OpenGlShaderProgram
|
|
{
|
|
public:
|
|
OpenGlShaderProgram(std::string vertex_file, std::string geometry_file, std::string fragment_file);
|
|
OpenGlShaderProgram(const OpenGlShaderProgram &) = delete;
|
|
OpenGlShaderProgram(const OpenGlShaderProgram &&) = delete;
|
|
~OpenGlShaderProgram();
|
|
int compile();
|
|
void unload();
|
|
int use();
|
|
int getUniformLoc(const std::string &uniform);
|
|
void setUniformFloat(const std::string &uniform, float value);
|
|
void setUniformInt(const std::string &uniform, int value);
|
|
void setUniformVec2(const std::string &uniform, float *vector);
|
|
void setUniformVec3(const std::string &uniform, const glm::vec3 &vector);
|
|
void setUniformMat4(const std::string &uniform, const glm::mat4 &matrix);
|
|
void setUniformMat3(const std::string &uniform, const glm::mat3 &matrix);
|
|
void setUniformVec4(const std::string &uniform, const glm::vec4 &vector);
|
|
void setUniformBool(const std::string &uniform, bool value);
|
|
private:
|
|
bool compiled;
|
|
GLuint shader_program;
|
|
std::string vertex_file;
|
|
std::string geometry_file;
|
|
std::string fragment_file;
|
|
};
|
|
|
|
#endif // OPENGL_SHADER_H
|