From: Sylvain Beucler Date: Sat, 17 Mar 2012 14:24:42 +0000 (+0000) Subject: EGL: implement fgPlatformSetWindow X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=c229e12e3fcdbda830cedc61beaaa4e6b367b17b;hp=528c1d5f1b59c997928091b30fe33199ff3cc529;p=freeglut EGL: implement fgPlatformSetWindow git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1182 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/android/fg_window_android.c b/src/android/fg_window_android.c index 0dec205..1b601ab 100644 --- a/src/android/fg_window_android.c +++ b/src/android/fg_window_android.c @@ -92,11 +92,6 @@ void fgPlatformCloseWindow( SFG_Window* window ) /* Window pre-created by Android, no way to delete it */ } -void fgPlatformSetWindow ( SFG_Window *window ) -{ - /* TODO: only a single window possible? */ -} - /* * This function makes the current window visible */ diff --git a/src/egl/fg_window_egl.c b/src/egl/fg_window_egl.c index ad0ee22..f88cd8a 100644 --- a/src/egl/fg_window_egl.c +++ b/src/egl/fg_window_egl.c @@ -125,3 +125,13 @@ void fghPlatformCloseWindowEGL( SFG_Window* window ) window->Window.pContext.egl.Surface = EGL_NO_SURFACE; } } + +void fgPlatformSetWindow ( SFG_Window *window ) +{ + if (!eglMakeCurrent( + fgDisplay.pDisplay.egl.Display, + window->Window.pContext.egl.Surface, + window->Window.pContext.egl.Surface, + window->Window.Context)) + fgError("eglMakeCurrent: err=%x\n", eglGetError()); +} diff --git a/src/egl/fg_window_egl.h b/src/egl/fg_window_egl.h index a9e1aca..035fe24 100644 --- a/src/egl/fg_window_egl.h +++ b/src/egl/fg_window_egl.h @@ -30,5 +30,6 @@ extern int fghChooseConfigEGL(EGLConfig* config); extern void fghPlatformOpenWindowEGL( SFG_Window* window ); extern EGLConfig fghCreateNewContextEGL( SFG_Window* window ); extern void fghPlatformCloseWindowEGL( SFG_Window* window ); +extern void fgPlatformSetWindow ( SFG_Window *window ); #endif