/*
- * freeglut_init_android.c
+ * fg_init_egl.c
*
* Various freeglut initialization functions.
*
#include <GL/freeglut.h>
#include "fg_internal.h"
-#include <android/native_app_glue/android_native_app_glue.h>
-
/*
* A call to this function should initialize all the display stuff...
*/
-void fgPlatformInitialize( const char* displayName )
+void fghPlatformInitializeEGL()
{
- fprintf(stderr, "fgPlatformInitialize\n");
- fgState.Initialised = GL_TRUE;
-
/* CreateDisplay */
/* Using EGL_DEFAULT_DISPLAY, or a specific native display */
EGLNativeDisplayType nativeDisplay = EGL_DEFAULT_DISPLAY;
FREEGLUT_INTERNAL_ERROR_EXIT(fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY,
"No display available", "fgPlatformInitialize");
- if (!eglInitialize(fgDisplay.pDisplay.egl.Display, NULL, NULL))
+ if (eglInitialize(fgDisplay.pDisplay.egl.Display, &fgDisplay.pDisplay.egl.MajorVersion, &fgDisplay.pDisplay.egl.MinorVersion) != EGL_TRUE)
fgError("eglInitialize: error %x\n", eglGetError());
# ifdef GL_VERSION_1_1 /* or later */
eglBindAPI(EGL_OPENGL_ES_API);
# endif
- // fgDisplay.ScreenWidth = ...;
- // fgDisplay.ScreenHeight = ...;
- // fgDisplay.ScreenWidthMM = ...;
- // fgDisplay.ScreenHeightMM = ...;
+ /* fgDisplay.ScreenWidth = ...; */
+ /* fgDisplay.ScreenHeight = ...; */
+ /* fgDisplay.ScreenWidthMM = ...; */
+ /* fgDisplay.ScreenHeightMM = ...; */
}
-void fgPlatformCloseDisplay ( void )
+void fghPlatformCloseDisplayEGL()
{
if (fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY) {
eglTerminate(fgDisplay.pDisplay.egl.Display);
fgDisplay.pDisplay.egl.Display = EGL_NO_DISPLAY;
+ fgDisplay.pDisplay.egl.MajorVersion = 0;
+ fgDisplay.pDisplay.egl.MinorVersion = 0;
}
}