ultimatepp/rainbow/WinGl/Shaders.h
unodgs b5711acfd8 WinGL: Added painting through fbo, added blur shader, fixed children clipping, optimized painting a bit
git-svn-id: svn://ultimatepp.org/upp/trunk@4365 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2012-01-06 12:48:43 +00:00

41 lines
1 KiB
C++

#ifndef _WinGl_Shaders_h_
#define _WinGl_Shaders_h_
class Shader
{
private:
int program;
String error;
String compileError;
String fragSrc;
String vertSrc;
VectorMap<String, int> uniforms;
void PrintShaderInfoLog(GLuint obj, const char* fileName);
void PrintProgramInfoLog(GLuint obj, const char* fileName);
void PrintProgramValidationLog(GLuint obj, const char* fileName);
bool CheckGLError();
bool IsProgramCompiled(int program);
bool IsProgramLinked(int program);
int GetUniformId(const char* var);
public:
int CompileProgram(const char* vs, const char* fs);
int CompileProgram(const byte* vs, const byte* fs);
int GetProgram();
void Set(const char* var, float v);
void Set(const char* var, bool v);
void Set(const char* var, int v);
void Set(const char* var, float v0, float v1);
void Set(const char* var, float v0, float v1, float v2);
void Set(const char* var, float v0, float v1, float v2, float v3);
void Set(const char* var, float* v, int size, int count);
void Start();
void Stop();
String GetError();
Shader();
};
#endif