report_gl_error.h 1009 B

123456789101112131415161718192021222324252627282930313233343536
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_OPENGL_REPORT_GL_ERROR_H
  9. #define IGL_OPENGL_REPORT_GL_ERROR_H
  10. #include "../igl_inline.h"
  11. // Hack to allow both opengl/ and opengl2 to use this (we shouldn't allow this)
  12. #ifndef __gl_h_
  13. # include "gl.h"
  14. #endif
  15. #include <string>
  16. namespace igl
  17. {
  18. namespace opengl
  19. {
  20. // Print last OpenGL error to stderr prefixed by specified id string
  21. // Inputs:
  22. // id string to appear before any error msgs
  23. // Returns result of glGetError()
  24. IGL_INLINE GLenum report_gl_error(const std::string id);
  25. // No prefix
  26. IGL_INLINE GLenum report_gl_error();
  27. }
  28. }
  29. #ifndef IGL_STATIC_LIBRARY
  30. # include "report_gl_error.cpp"
  31. #endif
  32. #endif