8ba2cc8
diff -up BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp.fs BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp
8ba2cc8
--- BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp.fs	2007-08-02 15:44:10.000000000 +0200
8ba2cc8
+++ BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp	2007-11-30 20:46:53.000000000 +0100
8ba2cc8
@@ -20,30 +20,8 @@ GLApplication::GLApplication() {
8ba2cc8
 
8ba2cc8
 int GLApplication::ToggleFullscreen() {
8ba2cc8
 
8ba2cc8
-  int errCode;
8ba2cc8
-
8ba2cc8
-  InvalidateDeviceObjects();
8ba2cc8
-
8ba2cc8
-  m_bWindowed = !m_bWindowed;
8ba2cc8
-
8ba2cc8
-  Uint32 flags;
8ba2cc8
-  if( m_bWindowed ) flags = SDL_OPENGL;
8ba2cc8
-  else              flags = SDL_OPENGL | SDL_FULLSCREEN;
8ba2cc8
-
8ba2cc8
-  if( SDL_SetVideoMode( m_screenWidth, m_screenHeight, 0, flags ) == NULL )
8ba2cc8
-  {
8ba2cc8
-    printf("SDL_SetVideoMode() failed.\n");
8ba2cc8
-    return GL_FAIL;
8ba2cc8
-  }
8ba2cc8
-
8ba2cc8
-  SDL_Surface *vSurf = SDL_GetVideoSurface();
8ba2cc8
-  m_bitsPerPixel = vSurf->format->BitsPerPixel;
8ba2cc8
-
8ba2cc8
-  errCode = RestoreDeviceObjects();
8ba2cc8
-	if( !errCode ) {
8ba2cc8
-		printGlError();
8ba2cc8
-		exit(1);
8ba2cc8
-	}
8ba2cc8
+  if (SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
8ba2cc8
+    m_bWindowed = !m_bWindowed;
8ba2cc8
 
8ba2cc8
   return GL_OK;
8ba2cc8
     
8ba2cc8
@@ -69,6 +47,8 @@ int GLApplication::Create(int width, int
8ba2cc8
     printf("SDL_Init() failed : %s\n" , SDL_GetError() );
8ba2cc8
     return GL_FAIL;    
8ba2cc8
   }
8ba2cc8
+  
8ba2cc8
+  atexit(SDL_Quit);
8ba2cc8
 
8ba2cc8
   //SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
8ba2cc8
   SDL_EnableUNICODE( 1 );
8ba2cc8
diff -up BlockOutII-2.3/BlockOut_GL/BlockOut.cpp.fs BlockOutII-2.3/BlockOut_GL/BlockOut.cpp
8ba2cc8
--- BlockOutII-2.3/BlockOut_GL/BlockOut.cpp.fs	2007-08-02 15:44:09.000000000 +0200
8ba2cc8
+++ BlockOutII-2.3/BlockOut_GL/BlockOut.cpp	2007-11-30 20:44:24.000000000 +0100
8ba2cc8
@@ -120,7 +120,7 @@ int BlockOut::FrameMove()
8ba2cc8
           break;
8ba2cc8
         case 100: // Exit
8ba2cc8
           InvalidateDeviceObjects();
8ba2cc8
-          _exit(0);
8ba2cc8
+          exit(0);
8ba2cc8
           break;
8ba2cc8
       }
8ba2cc8
       break;