report_gl_error.h 559 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_REPORT_GL_ERROR_H
  2. #define IGL_REPORT_GL_ERROR_H
  3. #ifndef IGL_NO_OPENGL
  4. #include "igl_inline.h"
  5. #include "OpenGL_convenience.h"
  6. #include <cstdio>
  7. #include <string>
  8. namespace igl
  9. {
  10. // Print last OpenGL error to stderr prefixed by specified id string
  11. // Inputs:
  12. // id string to appear before any error msgs
  13. // Returns result of glGetError()
  14. IGL_INLINE GLenum report_gl_error(const std::string id);
  15. // No prefix
  16. IGL_INLINE GLenum report_gl_error();
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "report_gl_error.cpp"
  20. #endif
  21. #endif
  22. #endif