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