Main Page | Class Hierarchy | Class List | Directories | File List

ShaderGLSL.h

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             // constructeur à appeler quand un contexte OpenGL a été initialisé
00014             // <source> contient le code source si <loadFromFile>==false, le nom du fichier source sinon
00015             ShaderGLSL(QString source, Type type, bool loadFromFile=true);
00016         
00017             void compile();
00018             void destroy();
00019             
00020             // comparaison de deux shaders à partir des id :
00021             bool operator==(const ShaderGLSL& s) { return id == s.id; }
00022             
00023         private:
00024             QString getInfoLog() const;
00025             
00026         private:
00027             QString fileName;   // juste pour les eventuels messages d'erreurs
00028             GLuint id;
00029             
00030         friend class ProgGLSL;     // pour permettre à la classe ProgrammeGLSL d'accéder à la variable <id>
00031         };
00032     
00033     }
00034 
00035 #endif

Generated on Fri Nov 14 20:49:47 2008 for Api Graphics by  doxygen 1.4.4