updated the readme file, and removed out of date and unmaintained files from the...
[freeglut] / src / egl / fg_init_egl.c
index 0cd53fe..f0889a6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * freeglut_init_egl.c
+ * fg_init_egl.c
  *
  * Various freeglut initialization functions.
  *
@@ -39,7 +39,7 @@ void fghPlatformInitializeEGL()
 
   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 */
@@ -48,10 +48,10 @@ void fghPlatformInitializeEGL()
   eglBindAPI(EGL_OPENGL_ES_API);
 # endif
 
-  // fgDisplay.ScreenWidth = ...;
-  // fgDisplay.ScreenHeight = ...;
-  // fgDisplay.ScreenWidthMM = ...;
-  // fgDisplay.ScreenHeightMM = ...;
+  /* fgDisplay.ScreenWidth = ...; */
+  /* fgDisplay.ScreenHeight = ...; */
+  /* fgDisplay.ScreenWidthMM = ...; */
+  /* fgDisplay.ScreenHeightMM = ...; */
 }
 
 void fghPlatformCloseDisplayEGL()
@@ -59,6 +59,8 @@ 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;
   }
 }