summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles20/AssertGLES20.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/GfxDevice/opengles20/AssertGLES20.h')
-rw-r--r--Runtime/GfxDevice/opengles20/AssertGLES20.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles20/AssertGLES20.h b/Runtime/GfxDevice/opengles20/AssertGLES20.h
new file mode 100644
index 0000000..4a9809c
--- /dev/null
+++ b/Runtime/GfxDevice/opengles20/AssertGLES20.h
@@ -0,0 +1,29 @@
+#ifndef GLES_ASSERTGLES20_H
+#define GLES_ASSERTGLES20_H
+
+#include "Runtime/Utilities/LogAssert.h"
+
+void CheckOpenGLES2Error (const char *prefix, const char* file, long line);
+
+#if !UNITY_RELEASE
+ #ifndef GLESAssert
+ /// Asserts for checking the OpenGL error state
+ #define GLESAssert() { CheckOpenGLES2Error (NULL, __FILE__, __LINE__); }
+ #endif
+ #define GLESAssertString(x) { CheckOpenGLES2Error (x, __FILE__, __LINE__); }
+ #define GLES_CHK(x) do { {x;} GLESAssert(); } while(0)
+#else
+
+ #ifndef GLESAssert
+ #define GLESAssert()
+ #endif
+ #define GLESAssertString(x)
+ #define GLES_CHK(x) x
+#endif
+
+
+//#define GLES_CHK(x) do {} while(0)
+//#define GLES_CHK(x)
+//#define GLES_CHK(x) do { printf_console("GLES: %s %d\n", __FILE__, __LINE__); } while(0)
+
+#endif