From e73e40888591d082188010aa3d6c8770bf2a6536 Mon Sep 17 00:00:00 2001 From: Mario Liebisch Date: Sat, 5 Jul 2014 18:42:41 +0200 Subject: [PATCH] [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). --- src/SFML/Window/EglContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index aa751ba8..d18396f1 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -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)); }