From 1692605b0840cd869a83bd87055e9372acda0e76 Mon Sep 17 00:00:00 2001 From: dhewg Date: Sun, 3 Apr 2011 17:33:10 +0200 Subject: ANDROID: Helper define to debug hanging GLES calls --- backends/platform/android/android.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'backends/platform/android') diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 40dc0fe4fd..76db012173 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -48,6 +48,7 @@ // toggles start //#define ANDROID_DEBUG_ENTER //#define ANDROID_DEBUG_GL +//#define ANDROID_DEBUG_GL_CALLS // toggles end extern const char *android_log_tag; @@ -67,9 +68,23 @@ extern const char *android_log_tag; #ifdef ANDROID_DEBUG_GL extern void checkGlError(const char *expr, const char *file, int line); +#ifdef ANDROID_DEBUG_GL_CALLS +#define GLCALLLOG(x, before) \ + do { \ + if (before) \ + LOGD("calling '%s' (%s:%d)", x, __FILE__, __LINE__); \ + else \ + LOGD("returned from '%s' (%s:%d)", x, __FILE__, __LINE__); \ + } while (false) +#else +#define GLCALLLOG(x, before) do { } while (false) +#endif + #define GLCALL(x) \ do { \ + GLCALLLOG(#x, true); \ (x); \ + GLCALLLOG(#x, false); \ checkGlError(#x, __FILE__, __LINE__); \ } while (false) -- cgit v1.2.3