EGLint GLContext::Swap()
{
bool b = eglSwapBuffers( display_, surface_ );
if( !b )
{
EGLint err = eglGetError();
if( err == EGL_BAD_SURFACE )
{
LOGE("Swap: Re-creating egl context EGL_BAD_SURFACE: err=" + std::to_string(err));
//Recreate surface
InitEGLSurface();
return EGL_SUCCESS; //Still consider glContext is valid
}
else if( err == EGL_CONTEXT_LOST || err == EGL_BAD_CONTEXT )
{
LOGE("Swap: Re-creating egl context EGL_CONTEXT_LOST || EGL_BAD_CONTEXT: err=" + std::to_string(err));
//Context has been lost!!
context_valid_ = false;
Terminate();
InitEGLContext();
}
return err;
}
return EGL_SUCCESS;
}--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/d43c17b7-dcd7-4b6d-bd99-9f36786fbf9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.