Merge pull request #9 from nazgee/fix_android_context

Fix issues with context lost on Android
This commit is contained in:
Diederick C. Niehorster 2014-03-05 09:38:08 +08:00
commit 0c669616e2

View File

@ -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;
}