X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fandroid%2Ffg_window_android.c;h=a6ce2012aa601aecdf989c7b273f103b2cc5c855;hb=329ff5a3e911e6a0e6cf4d75f25f9ccedd3b7693;hp=0dec205afefb3cca1d373109aeafe35c87aff8e3;hpb=e03ed4c92640c0252e4bf50dbbfea07bcb75989a;p=freeglut diff --git a/src/android/fg_window_android.c b/src/android/fg_window_android.c index 0dec205..a6ce201 100644 --- a/src/android/fg_window_android.c +++ b/src/android/fg_window_android.c @@ -1,5 +1,5 @@ /* - * freeglut_window_android.c + * fg_window_android.c * * Window management methods for Android * @@ -30,6 +30,7 @@ #include #include "fg_internal.h" #include "egl/fg_window_egl.h" +#include "android/fg_main_android.h" /* * Opens a window. Requires a SFG_Window object created and attached @@ -40,19 +41,15 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, GLboolean sizeUse, int w, int h, GLboolean gameMode, GLboolean isSubWindow ) { - printf("fgPlatformOpenWindow %p ID=%d\n", (void*)window, window->ID); - /* TODO: only one full-screen window possible? */ - static int nb_windows = 0; - if (nb_windows == 0) { - nb_windows++; + if (fgDisplay.pDisplay.single_window == NULL) { fgDisplay.pDisplay.single_window = window; - printf("=> %p ID=%d\n", (void*)fgDisplay.pDisplay.single_window, fgDisplay.pDisplay.single_window->ID); } else { + fgWarning("You can't have more than one window on Android"); return; } - fghChooseConfigEGL(&window->Window.pContext.egl.Config); + fghChooseConfig(&window->Window.pContext.egl.Config); window->Window.Context = fghCreateNewContextEGL(window); /* Wait until window is available and OpenGL context is created */ @@ -76,8 +73,8 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, EGLint vid; eglGetConfigAttrib(display, window->Window.pContext.egl.Config, EGL_NATIVE_VISUAL_ID, &vid); - ANativeWindow_setBuffersGeometry(window->Window.Handle, 0, 0, vid); + fghPlatformOpenWindowEGL(window); window->State.Visible = GL_TRUE; @@ -92,11 +89,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 */