This commit is contained in:
Branimir Karadžić 2015-04-18 00:39:57 -07:00
parent 8dc0603c80
commit 11794da949

View file

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