EGL: implement fgPlatformSetWindow

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1182 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
beuc 2012-03-17 14:24:42 +00:00
parent 2a3295e970
commit a729bc608f
3 changed files with 11 additions and 5 deletions

View File

@ -92,11 +92,6 @@ void fgPlatformCloseWindow( SFG_Window* window )
/* Window pre-created by Android, no way to delete it */ /* 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 * This function makes the current window visible
*/ */

View File

@ -125,3 +125,13 @@ void fghPlatformCloseWindowEGL( SFG_Window* window )
window->Window.pContext.egl.Surface = EGL_NO_SURFACE; 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());
}

View File

@ -30,5 +30,6 @@ extern int fghChooseConfigEGL(EGLConfig* config);
extern void fghPlatformOpenWindowEGL( SFG_Window* window ); extern void fghPlatformOpenWindowEGL( SFG_Window* window );
extern EGLConfig fghCreateNewContextEGL( SFG_Window* window ); extern EGLConfig fghCreateNewContextEGL( SFG_Window* window );
extern void fghPlatformCloseWindowEGL( SFG_Window* window ); extern void fghPlatformCloseWindowEGL( SFG_Window* window );
extern void fgPlatformSetWindow ( SFG_Window *window );
#endif #endif