When switching to game mode under X11, no ConfigureNotify event will

happen and consequently no reshape callback will ever be called via
the normal mechanism. To fix this, note that the game mode window
needs to be resized and handle this before redraw.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@622 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
spanne 2005-05-24 15:56:04 +00:00
parent d0df3bd759
commit aff9d5e8cc
3 changed files with 8 additions and 6 deletions

View File

@ -1021,3 +1021,8 @@ mouse pointers don't work) on the way:
using a macro. In addition, this avoids any non-constant initializer using a macro. In addition, this avoids any non-constant initializer
issues which might be raised when using WinDoze GCCs. The additional code issues which might be raised when using WinDoze GCCs. The additional code
overhead is negligible, at least for x86 (a few instructions per name). overhead is negligible, at least for x86 (a few instructions per name).
(267) When switching to game mode under X11, no ConfigureNotify event
will happen and consequently no reshape callback will ever be called via
the normal mechanism. To fix this, note that the game mode window needs
to be resized and handle this before redraw.

View File

@ -435,6 +435,7 @@ int FGAPIENTRY glutEnterGameMode( void )
fgStructure.GameMode->State.Width = fgState.GameModeSize.X; fgStructure.GameMode->State.Width = fgState.GameModeSize.X;
fgStructure.GameMode->State.Height = fgState.GameModeSize.Y; fgStructure.GameMode->State.Height = fgState.GameModeSize.Y;
fgStructure.GameMode->State.NeedToResize = GL_TRUE;
fgStructure.GameMode->State.IsGameMode = GL_TRUE; fgStructure.GameMode->State.IsGameMode = GL_TRUE;

View File

@ -104,9 +104,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height )
width, height ); width, height );
XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */ XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE #elif TARGET_HOST_WIN32
#if !TARGET_HOST_WINCE
{ {
RECT winRect; RECT winRect;
int x, y, w, h; int x, y, w, h;
@ -156,7 +154,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height )
SWP_NOZORDER SWP_NOZORDER
); );
} }
#endif /* TARGET_HOST_WINCE */ #endif
/* /*
* XXX Should update {window->State.OldWidth, window->State.OldHeight} * XXX Should update {window->State.OldWidth, window->State.OldHeight}
@ -170,8 +168,6 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height )
glViewport( 0, 0, width, height ); glViewport( 0, 0, width, height );
} }
#endif
/* /*
* Force a window redraw. In Windows at least this is only a partial * Force a window redraw. In Windows at least this is only a partial
* solution: if the window is increasing in size in either dimension, * solution: if the window is increasing in size in either dimension,