X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fegl%2Ffg_window_egl.c;h=6c4a7de7c9a830bd4dce9cebee3585551dbc5022;hb=1f67274c9ebf2ed21d6302af23175a24ed56c820;hp=48eb74856ba2ccf1c9d63e7ba093b1e44ecd07d5;hpb=1182304c390146ff4663bdfb410cf8cf9a4c600d;p=freeglut diff --git a/src/egl/fg_window_egl.c b/src/egl/fg_window_egl.c index 48eb748..6c4a7de 100644 --- a/src/egl/fg_window_egl.c +++ b/src/egl/fg_window_egl.c @@ -46,7 +46,7 @@ int fghChooseConfig(EGLConfig* config) { EGL_SAMPLES, (fgState.DisplayMode & GLUT_MULTISAMPLE) ? fgState.SampleNumber : 0, EGL_NONE }; - + EGLint num_config; if (!eglChooseConfig(fgDisplay.pDisplay.egl.Display, attribs, config, 1, &num_config)) { @@ -94,11 +94,13 @@ EGLContext fghCreateNewContextEGL( SFG_Window* window ) { void fgPlatformSetWindow ( SFG_Window *window ) { - if (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()); + if ( window != fgStructure.CurrentWindow && window) { + if (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()); + } } /*