Autoplay: Fullscreen now really works.
authorJoerg Mueller <nexyon@gmail.com>
Sat, 17 Jul 2010 14:23:21 +0000 (14:23 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Sat, 17 Jul 2010 14:23:21 +0000 (14:23 +0000)
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_window.h

index fe3172f..45c851a 100644 (file)
@@ -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,8 +265,14 @@ int WM_init_game(bContext *C)
                /* 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);
index e4bb5b7..4523446 100644 (file)
@@ -73,7 +73,7 @@ static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0;
 
 /* 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;
index fa24403..d57fd0e 100644 (file)
@@ -36,6 +36,8 @@ struct wmOperator;
 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);