Fix issues with context lost on Android
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1678 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
aff8412f26
commit
2c025ce66d
@ -83,6 +83,14 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
|
|||||||
|
|
||||||
fghPlatformOpenWindowEGL(window);
|
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;
|
window->State.Visible = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user