X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_init_x11.c;h=0df54f2573bfc5481fa7efe385fb9b9f5e3352a8;hb=9b7930fcbb8dde80f9b6de15bf184f7dce1adb1f;hp=83fe2871552a7909e04e28e25aca361ffa249e60;hpb=5b3d339481bac6dbaeb599bffc1325f716585bfe;p=freeglut diff --git a/src/x11/fg_init_x11.c b/src/x11/fg_init_x11.c index 83fe287..0df54f2 100644 --- a/src/x11/fg_init_x11.c +++ b/src/x11/fg_init_x11.c @@ -29,7 +29,9 @@ #define FREEGLUT_BUILDING_LIB #include /* LONG_MAX */ #include -#include "../fg_internal.h" +#include "fg_internal.h" +#include "fg_init.h" +#include "egl/fg_init_egl.h" /* Return the atom associated with "name". */ static Atom fghGetAtom(const char * name) @@ -174,9 +176,13 @@ void fgPlatformInitialize( const char* displayName ) if( fgDisplay.pDisplay.Display == NULL ) fgError( "failed to open display '%s'", XDisplayName( displayName ) ); +#ifdef EGL_VERSION_1_0 + fghPlatformInitializeEGL(); +#else if( !glXQueryExtension( fgDisplay.pDisplay.Display, NULL, NULL ) ) fgError( "OpenGL GLX extension not supported by display '%s'", XDisplayName( displayName ) ); +#endif fgDisplay.pDisplay.Screen = DefaultScreen( fgDisplay.pDisplay.Display ); fgDisplay.pDisplay.RootWindow = RootWindow( @@ -232,6 +238,9 @@ void fgPlatformInitialize( const char* displayName ) } } + /* Get start time */ + fgState.Time = fgSystemTime(); + fgState.Initialised = GL_TRUE; @@ -266,8 +275,10 @@ void fgPlatformCloseDisplay ( void ) } +#ifndef EGL_VERSION_1_0 void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext ) { /* Note that the MVisualInfo is not owned by the MenuContext! */ glXDestroyContext( pDisplay.Display, MContext ); } +#endif