report_gl_error.cpp 375 B

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