[ORBIS] eglSwapInterval workaround

This commit is contained in:
Francisco José García García 2018-12-30 14:01:10 +01:00
parent 4ad083cb97
commit c56e9b1ff6
2 changed files with 17 additions and 6 deletions

View File

@ -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;

View File

@ -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
}