diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/opengl/GLAssert.h |
Diffstat (limited to 'Runtime/GfxDevice/opengl/GLAssert.h')
-rw-r--r-- | Runtime/GfxDevice/opengl/GLAssert.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengl/GLAssert.h b/Runtime/GfxDevice/opengl/GLAssert.h new file mode 100644 index 0000000..7693012 --- /dev/null +++ b/Runtime/GfxDevice/opengl/GLAssert.h @@ -0,0 +1,25 @@ +#ifndef GLASSERT_H +#define GLASSERT_H + +#include "Runtime/Utilities/LogAssert.h" + +void CheckOpenGLError (const char *prefix, const char* file, long line); + +#if !UNITY_RELEASE + #ifndef GLAssert + /// Asserts for checking the OpenGL error state + #define GLAssert() { CheckOpenGLError (NULL, __FILE__, __LINE__); } + #endif + #define GLAssertString(x) { CheckOpenGLError (x, __FILE__, __LINE__); } + #define GL_CHK(x) do { {x;} GLAssert(); } while(0) +#else + + #ifndef GLAssert + #define GLAssert() + #endif + #define GLAssertString(x) + #define GL_CHK(x) x + +#endif + +#endif |