mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 02:30:35 +00:00
(Android) Add log error messages for Android EGL context for debugging
This commit is contained in:
parent
d1b23aeb42
commit
0b6bbe04a3
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user