/*
- * freeglut_window_android.c
+ * fg_window_android.c
*
* Window management methods for Android
*
#include <GL/freeglut.h>
#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
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++;
fgDisplay.pDisplay.single_window = window;
- printf("=> %p ID=%d\n", (void*)fgDisplay.pDisplay.single_window, fgDisplay.pDisplay.single_window->ID);
} else {
return;
}
- fghChooseConfigEGL(&window->Window.pContext.egl.Config);
- fghCreateNewContextEGL(window);
+ fghChooseConfig(&window->Window.pContext.egl.Config);
+ window->Window.Context = fghCreateNewContextEGL(window);
/* Wait until window is available and OpenGL context is created */
/* Normally events are processed through glutMainLoop(), but the
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;
/* 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
*/