[Android] Don't try to display without a surface

* Android apps would still try to call `eglSwapBuffers()` even though
they don't have a valid surface right now (i.e. due to being inactive/in
background).
This commit is contained in:
Mario Liebisch 2014-07-05 18:42:41 +02:00
parent 1851dcb109
commit e73e408885

View File

@ -180,7 +180,8 @@ bool EglContext::makeCurrent()
////////////////////////////////////////////////////////////
void EglContext::display()
{
eglCheck(eglSwapBuffers(m_display, m_surface));
if (m_surface != EGL_NO_SURFACE)
eglCheck(eglSwapBuffers(m_display, m_surface));
}