Sloth loves Chunk!

This commit is contained in:
Marc-Eric Martel
2021-10-11 11:37:58 -04:00
parent 2347a3f7e4
commit 6f3dd99ab7
27 changed files with 19795 additions and 194 deletions

30
SQCSim2021/shader.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef SHADER_H__
#define SHADER_H__
#include <string>
#include "define.h"
class Shader
{
public:
bool Load(const std::string& vertFile, const std::string& fragFile, bool verbose = false);
void Use() const;
GLint BindIntUniform(const std::string& name) const;
void UpdateIntUniform(GLint name, GLint value) const;
void UpdateFloatUniform(GLint name, GLfloat value) const;
static void Disable();
private:
GLenum m_program;
GLenum m_vertexShader;
GLenum m_fragmentShader;
private:
bool CheckShaderError(GLenum shader, bool verbose);
bool CheckProgramError(GLenum program, bool showWarning, bool verbose);
};
#endif // SHADER_H__