X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fandroid%2Ffg_window_android.c;h=af2d6912a6d088a311f85c19f77e296b05a88209;hb=b22908d722db04f333a49f939f18be59c41f7802;hp=1b4c80ffec80674114520fe70f5902b24b8dd805;hpb=b3afa3521a6b71832c3411dde9d2ab93706b1f7d;p=freeglut diff --git a/src/android/fg_window_android.c b/src/android/fg_window_android.c index 1b4c80f..af2d691 100644 --- a/src/android/fg_window_android.c +++ b/src/android/fg_window_android.c @@ -83,6 +83,14 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, fghPlatformOpenWindowEGL(window); + /* Bind context to the current thread if it's lost */ + if (eglGetCurrentContext() == EGL_NO_CONTEXT && + eglMakeCurrent(fgDisplay.pDisplay.egl.Display, + window->Window.pContext.egl.Surface, + window->Window.pContext.egl.Surface, + window->Window.Context) == EGL_FALSE) + fgError("eglMakeCurrent: err=%x\n", eglGetError()); + window->State.Visible = GL_TRUE; }