glslShaders.h

00001 
00002 /* Copyright (c) 2007,       Maxim Makhinya
00003    Copyright (c) 2008,       Stefan Eilemann <eile@equalizergraphics.com> 
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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
Generated on Mon Aug 10 18:58:39 2009 for Equalizer 0.9 by  doxygen 1.5.8