00001 #ifndef __SHADER_GLSL__
00002 #define __SHADER_GLSL__
00003
00004 #include <OpenGL.h>
00005 #include <QString>
00006
00007 namespace apig {
00008
00009 class ShaderGLSL {
00010 public:
00011 typedef enum { VERTEX, FRAGMENT } Type;
00012
00013
00014
00015 ShaderGLSL(QString source, Type type, bool loadFromFile=true);
00016
00017 void compile();
00018 void destroy();
00019
00020
00021 bool operator==(const ShaderGLSL& s) { return id == s.id; }
00022
00023 private:
00024 QString getInfoLog() const;
00025
00026 private:
00027 QString fileName;
00028 GLuint id;
00029
00030 friend class ProgGLSL;
00031 };
00032
00033 }
00034
00035 #endif