dcd18d3
diff -up BL_SRC/BlockOut/GLApp/GLApp.cpp~ BL_SRC/BlockOut/GLApp/GLApp.cpp
dcd18d3
--- BL_SRC/BlockOut/GLApp/GLApp.cpp~	2014-05-06 11:47:55.000000000 +0200
dcd18d3
+++ BL_SRC/BlockOut/GLApp/GLApp.cpp	2014-10-27 13:26:09.726477105 +0100
dcd18d3
@@ -63,22 +63,8 @@ int GLApplication::SetVideoMode() {
0d6c31a
 
0d6c31a
 int GLApplication::ToggleFullscreen() {
0d6c31a
 
0d6c31a
-  int errCode;
0d6c31a
-
0d6c31a
-  InvalidateDeviceObjects();
0d6c31a
-
0d6c31a
-  m_bWindowed = !m_bWindowed;
0d6c31a
-
dcd18d3
-  if( !SetVideoMode() ) return GL_FAIL;
0d6c31a
-
0d6c31a
-  SDL_Surface *vSurf = SDL_GetVideoSurface();
0d6c31a
-  m_bitsPerPixel = vSurf->format->BitsPerPixel;
0d6c31a
-
0d6c31a
-  errCode = RestoreDeviceObjects();
dcd18d3
-  if( !errCode ) {
dcd18d3
-    printGlError();
dcd18d3
-    exit(1);
dcd18d3
-  }
0d6c31a
+  if (SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
0d6c31a
+    m_bWindowed = !m_bWindowed;
0d6c31a
 
0d6c31a
   return GL_OK;
0d6c31a
     
dcd18d3
@@ -114,6 +100,8 @@ int GLApplication::Create(int width, int
dcd18d3
 	return GL_FAIL;    
0d6c31a
   }
dcd18d3
 
0d6c31a
+  atexit(SDL_Quit);
dcd18d3
+
dcd18d3
   SDL_WM_SetCaption(m_strWindowTitle, NULL);
0d6c31a
 
0d6c31a
   //SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
dcd18d3
diff -up BL_SRC/BlockOut/BlockOut.cpp~ BL_SRC/BlockOut/BlockOut.cpp
dcd18d3
--- BL_SRC/BlockOut/BlockOut.cpp~	2014-05-06 11:47:54.000000000 +0200
dcd18d3
+++ BL_SRC/BlockOut/BlockOut.cpp	2014-10-27 13:23:44.333304949 +0100
dcd18d3
@@ -145,12 +145,7 @@ int BlockOut::FrameMove()
0d6c31a
           break;
0d6c31a
         case 100: // Exit
0d6c31a
           InvalidateDeviceObjects();
1154e8c
-          BOOL fs = theSetup.GetFullScreen();
1154e8c
-          if (fs) {
1154e8c
-            theSetup.SetFullScreen(!fs);
1154e8c
-            UpdateFullScreen();
1154e8c
-          }  
0d6c31a
-          _exit(0);
0d6c31a
+          exit(0);
0d6c31a
           break;
0d6c31a
       }
0d6c31a
       break;