Error.h 718 B

1234567891011121314151617181920212223242526272829
  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. /// @addtogroup opengl
  9. /// @{
  10. // Enable the exception on debug. Calling glGetError calls serialization
  11. #if ANKI_EXTRA_CHECKS
  12. /// The function exits if there is an OpenGL error. Use it with the
  13. /// ANKI_CHECK_GL_ERROR macro
  14. void glConditionalCheckError(const char* file, int line, const char* func);
  15. # define ANKI_CHECK_GL_ERROR() glConditionalCheckError(ANKI_FILE, __LINE__, ANKI_FUNC)
  16. #else
  17. # define ANKI_CHECK_GL_ERROR() ((void)0)
  18. #endif
  19. /// @}
  20. } // end namespace anki