From 4de23ad628e1462129677ba535b50fbe4550f545 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 20 Nov 2004 13:04:26 +0000 Subject: [PATCH] Melchior FRANZ: Use a suggested exit method as described in the SDL_Quit man page. (fgOSExit() is still uncalled in both fg_os.cxx (glut) and fg_os_sdl.cxx, which makes these functions kind-of useless.) The other changes are fixes for gcc 3.3.4 warnings. --- src/Main/fg_os_sdl.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Main/fg_os_sdl.cxx b/src/Main/fg_os_sdl.cxx index 99f93056c..318c7d3b9 100644 --- a/src/Main/fg_os_sdl.cxx +++ b/src/Main/fg_os_sdl.cxx @@ -70,6 +70,7 @@ void fgOSOpenWindow(int w, int h, int bpp, if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) == -1) throw sg_throwable(string("Failed to initialize SDL: ") + SDL_GetError()); + atexit(SDL_Quit); SDL_WM_SetCaption("FlightGear", "FlightGear"); @@ -175,12 +176,9 @@ static void handleKey(int key, int raw, int keyup) (*KeyHandler)(key, keymod, CurrentMouseX, CurrentMouseY); } -// FIXME: need to export this and get the rest of FlightGear to use -// it, the SDL hook is required to do things like reset the video -// mode and key repeat. Integrate with existing fgExit() in util.cxx. +// FIXME: Integrate with existing fgExit() in util.cxx. void fgOSExit(int code) { - SDL_Quit(); exit(code); } @@ -341,7 +339,7 @@ void fgSetMouseCursor(int cursor) return; } SDL_ShowCursor(SDL_ENABLE); - for(int i=0; i