Branimir Karadžić 10 anni fa
parent
commit
11794da949
1 ha cambiato i file con 14 aggiunte e 8 eliminazioni
  1. 14 8
      src/glcontext_egl.cpp

+ 14 - 8
src/glcontext_egl.cpp

@@ -278,7 +278,7 @@ EGL_IMPORT
 
 
 	void GlContext::destroy()
 	void GlContext::destroy()
 	{
 	{
-		if (m_display)
+		if (NULL != m_display)
 		{
 		{
 			eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
 			eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
 			eglDestroyContext(m_display, m_context);
 			eglDestroyContext(m_display, m_context);
@@ -286,7 +286,7 @@ EGL_IMPORT
 			eglTerminate(m_display);
 			eglTerminate(m_display);
 			m_context = NULL;
 			m_context = NULL;
 		}
 		}
-		
+
 		eglClose(m_eglLibrary);
 		eglClose(m_eglLibrary);
 
 
 #	if BX_PLATFORM_RPI
 #	if BX_PLATFORM_RPI
@@ -297,9 +297,9 @@ EGL_IMPORT
 	void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags)
 	void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags)
 	{
 	{
 		BX_UNUSED(_width, _height);
 		BX_UNUSED(_width, _height);
-		
+
 #	if BX_PLATFORM_ANDROID
 #	if BX_PLATFORM_ANDROID
-		if (m_display)
+		if (NULL != m_display)
 		{
 		{
 			EGLint format;
 			EGLint format;
 			eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format);
 			eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format);
@@ -307,9 +307,11 @@ EGL_IMPORT
 		}
 		}
 #	endif // BX_PLATFORM_ANDROID
 #	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);
 			eglSwapInterval(m_display, vsync ? 1 : 0);
+		}
 	}
 	}
 
 
 	bool GlContext::isSwapChainSupported()
 	bool GlContext::isSwapChainSupported()
@@ -336,8 +338,10 @@ EGL_IMPORT
 
 
 		if (NULL == _swapChain)
 		if (NULL == _swapChain)
 		{
 		{
-			if (m_display)
+			if (NULL != m_display)
+			{
 				eglSwapBuffers(m_display, m_surface);
 				eglSwapBuffers(m_display, m_surface);
+			}
 		}
 		}
 		else
 		else
 		{
 		{
@@ -353,8 +357,10 @@ EGL_IMPORT
 
 
 			if (NULL == _swapChain)
 			if (NULL == _swapChain)
 			{
 			{
-				if (m_display)
+				if (NULL != m_display)
+				{
 					eglMakeCurrent(m_display, m_surface, m_surface, m_context);
 					eglMakeCurrent(m_display, m_surface, m_surface, m_context);
+				}
 			}
 			}
 			else
 			else
 			{
 			{