glslShaders.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EVOLVE_GLSL_SHADERS_H
00020 #define EVOLVE_GLSL_SHADERS_H
00021
00022 #include <eq/eq.h>
00023
00024 namespace eVolve
00025 {
00026 class GLSLShaders
00027 {
00028 public:
00029 GLSLShaders(): _program( 0 ), _shadersLoaded( false ), _glewCtx( 0 ) {}
00030
00031 bool loadShaders( const std::string &vShader,
00032 const std::string &fShader,
00033 GLEWContext* glewCtx );
00034
00035 void unloadShaders();
00036
00037 GLhandleARB getProgram() const { return _program; }
00038 GLEWContext* glewGetContext() { return _glewCtx; }
00039
00040 private:
00041 GLhandleARB _program;
00042 bool _shadersLoaded;
00043 GLEWContext* _glewCtx;
00044
00045 GLhandleARB _loadShader( const std::string &shader, GLenum shaderType );
00046 void _printLog( GLhandleARB shader, const std::string &type );
00047 };
00048
00049 }
00050 #endif // EVOLVE_GLSL_SHADERS_H