From c56e9b1ff6732c403e49ce210f1bc6d46d19b0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Sun, 30 Dec 2018 14:01:10 +0100 Subject: [PATCH] [ORBIS] eglSwapInterval workaround --- gfx/common/egl_common.c | 7 ++++++- gfx/drivers_context/orbis_ctx.c | 16 +++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 348d1bafe4..80e0697e50 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -419,7 +419,12 @@ bool egl_create_context(egl_ctx_data_t *egl, const EGLint *egl_attribs) bool egl_create_surface(egl_ctx_data_t *egl, void *native_window) { - egl->surf = eglCreateWindowSurface(egl->dpy, egl->config, (NativeWindowType)native_window, NULL); + EGLint window_attribs[] = { + EGL_RENDER_BUFFER, EGL_BACK_BUFFER, + EGL_NONE, + }; + + egl->surf = eglCreateWindowSurface(egl->dpy, egl->config, (NativeWindowType)native_window, window_attribs); if (egl->surf == EGL_NO_SURFACE) return false; diff --git a/gfx/drivers_context/orbis_ctx.c b/gfx/drivers_context/orbis_ctx.c index 999e51ef53..267d6caf83 100644 --- a/gfx/drivers_context/orbis_ctx.c +++ b/gfx/drivers_context/orbis_ctx.c @@ -59,11 +59,17 @@ static void *orbis_ctx_init(video_frame_info_t *video_info, void *video_driver) EGLint n; EGLint major, minor; static const EGLint attribs[] = { - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_NONE}; + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 0, + EGL_SAMPLE_BUFFERS, 0, + EGL_SAMPLES, 0, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_NONE}; #endif orbis_ctx_data_t *ctx_orbis = (orbis_ctx_data_t *)calloc(1, sizeof(*ctx_orbis)); @@ -219,7 +225,7 @@ static void orbis_ctx_set_swap_interval(void *data, orbis_ctx_data_t *ctx_orbis = (orbis_ctx_data_t *)data; #ifdef HAVE_EGL - egl_set_swap_interval(&ctx_orbis->egl, swap_interval); + egl_set_swap_interval(&ctx_orbis->egl, 0); #endif }