From bab243a7a2aff6217c7762f891397226a3159ed1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 3 Dec 2015 23:33:50 +0100 Subject: [PATCH] (egl_common.c) Cleanups --- gfx/common/egl_common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 9ad1bb88ad..7089ba0578 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -120,7 +120,9 @@ void egl_bind_hw_render(void *data, bool enable) { g_egl_use_hw_ctx = enable; - if (!g_egl_dpy || !g_egl_surf) + if (g_egl_dpy == EGL_NO_DISPLAY) + return; + if (g_egl_surf == EGL_NO_SURFACE) return; eglMakeCurrent(g_egl_dpy, g_egl_surf, @@ -145,7 +147,7 @@ void egl_set_swap_interval(void *data, unsigned interval) */ g_interval = interval; - if (!g_egl_dpy) + if (g_egl_dpy == EGL_NO_DISPLAY) return; if (!(eglGetCurrentContext())) return; @@ -239,7 +241,8 @@ bool egl_create_context(EGLint *egl_attribs) bool egl_create_surface(NativeWindowType native_window) { g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, native_window, NULL); - if (!g_egl_surf || g_egl_surf == EGL_NO_SURFACE) + + if (g_egl_surf == EGL_NO_SURFACE) return false; /* Connect the context to the surface. */