X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fegl%2Ffg_init_egl.c;fp=src%2Fegl%2Ffg_init_egl.c;h=1bd4b14b6051a0f56da28c71ffdd8bd31a9f3171;hb=d1cccef518bc222b3733706aa1e5776c6cb9fec9;hp=a58812a4e5e8f8f845df594ad5d59afc62ed1423;hpb=e194bd1249867a1119e9e3f37e4e1a9886e956bc;p=freeglut diff --git a/src/egl/fg_init_egl.c b/src/egl/fg_init_egl.c index a58812a..1bd4b14 100644 --- a/src/egl/fg_init_egl.c +++ b/src/egl/fg_init_egl.c @@ -40,16 +40,13 @@ void fgPlatformInitialize( const char* displayName ) /* CreateDisplay */ /* Using EGL_DEFAULT_DISPLAY, or a specific native display */ EGLNativeDisplayType nativeDisplay = EGL_DEFAULT_DISPLAY; - fgDisplay.pDisplay.eglDisplay = eglGetDisplay(nativeDisplay); + fgDisplay.pDisplay.egl.Display = eglGetDisplay(nativeDisplay); - FREEGLUT_INTERNAL_ERROR_EXIT(fgDisplay.pDisplay.eglDisplay != EGL_NO_DISPLAY, + FREEGLUT_INTERNAL_ERROR_EXIT(fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY, "No display available", "fgPlatformInitialize"); - if (!eglInitialize(fgDisplay.pDisplay.eglDisplay, NULL, NULL)) + if (!eglInitialize(fgDisplay.pDisplay.egl.Display, NULL, NULL)) fgError("eglInitialize: error %x\n", eglGetError()); - /* CreateContext */ - fghCreateContext(); - // fgDisplay.ScreenWidth = ...; // fgDisplay.ScreenHeight = ...; // fgDisplay.ScreenWidthMM = ...; @@ -58,15 +55,9 @@ void fgPlatformInitialize( const char* displayName ) void fgPlatformCloseDisplay ( void ) { - eglMakeCurrent(fgDisplay.pDisplay.eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (fgDisplay.pDisplay.eglContext != EGL_NO_CONTEXT) { - eglDestroyContext(fgDisplay.pDisplay.eglDisplay, fgDisplay.pDisplay.eglContext); - fgDisplay.pDisplay.eglContext = EGL_NO_CONTEXT; - } - - if (fgDisplay.pDisplay.eglDisplay != EGL_NO_DISPLAY) { - eglTerminate(fgDisplay.pDisplay.eglDisplay); - fgDisplay.pDisplay.eglDisplay = EGL_NO_DISPLAY; + if (fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY) { + eglTerminate(fgDisplay.pDisplay.egl.Display); + fgDisplay.pDisplay.egl.Display = EGL_NO_DISPLAY; } } @@ -76,5 +67,5 @@ void fgPlatformCloseDisplay ( void ) void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext ) { if (MContext != EGL_NO_CONTEXT) - eglDestroyContext(pDisplay.eglDisplay, MContext); + eglDestroyContext(pDisplay.egl.Display, MContext); }