Error.h 744 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <anki/gr/gl/Common.h>
  7. namespace anki
  8. {
  9. /// @addtogroup opengl
  10. /// @{
  11. // Enable the exception on debug. Calling glGetError calls serialization
  12. #if ANKI_DEBUG
  13. /// The function exits if there is an OpenGL error. Use it with the
  14. /// ANKI_CHECK_GL_ERROR macro
  15. void glConditionalCheckError(const char* file, int line, const char* func);
  16. #define ANKI_CHECK_GL_ERROR() \
  17. glConditionalCheckError(ANKI_FILE, __LINE__, ANKI_FUNC)
  18. #else
  19. #define ANKI_CHECK_GL_ERROR() ((void)0)
  20. #endif
  21. /// @}
  22. } // end namespace anki