report_gl_error.cpp 404 B

123456789101112131415161718192021
  1. #include "report_gl_error.h"
  2. #ifndef IGL_NO_OPENGL
  3. #include "verbose.h"
  4. IGL_INLINE GLenum igl::report_gl_error(const std::string id)
  5. {
  6. GLenum err = glGetError();
  7. if(GL_NO_ERROR != err)
  8. {
  9. verbose("GL_ERROR: ");
  10. fprintf(stderr,"%s%s\n",id.c_str(),gluErrorString(err));
  11. }
  12. return err;
  13. }
  14. IGL_INLINE GLenum igl::report_gl_error()
  15. {
  16. return igl::report_gl_error(std::string(""));
  17. }
  18. #endif