From 11794da9490a06ae9d3b68fa38ffc506bf8c3cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 18 Apr 2015 00:39:57 -0700 Subject: [PATCH] Cleanup. --- src/glcontext_egl.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/glcontext_egl.cpp b/src/glcontext_egl.cpp index 02436aa8..4bd42305 100644 --- a/src/glcontext_egl.cpp +++ b/src/glcontext_egl.cpp @@ -278,7 +278,7 @@ EGL_IMPORT void GlContext::destroy() { - if (m_display) + if (NULL != m_display) { eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(m_display, m_context); @@ -286,7 +286,7 @@ EGL_IMPORT eglTerminate(m_display); m_context = NULL; } - + eglClose(m_eglLibrary); # if BX_PLATFORM_RPI @@ -297,9 +297,9 @@ EGL_IMPORT void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags) { BX_UNUSED(_width, _height); - + # if BX_PLATFORM_ANDROID - if (m_display) + if (NULL != m_display) { EGLint format; eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format); @@ -307,9 +307,11 @@ EGL_IMPORT } # endif // BX_PLATFORM_ANDROID - bool vsync = !!(_flags&BGFX_RESET_VSYNC); - if (m_display) + if (NULL != m_display) + { + bool vsync = !!(_flags&BGFX_RESET_VSYNC); eglSwapInterval(m_display, vsync ? 1 : 0); + } } bool GlContext::isSwapChainSupported() @@ -336,8 +338,10 @@ EGL_IMPORT if (NULL == _swapChain) { - if (m_display) + if (NULL != m_display) + { eglSwapBuffers(m_display, m_surface); + } } else { @@ -353,8 +357,10 @@ EGL_IMPORT if (NULL == _swapChain) { - if (m_display) + if (NULL != m_display) + { eglMakeCurrent(m_display, m_surface, m_surface, m_context); + } } else {