X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fegl%2Ffg_init_egl.c;h=3c83fb2a2d7b0e533e896b56025d0ee916f05e12;hb=7ce62fee66f89db514ed1b80e6c3aa287a2f8d74;hp=54b510eeee217f335b04199c315713188652b51f;hpb=82334dc23620f76b257acaffcd84ffbb8386872c;p=freeglut diff --git a/src/egl/fg_init_egl.c b/src/egl/fg_init_egl.c index 54b510e..3c83fb2 100644 --- a/src/egl/fg_init_egl.c +++ b/src/egl/fg_init_egl.c @@ -1,5 +1,5 @@ /* - * freeglut_init_egl.c + * fg_init_egl.c * * Various freeglut initialization functions. * @@ -34,12 +34,17 @@ void fghPlatformInitializeEGL() { /* CreateDisplay */ /* Using EGL_DEFAULT_DISPLAY, or a specific native display */ +#ifdef FREEGLUT_WAYLAND + fgDisplay.pDisplay.egl.Display = eglGetDisplay( + (EGLNativeDisplayType)fgDisplay.pDisplay.display); +#else EGLNativeDisplayType nativeDisplay = EGL_DEFAULT_DISPLAY; fgDisplay.pDisplay.egl.Display = eglGetDisplay(nativeDisplay); +#endif FREEGLUT_INTERNAL_ERROR_EXIT(fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY, "No display available", "fgPlatformInitialize"); - if (eglInitialize(fgDisplay.pDisplay.egl.Display, NULL, NULL) != EGL_TRUE) + 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 +53,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 +64,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; } }