From 0b6bbe04a31c45cd7bcc5bcdcff5a7111292e9b5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 9 Nov 2012 09:42:52 +0100 Subject: [PATCH] (Android) Add log error messages for Android EGL context for debugging --- gfx/context/androidegl_ctx.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gfx/context/androidegl_ctx.c b/gfx/context/androidegl_ctx.c index d4f0287842..542b7b9308 100644 --- a/gfx/context/androidegl_ctx.c +++ b/gfx/context/androidegl_ctx.c @@ -105,33 +105,57 @@ static bool gfx_ctx_init(void) RARCH_LOG("Initializing context\n"); if ((g_egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY) + { + RARCH_ERR("eglGetDisplay failed.\n"): goto error; + } if (!eglInitialize(g_egl_dpy, &egl_version_major, &egl_version_minor)) + { + RARCH_ERR("eglInitialize failed.\n"): goto error; + } RARCH_LOG("[ANDROID/EGL]: EGL version: %d.%d\n", egl_version_major, egl_version_minor); if (!eglChooseConfig(g_egl_dpy, attribs, &g_config, 1, &num_config)) + { + RARCH_ERR("eglChooseConfig failed.\n"): goto error; + } if (!eglGetConfigAttrib(g_egl_dpy, config, EGL_NATIVE_VISUAL_ID, &format)) + { + RARCH_ERR("eglGetConfigAttrib failed.\n"): goto error; + } ANativeWindow_setBuffersGeometry(g_android.app->window, 0, 0, format); if (!(g_egl_surf = eglCreateWindowSurface(g_egl_dpy, config, g_android.app->window, 0))) + { + RARCH_ERR("eglCreateWindowSurface failed.\n"): goto error; + } if (!(g_egl_ctx = eglCreateContext(g_egl_dpy, config, 0, context_attributes))) + { + RARCH_ERR("eglCreateContext failed.\n"): goto error; + } if (!eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx)) + { + RARCH_ERR("eglMakeCurrent failed.\n"): goto error; + } if (!eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_WIDTH, &width) || !eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height)) + { + RARCH_ERR("eglQuerySurface failed.\n"): goto error; + } if (g_android.input_state & (1ULL << RARCH_REENTRANT)) {