Equalizer 1.0
|
00001 00002 /* Copyright (c) 2011, Stefan Eilemann <eile@eyescale.ch> 00003 * 00004 * This library is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU Lesser General Public License version 2.1 as published 00006 * by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, but WITHOUT 00009 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00010 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00011 * details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this library; if not, write to the Free Software Foundation, Inc., 00015 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 */ 00017 00018 #ifndef EQ_GL_H 00019 #define EQ_GL_H 00020 00030 #include <eq/api.h> 00031 00032 #include <string> 00033 00035 #ifndef NOMINMAX 00036 # define NOMINMAX 00037 #endif 00038 #ifndef EQ_IGNORE_GLEW 00039 # include <eq/GL/glew.h> 00040 # ifdef GLX 00041 # include <eq/GL/glxew.h> 00042 # endif 00043 # ifdef WGL 00044 # include <eq/GL/wglew.h> 00045 # endif 00046 #endif 00047 00048 #include <GL/gl.h> 00049 00050 #ifndef GL_TEXTURE_RECTANGLE_ARB 00051 # define GL_TEXTURE_RECTANGLE_ARB 0x84F5 00052 #endif 00053 00055 // Error-check macros 00056 namespace eq 00057 { 00059 EQ_API void debugGLError( const std::string& when, const GLenum error, 00060 const char* file, const int line ); 00061 } 00062 00063 #ifdef NDEBUG 00064 # define EQ_GL_ERROR( when ) 00065 # define EQ_GL_CALL( code ) { code; } 00066 #else // NDEBUG 00067 # define EQ_GL_ERROR( when ) \ 00068 { \ 00069 const GLenum eqGlError = glGetError(); \ 00070 if( eqGlError ) \ 00071 eq::debugGLError( when, eqGlError, __FILE__, __LINE__ ); \ 00072 } 00073 00074 # define EQ_GL_CALL( code ) \ 00075 { \ 00076 EQ_GL_ERROR( std::string( "before " ) + #code ); \ 00077 code; \ 00078 EQ_GL_ERROR( std::string( "after " ) + #code ); \ 00079 } 00080 #endif // NDEBUG 00081 00082 #endif // EQ_GL_H 00083