From 9e79a6222f7b3df073ad1f4244f400a22a9f92c8 Mon Sep 17 00:00:00 2001 From: Rob Haarsma Date: Mon, 5 May 2003 10:51:52 +0000 Subject: added fullscreen command line switch on Win32 -W written by Florian Eggenberger. --- source/blender/include/BIF_screen.h | 1 + source/blender/src/editscreen.c | 15 ++++++++++++--- source/blender/src/ghostwinlay.c | 6 ++++-- source/creator/creator.c | 1 + 4 files changed, 18 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h index 416df442e7c..7c61896cd7f 100644 --- a/source/blender/include/BIF_screen.h +++ b/source/blender/include/BIF_screen.h @@ -95,6 +95,7 @@ int is_allowed_to_change_screen(struct bScreen *newp); void splash(void * data, int datasizei, char * string); void screenmain(void); void getdisplaysize(void); +void setfullscreen(void); void setprefsize(int stax, int stay, int sizx, int sizy); void calc_arearcts(struct ScrArea *sa); void resize_screen(int x, int y, int w, int h); diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 7bcd5772400..60bf34a04f8 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -118,7 +118,7 @@ static void wait_for_event(void); /* ********* Globals *********** */ static Window *mainwin= NULL; -static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1; +static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1, start_fullscreen = 0; static short dodrawscreen= 0; static ScrArea *areawinar[MAXWIN]; static ScrArea *g_activearea= NULL; @@ -1124,6 +1124,11 @@ void mainwindow_close(void) { /* ********* AREAS ************* */ +void setfullscreen() +{ + start_fullscreen = 1; +} + void setprefsize(int stax, int stay, int sizx, int sizy) { int scrwidth, scrheight; @@ -1674,8 +1679,12 @@ static bScreen *addscreen(char *name) /* use setprefsize() if you want somethin sc->scene= G.scene; - if (!mainwin) { - mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized); + if (!mainwin) { + if (start_fullscreen) + mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, 2); + else + mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized); + if (!mainwin) { printf("ERROR: Unable to open Blender window\n"); exit(1); diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c index cc67916c224..73cb6cb9f40 100644 --- a/source/blender/src/ghostwinlay.c +++ b/source/blender/src/ghostwinlay.c @@ -234,8 +234,10 @@ Window *window_open(char *title, int posx, int posy, int sizex, int sizey, int s inital_state= start_maximized? GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal; #else - inital_state= start_maximized? - GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal; + if (start_maximized == 2) + inital_state= GHOST_kWindowStateFullScreen; + else + inital_state= start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal; #endif ghostwin= GHOST_CreateWindow(g_system, diff --git a/source/creator/creator.c b/source/creator/creator.c index 851144d14bc..7da10b06f18 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -345,6 +345,7 @@ int main(int argc, char **argv) break; case 'W': /* XXX, fixme zr, borderless on win32 */ + setfullscreen(); break; case 'n': case 'N': -- cgit v1.2.3