2018-06-16 21:31:29 +00:00
|
|
|
#ifndef _GLSLSHADER_H_
|
|
|
|
#define _GLSLSHADER_H_
|
|
|
|
|
2020-07-31 19:18:51 +00:00
|
|
|
#include <GL/glew.h>
|
2018-06-16 21:31:29 +00:00
|
|
|
|
|
|
|
class GLSLShader {
|
|
|
|
|
|
|
|
public:
|
|
|
|
GLSLShader();
|
|
|
|
~GLSLShader();
|
|
|
|
|
|
|
|
bool LoadShaders(const char *vertexShader, const char *fragmentShader);
|
|
|
|
void UnloadShaders();
|
|
|
|
|
|
|
|
void EnableShader();
|
|
|
|
void DisableShader();
|
|
|
|
|
|
|
|
int GetUniformLocation(const char *str);
|
|
|
|
int GetAttributeLocation(const char *str);
|
|
|
|
|
|
|
|
int uniformLoc[64];
|
|
|
|
int attribLoc[16];
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void PrintShaderInfoLog(GLuint obj);
|
|
|
|
void PrintProgramInfoLog(GLuint obj);
|
|
|
|
|
|
|
|
GLuint m_program;
|
|
|
|
GLuint m_vShader;
|
|
|
|
GLuint m_fShader;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|