mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
8dc0603c80
commit
11794da949
1 changed files with 14 additions and 8 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue