From c91e543783ddfd7c68a2120e7e4451b5c01a26aa Mon Sep 17 00:00:00 2001 From: Sven Panne Date: Tue, 24 May 2005 15:56:04 +0000 Subject: [PATCH] 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@622 7f0cb862-5218-0410-a997-914c9d46530a --- ChangeLog | 5 +++++ src/freeglut_gamemode.c | 1 + src/freeglut_main.c | 8 ++------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4edf90d..3259282 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1021,3 +1021,8 @@ mouse pointers don't work) on the way: using a macro. In addition, this avoids any non-constant initializer issues which might be raised when using WinDoze GCCs. The additional code 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. diff --git a/src/freeglut_gamemode.c b/src/freeglut_gamemode.c index 487117c..087212e 100644 --- a/src/freeglut_gamemode.c +++ b/src/freeglut_gamemode.c @@ -435,6 +435,7 @@ int FGAPIENTRY glutEnterGameMode( void ) fgStructure.GameMode->State.Width = fgState.GameModeSize.X; fgStructure.GameMode->State.Height = fgState.GameModeSize.Y; + fgStructure.GameMode->State.NeedToResize = GL_TRUE; fgStructure.GameMode->State.IsGameMode = GL_TRUE; diff --git a/src/freeglut_main.c b/src/freeglut_main.c index da13c94..5cb91ad 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -104,9 +104,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height ) width, height ); XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */ -#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE - -#if !TARGET_HOST_WINCE +#elif TARGET_HOST_WIN32 { RECT winRect; int x, y, w, h; @@ -156,7 +154,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height ) SWP_NOZORDER ); } -#endif /* TARGET_HOST_WINCE */ +#endif /* * 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 ); } -#endif - /* * Force a window redraw. In Windows at least this is only a partial * solution: if the window is increasing in size in either dimension, -- 1.7.10.4