| 1 |
diff -up BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp.fs BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp
|
| 2 |
--- BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp.fs 2007-08-02 15:44:10.000000000 +0200
|
| 3 |
+++ BlockOutII-2.3/BlockOut_GL/GLApp/GLApp.cpp 2007-11-30 20:46:53.000000000 +0100
|
| 4 |
@@ -20,30 +20,8 @@ GLApplication::GLApplication() {
|
| 5 |
|
| 6 |
int GLApplication::ToggleFullscreen() {
|
| 7 |
|
| 8 |
- int errCode;
|
| 9 |
-
|
| 10 |
- InvalidateDeviceObjects();
|
| 11 |
-
|
| 12 |
- m_bWindowed = !m_bWindowed;
|
| 13 |
-
|
| 14 |
- Uint32 flags;
|
| 15 |
- if( m_bWindowed ) flags = SDL_OPENGL;
|
| 16 |
- else flags = SDL_OPENGL | SDL_FULLSCREEN;
|
| 17 |
-
|
| 18 |
- if( SDL_SetVideoMode( m_screenWidth, m_screenHeight, 0, flags ) == NULL )
|
| 19 |
- {
|
| 20 |
- printf("SDL_SetVideoMode() failed.\n");
|
| 21 |
- return GL_FAIL;
|
| 22 |
- }
|
| 23 |
-
|
| 24 |
- SDL_Surface *vSurf = SDL_GetVideoSurface();
|
| 25 |
- m_bitsPerPixel = vSurf->format->BitsPerPixel;
|
| 26 |
-
|
| 27 |
- errCode = RestoreDeviceObjects();
|
| 28 |
- if( !errCode ) {
|
| 29 |
- printGlError();
|
| 30 |
- exit(1);
|
| 31 |
- }
|
| 32 |
+ if (SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
|
| 33 |
+ m_bWindowed = !m_bWindowed;
|
| 34 |
|
| 35 |
return GL_OK;
|
| 36 |
|
| 37 |
@@ -69,6 +47,8 @@ int GLApplication::Create(int width, int
|
| 38 |
printf("SDL_Init() failed : %s\n" , SDL_GetError() );
|
| 39 |
return GL_FAIL;
|
| 40 |
}
|
| 41 |
+
|
| 42 |
+ atexit(SDL_Quit);
|
| 43 |
|
| 44 |
//SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
|
| 45 |
SDL_EnableUNICODE( 1 );
|
| 46 |
diff -up BlockOutII-2.3/BlockOut_GL/BlockOut.cpp.fs BlockOutII-2.3/BlockOut_GL/BlockOut.cpp
|
| 47 |
--- BlockOutII-2.3/BlockOut_GL/BlockOut.cpp.fs 2007-08-02 15:44:09.000000000 +0200
|
| 48 |
+++ BlockOutII-2.3/BlockOut_GL/BlockOut.cpp 2007-11-30 20:44:24.000000000 +0100
|
| 49 |
@@ -120,7 +120,7 @@ int BlockOut::FrameMove()
|
| 50 |
break;
|
| 51 |
case 100: // Exit
|
| 52 |
InvalidateDeviceObjects();
|
| 53 |
- _exit(0);
|
| 54 |
+ exit(0);
|
| 55 |
break;
|
| 56 |
}
|
| 57 |
break;
|