You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -281,13 +281,19 @@ namespace Diligent
281
281
282
282
voidGLContext::SwapBuffers()
283
283
{
284
+
if(surface_ == EGL_NO_SURFACE)
285
+
{
286
+
LOG_WARNING_MESSAGE("No EGL surface when swapping buffers. This happens when SwapBuffers() is called after Suspend(). The operation will be ignored.");
287
+
return;
288
+
}
289
+
284
290
bool b = eglSwapBuffers( display_, surface_ );
285
291
if( !b )
286
292
{
287
293
EGLint err = eglGetError();
288
294
if( err == EGL_BAD_SURFACE )
289
295
{
290
-
//Recreate surface
296
+
LOG_INFO_MESSAGE("EGL surface has been lost. Attempting to recreate");
291
297
InitEGLSurface();
292
298
//return EGL_SUCCESS; //Still consider glContext is valid
0 commit comments