pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2794 - in branches/pingus_sdl/src: . gui


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2794 - in branches/pingus_sdl/src: . gui
Date: Sat, 4 Aug 2007 17:42:50 +0200

Author: grumbel
Date: 2007-08-04 17:42:50 +0200 (Sat, 04 Aug 2007)
New Revision: 2794

Modified:
   branches/pingus_sdl/src/global_event.cpp
   branches/pingus_sdl/src/gui/display.cpp
Log:
- fullscreen support (patch by Plouj)

Modified: branches/pingus_sdl/src/global_event.cpp
===================================================================
--- branches/pingus_sdl/src/global_event.cpp    2007-08-04 14:56:20 UTC (rev 
2793)
+++ branches/pingus_sdl/src/global_event.cpp    2007-08-04 15:42:50 UTC (rev 
2794)
@@ -49,17 +49,13 @@
       console << "Toggling fps counter display" << std::endl;
       break;
 
-#if 0
     case SDLK_F11:
-      if (CL_Display::is_fullscreen())
-        CL_Display::set_windowed();
-      else
-        CL_Display::set_fullscreen(CL_Display::get_width(),
-                                   CL_Display::get_height(),
-                                   32);
+      fullscreen_enabled = !fullscreen_enabled;
+      // re-initialize the screen
+      Display::set_video_mode(screen_width, screen_height);
       break;
-#endif
 
+
     case SDLK_F12:
       {
         std::string filename;

Modified: branches/pingus_sdl/src/gui/display.cpp
===================================================================
--- branches/pingus_sdl/src/gui/display.cpp     2007-08-04 14:56:20 UTC (rev 
2793)
+++ branches/pingus_sdl/src/gui/display.cpp     2007-08-04 15:42:50 UTC (rev 
2794)
@@ -75,7 +75,12 @@
 void
 Display::set_video_mode(int width, int height)
 {
-  screen = SDL_SetVideoMode(width, height, 0, SDL_DOUBLEBUF); // | 
SDL_FULLSCREEN
+  if (fullscreen_enabled)
+    {
+      screen = SDL_SetVideoMode(width, height, 0, SDL_FULLSCREEN);
+    } else {
+    screen = SDL_SetVideoMode(width, height, 0, SDL_DOUBLEBUF);
+  }
   if (screen == NULL) {
     printf("Unable to set video mode: %s\n", SDL_GetError());
     exit(1);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]