Browse Source

Fixed love.window.setFullscreen to update the graphics viewport immediately instead of waiting for the next event polling

Alex Szpakowski 11 years ago
parent
commit
101c6ae90a
3 changed files with 6 additions and 3 deletions
  1. 6 0
      src/modules/window/sdl/Window.cpp
  2. 0 1
      src/scripts/boot.lua
  3. 0 2
      src/scripts/boot.lua.h

+ 6 - 0
src/modules/window/sdl/Window.cpp

@@ -358,6 +358,12 @@ bool Window::setFullscreen(bool fullscreen, Window::FullscreenType fstype)
 	{
 	{
 		SDL_GL_MakeCurrent(window, context);
 		SDL_GL_MakeCurrent(window, context);
 		updateAttributes(newattribs);
 		updateAttributes(newattribs);
+
+		// Update the viewport size now instead of waiting for event polling.
+		graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
+		if (gfx)
+			gfx->setViewportSize(curMode.width, curMode.height);
+
 		return true;
 		return true;
 	}
 	}
 
 

+ 0 - 1
src/scripts/boot.lua

@@ -278,7 +278,6 @@ function love.init()
 	-- will NOT make it load, see below.
 	-- will NOT make it load, see below.
 	local c = {
 	local c = {
 		title = "Untitled",
 		title = "Untitled",
-		author = "Unnamed",
 		version = love._version,
 		version = love._version,
 		window = {
 		window = {
 			width = 800,
 			width = 800,

+ 0 - 2
src/scripts/boot.lua.h

@@ -504,8 +504,6 @@ const unsigned char boot_lua[] =
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x20, 0x3d, 0x20, 0x7b, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x20, 0x3d, 0x20, 0x7b, 0x0a,
 	0x09, 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x55, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 
 	0x09, 0x09, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x55, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 
 	0x64, 0x22, 0x2c, 0x0a,
 	0x64, 0x22, 0x2c, 0x0a,
-	0x09, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x22, 0x55, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 
-	0x64, 0x22, 0x2c, 0x0a,
 	0x09, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 
 	0x09, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 
 	0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x0a,
 	0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x0a,
 	0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x7b, 0x0a,
 	0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x7b, 0x0a,