[Sugar-devel] [PATCH Pippy] Run graphics (pygame) examples in full screen mode (OLPC#10688)

Sascha Silbe silbe at activitycentral.com
Thu Mar 3 06:45:12 EST 2011


From: Sascha Silbe <sascha-pgp at silbe.org>

Sugar < 0.86 used a special window manager that put every window in full
screen mode automatically. To achieve the same with "regular" window managers
like we use in Sugar 0.86+, we need to tell pygame that we want full screen
mode.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 data/graphics/bounce    |    2 +-
 data/graphics/camera    |    2 +-
 data/graphics/lines     |    2 +-
 data/graphics/physics   |    2 +-
 data/graphics/pong      |    2 +-
 data/graphics/snow      |    2 +-
 data/graphics/tree      |    2 +-
 data/graphics/xolympics |    2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/data/graphics/bounce b/data/graphics/bounce
index 375d530..74b87dd 100644
--- a/data/graphics/bounce
+++ b/data/graphics/bounce
@@ -22,7 +22,7 @@ pygame.mouse.set_visible(False)
 
 # create the window and keep track of the surface
 # for drawing into
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # ask for screen's width and height
 size = width, height = screen.get_size()
diff --git a/data/graphics/camera b/data/graphics/camera
index f0eb35f..2a37675 100644
--- a/data/graphics/camera
+++ b/data/graphics/camera
@@ -21,7 +21,7 @@ pygame.mouse.set_visible(False)
 
 # create the pygame window and return a Surface object for
 # drawing in that window.
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # pause for a second to allow the camera frame to be grabbed
 time.sleep(1)
diff --git a/data/graphics/lines b/data/graphics/lines
index 5699719..bd559a6 100644
--- a/data/graphics/lines
+++ b/data/graphics/lines
@@ -14,7 +14,7 @@ pygame.mouse.set_visible(False)
 
 # create the window and keep track of the surface
 # for drawing into
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # ask for screen's width and height
 size = width, height = screen.get_size()
diff --git a/data/graphics/physics b/data/graphics/physics
index 3d57a06..08aa696 100644
--- a/data/graphics/physics
+++ b/data/graphics/physics
@@ -9,7 +9,7 @@ from pippy import physics
 
 # initialize pygame first thing
 pygame.init()
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # set up the physics world (instance of Elements)
 world = physics.Elements(screen.get_size())
diff --git a/data/graphics/pong b/data/graphics/pong
index 8182861..9134f53 100644
--- a/data/graphics/pong
+++ b/data/graphics/pong
@@ -16,7 +16,7 @@ pygame.init()
 
 # create the window and keep track of the surface
 # for drawing into
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # ask for screen's width and height
 size = width, height = screen.get_size()
diff --git a/data/graphics/snow b/data/graphics/snow
index af8abf9..e1b2df1 100644
--- a/data/graphics/snow
+++ b/data/graphics/snow
@@ -11,7 +11,7 @@ pygame.init()
 
 # create the window and keep track of the surface
 # for drawing into
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # ask for screen's width and height
 width, height = screen.get_size()
diff --git a/data/graphics/tree b/data/graphics/tree
index 04996f7..5a56620 100644
--- a/data/graphics/tree
+++ b/data/graphics/tree
@@ -12,7 +12,7 @@ pygame.init()
 
 # create the window and keep track of the surface
 # for drawing into
-screen = pygame.display.set_mode()
+screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
 
 # ask for screen's width and height
 width, height = screen.get_size()
diff --git a/data/graphics/xolympics b/data/graphics/xolympics
index b6ed90b..51be828 100644
--- a/data/graphics/xolympics
+++ b/data/graphics/xolympics
@@ -30,7 +30,7 @@ class XOlympicsGame:
         self.rightJump = False
         self.updateList = []
 
-        self.screen = pygame.display.set_mode()
+        self.screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
         self.width, self.height = self.screen.get_size()
 
         self.clock = pygame.time.Clock()
-- 
1.7.2.3



More information about the Sugar-devel mailing list