X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffreeglut_window.c;h=fc9fc55d0055dabe666329941c7dc149579bdef4;hb=d4846df601fa224353c65fa332f603a85735b5d8;hp=800342d2f8a04f8c94aaca97530608061acd2d00;hpb=8833b224162c6e3c8491a89e77fcfd5f79bdff39;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 800342d..fc9fc55 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -1316,6 +1316,12 @@ void fgOpenWindow( SFG_Window* window, const char* title, */ void fgCloseWindow( SFG_Window* window ) { + /* if we're in gamemode, call glutLeaveGameMode first to make sure the + * gamemode is properly closed before closing the window + */ + if (fgStructure.GameModeWindow != NULL) + glutLeaveGameMode(); + #if TARGET_HOST_POSIX_X11 if( window->Window.Context )