X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_window.c;h=09fcddfe66b55e1489c55ccc1bd6fcc4f9b2f717;hb=aac83a54229f999e8c4597e7bd9e81b3633bedcb;hp=d24f7cd86c88107158a4dbfadc5e0d213d423a0a;hpb=26913c37ab4ecff6a3d43c1e1dfcd58141079e60;p=freeglut diff --git a/src/fg_window.c b/src/fg_window.c index d24f7cd..09fcddf 100644 --- a/src/fg_window.c +++ b/src/fg_window.c @@ -1,5 +1,5 @@ /* - * freeglut_window.c + * fg_window.c * * Window management methods. * @@ -106,7 +106,7 @@ void fghContextCreationError( void ) */ void fgSetWindow ( SFG_Window *window ) { - fgPlatformSetWindow ( window ); + fgPlatformSetWindow ( window ); fgStructure.CurrentWindow = window; } @@ -127,15 +127,19 @@ void fgOpenWindow( SFG_Window* window, const char* title, fgSetWindow( window ); +#ifndef EGL_VERSION_1_0 window->Window.DoubleBuffered = ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0; -#ifndef EGL_VERSION_1_0 /* No glDrawBuffer/glReadBuffer in GLES */ if ( ! window->Window.DoubleBuffered ) { glDrawBuffer ( GL_FRONT ); glReadBuffer ( GL_FRONT ); } +#else + /* - EGL is always double-buffered */ + /* - No glDrawBuffer/glReadBuffer in GLES */ + window->Window.DoubleBuffered = 1; #endif window->Window.attribute_v_coord = -1; window->Window.attribute_v_normal = -1; @@ -158,7 +162,7 @@ void fgCloseWindow( SFG_Window* window ) if (fgStructure.GameModeWindow != NULL && fgStructure.GameModeWindow->ID==window->ID) glutLeaveGameMode(); - fgPlatformCloseWindow ( window ); + fgPlatformCloseWindow ( window ); } @@ -295,7 +299,7 @@ void FGAPIENTRY glutShowWindow( void ) fgStructure.CurrentWindow->State.WorkMask |= GLUT_VISIBILITY_WORK; fgStructure.CurrentWindow->State.DesiredVisibility = DesireNormalState; - fgStructure.CurrentWindow->State.Redisplay = GL_TRUE; + fgStructure.CurrentWindow->State.WorkMask |= GLUT_DISPLAY_WORK; } /* @@ -309,7 +313,7 @@ void FGAPIENTRY glutHideWindow( void ) fgStructure.CurrentWindow->State.WorkMask |= GLUT_VISIBILITY_WORK; fgStructure.CurrentWindow->State.DesiredVisibility = DesireHiddenState; - fgStructure.CurrentWindow->State.Redisplay = GL_FALSE; + fgStructure.CurrentWindow->State.WorkMask &= ~GLUT_DISPLAY_WORK; } /* @@ -323,7 +327,7 @@ void FGAPIENTRY glutIconifyWindow( void ) fgStructure.CurrentWindow->State.WorkMask |= GLUT_VISIBILITY_WORK; fgStructure.CurrentWindow->State.DesiredVisibility = DesireIconicState; - fgStructure.CurrentWindow->State.Redisplay = GL_FALSE; + fgStructure.CurrentWindow->State.WorkMask &= ~GLUT_DISPLAY_WORK; } /* @@ -335,7 +339,7 @@ void FGAPIENTRY glutSetWindowTitle( const char* title ) FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetWindowTitle" ); if( ! fgStructure.CurrentWindow->Parent ) { - fgPlatformGlutSetWindowTitle ( title ); + fgPlatformGlutSetWindowTitle ( title ); } } @@ -349,7 +353,7 @@ void FGAPIENTRY glutSetIconTitle( const char* title ) if( ! fgStructure.CurrentWindow->Parent ) { - fgPlatformGlutSetIconTitle ( title ); + fgPlatformGlutSetIconTitle ( title ); } } @@ -445,7 +449,7 @@ void FGAPIENTRY glutFullScreen( void ) } if (!win->State.IsFullscreen) - win->State.WorkMask |= GLUT_FULL_SCREEN_WORK; + win->State.WorkMask |= GLUT_FULL_SCREEN_WORK; } /*