#ifndef IGL_REPORT_GL_ERROR #define IGL_REPORT_GL_ERROR #ifdef __APPLE__ # include # include #else # include # include #endif #include #include namespace igl { // Print last OpenGL error to stderr prefixed by specified id string // Inputs: // id string to appear before any error msgs // Returns result of glGetError() inline GLenum report_gl_error(const std::string id = string("")); } // Implementation #include "verbose.h" inline GLenum igl::report_gl_error(const std::string id) { GLenum err = glGetError(); if(GL_NO_ERROR != err) { verbose("GL_ERROR: "); fprintf(stderr,"%s%s\n",id.c_str(),gluErrorString(err)); } return err; } #endif