37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
|
#pragma once
|
||
|
|
||
|
#include <map>
|
||
|
#include <string>
|
||
|
|
||
|
#include <GL/glew.h>
|
||
|
|
||
|
#include <glm/glm.hpp>
|
||
|
#include <glm/gtc/type_ptr.hpp>
|
||
|
|
||
|
class ShaderProgram
|
||
|
{
|
||
|
bool mUniformLocationsNeedRefresh;
|
||
|
std::map<const std::string, GLint> UniformLocationCache;
|
||
|
static GLint my_checkCompileSuccess (const GLuint id, const GLenum type);
|
||
|
public:
|
||
|
GLuint ID;
|
||
|
ShaderProgram (void);
|
||
|
ShaderProgram (const std::string&, const std::string&, const std::string&);
|
||
|
GLint getCachedLoc (const std::string&);
|
||
|
void RefreshUniformLocations (void);
|
||
|
void Use (void);
|
||
|
void Bool (const std::string&, const bool&value);
|
||
|
void Float (const std::string&, const float&value);
|
||
|
void Int (const std::string&, const int&value);
|
||
|
void Vec2 (const std::string&, const glm::vec2& value);
|
||
|
void Vec3 (const std::string&, const glm::vec3& value);
|
||
|
void Vec4 (const std::string&, const glm::vec4& value);
|
||
|
void Mat2 (const std::string&, const glm::mat2& value);
|
||
|
void Mat3 (const std::string&, const glm::mat3& value);
|
||
|
void Mat4 (const std::string&, const glm::mat4& value);
|
||
|
|
||
|
GLuint CompileShaderBuffer (const std::string&, const GLenum type);
|
||
|
GLuint CompileShaderPath (const std::string&, const GLenum type);
|
||
|
GLint LinkProgram (void);
|
||
|
};
|