Error.h 718 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  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_EXTRA_CHECKS
  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() glConditionalCheckError(ANKI_FILE, __LINE__, ANKI_FUNC)
  17. #else
  18. # define ANKI_CHECK_GL_ERROR() ((void)0)
  19. #endif
  20. /// @}
  21. } // end namespace anki