[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30437] branches/soc-2010-nexyon/source/ blender/windowmanager: Autoplay: Fullscreen now really works.

Joerg Mueller nexyon at gmail.com
Sat Jul 17 16:23:21 CEST 2010


Revision: 30437
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30437
Author:   nexyon
Date:     2010-07-17 16:23:21 +0200 (Sat, 17 Jul 2010)

Log Message:
-----------
Autoplay: Fullscreen now really works.

Modified Paths:
--------------
    branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_init_exit.c
    branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_window.c
    branches/soc-2010-nexyon/source/blender/windowmanager/wm_window.h

Modified: branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_init_exit.c	2010-07-17 13:45:25 UTC (rev 30436)
+++ branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_init_exit.c	2010-07-17 14:23:21 UTC (rev 30437)
@@ -95,6 +95,7 @@
 
 #include "BKE_depsgraph.h"
 #include "BKE_sound.h"
+#include "GHOST_C-api.h"
 
 static void wm_init_reports(bContext *C)
 {
@@ -264,9 +265,15 @@
 		/* Fullscreen */
 		if(scene->gm.fullscreen) {
 			WM_operator_name_call(C, "WM_OT_window_fullscreen_toggle", WM_OP_EXEC_DEFAULT, NULL);
-			ar->winrct.ymax = win->sizey;
-			ar->winrct.xmax = win->sizex;
+			wm_get_screensize(&ar->winrct.xmax, &ar->winrct.ymax);
 		}
+		else
+		{
+			GHOST_RectangleHandle rect = GHOST_GetClientBounds(win->ghostwin);
+			ar->winrct.ymax = GHOST_GetHeightRectangle(rect);
+			ar->winrct.xmax = GHOST_GetWidthRectangle(rect);
+			GHOST_DisposeRectangle(rect);
+		}
 
 		WM_operator_name_call(C, "VIEW3D_OT_game_start", WM_OP_EXEC_DEFAULT, NULL);
 

Modified: branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_window.c
===================================================================
--- branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_window.c	2010-07-17 13:45:25 UTC (rev 30436)
+++ branches/soc-2010-nexyon/source/blender/windowmanager/intern/wm_window.c	2010-07-17 14:23:21 UTC (rev 30437)
@@ -73,7 +73,7 @@
 
 /* XXX this one should correctly check for apple top header...
  done for Cocoa : returns window contents (and not frame) max size*/
-static void wm_get_screensize(int *width_r, int *height_r) 
+void wm_get_screensize(int *width_r, int *height_r)
 {
 	unsigned int uiwidth;
 	unsigned int uiheight;

Modified: branches/soc-2010-nexyon/source/blender/windowmanager/wm_window.h
===================================================================
--- branches/soc-2010-nexyon/source/blender/windowmanager/wm_window.h	2010-07-17 13:45:25 UTC (rev 30436)
+++ branches/soc-2010-nexyon/source/blender/windowmanager/wm_window.h	2010-07-17 14:23:21 UTC (rev 30437)
@@ -36,6 +36,8 @@
 void		wm_ghost_init			(bContext *C);
 void		wm_ghost_exit(void);
 
+void wm_get_screensize(int *width_r, int *height_r);
+
 wmWindow	*wm_window_new			(bContext *C);
 void		wm_window_free			(bContext *C, wmWindowManager *wm, wmWindow *win);
 void		wm_window_close			(bContext *C, wmWindowManager *wm, wmWindow *win);





More information about the Bf-blender-cvs mailing list