From af95cbdafe30386d79d50a214b4c5161907773cd Mon Sep 17 00:00:00 2001 From: beuc Date: Sat, 17 Mar 2012 13:29:51 +0000 Subject: [PATCH] Context can be used for a menu rather than the current window git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1179 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/android/fg_window_android.c | 2 +- freeglut/freeglut/src/egl/fg_window_egl.c | 4 ++-- freeglut/freeglut/src/egl/fg_window_egl.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/freeglut/freeglut/src/android/fg_window_android.c b/freeglut/freeglut/src/android/fg_window_android.c index 6b51091..0dec205 100644 --- a/freeglut/freeglut/src/android/fg_window_android.c +++ b/freeglut/freeglut/src/android/fg_window_android.c @@ -53,7 +53,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, } fghChooseConfigEGL(&window->Window.pContext.egl.Config); - fghCreateNewContextEGL(window); + window->Window.Context = fghCreateNewContextEGL(window); /* Wait until window is available and OpenGL context is created */ /* Normally events are processed through glutMainLoop(), but the diff --git a/freeglut/freeglut/src/egl/fg_window_egl.c b/freeglut/freeglut/src/egl/fg_window_egl.c index c2bca96..48e330c 100644 --- a/freeglut/freeglut/src/egl/fg_window_egl.c +++ b/freeglut/freeglut/src/egl/fg_window_egl.c @@ -60,7 +60,7 @@ int fghChooseConfigEGL(EGLConfig* config) { /** * Initialize an EGL context for the current display. */ -void fghCreateNewContextEGL( SFG_Window* window ) { +EGLContext fghCreateNewContextEGL( SFG_Window* window ) { EGLContext context; EGLDisplay eglDisplay = fgDisplay.pDisplay.egl.Display; @@ -85,7 +85,7 @@ void fghCreateNewContextEGL( SFG_Window* window ) { if (ver != 2) fgError("Wrong GLES major version: %d\n", ver); - window->Window.Context = context; + return context; } /* diff --git a/freeglut/freeglut/src/egl/fg_window_egl.h b/freeglut/freeglut/src/egl/fg_window_egl.h index 37b8951..a9e1aca 100644 --- a/freeglut/freeglut/src/egl/fg_window_egl.h +++ b/freeglut/freeglut/src/egl/fg_window_egl.h @@ -28,7 +28,7 @@ extern int fghChooseConfigEGL(EGLConfig* config); extern void fghPlatformOpenWindowEGL( SFG_Window* window ); -extern void fghCreateNewContextEGL( SFG_Window* window ); +extern EGLConfig fghCreateNewContextEGL( SFG_Window* window ); extern void fghPlatformCloseWindowEGL( SFG_Window* window ); #endif