added fullscreen command line switch on Win32 -W
written by Florian Eggenberger.
This commit is contained in:
@@ -95,6 +95,7 @@ int is_allowed_to_change_screen(struct bScreen *newp);
|
|||||||
void splash(void * data, int datasizei, char * string);
|
void splash(void * data, int datasizei, char * string);
|
||||||
void screenmain(void);
|
void screenmain(void);
|
||||||
void getdisplaysize(void);
|
void getdisplaysize(void);
|
||||||
|
void setfullscreen(void);
|
||||||
void setprefsize(int stax, int stay, int sizx, int sizy);
|
void setprefsize(int stax, int stay, int sizx, int sizy);
|
||||||
void calc_arearcts(struct ScrArea *sa);
|
void calc_arearcts(struct ScrArea *sa);
|
||||||
void resize_screen(int x, int y, int w, int h);
|
void resize_screen(int x, int y, int w, int h);
|
||||||
|
@@ -118,7 +118,7 @@ static void wait_for_event(void);
|
|||||||
/* ********* Globals *********** */
|
/* ********* Globals *********** */
|
||||||
|
|
||||||
static Window *mainwin= NULL;
|
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 short dodrawscreen= 0;
|
||||||
static ScrArea *areawinar[MAXWIN];
|
static ScrArea *areawinar[MAXWIN];
|
||||||
static ScrArea *g_activearea= NULL;
|
static ScrArea *g_activearea= NULL;
|
||||||
@@ -1124,6 +1124,11 @@ void mainwindow_close(void) {
|
|||||||
|
|
||||||
/* ********* AREAS ************* */
|
/* ********* AREAS ************* */
|
||||||
|
|
||||||
|
void setfullscreen()
|
||||||
|
{
|
||||||
|
start_fullscreen = 1;
|
||||||
|
}
|
||||||
|
|
||||||
void setprefsize(int stax, int stay, int sizx, int sizy)
|
void setprefsize(int stax, int stay, int sizx, int sizy)
|
||||||
{
|
{
|
||||||
int scrwidth, scrheight;
|
int scrwidth, scrheight;
|
||||||
@@ -1674,8 +1679,12 @@ static bScreen *addscreen(char *name) /* use setprefsize() if you want somethin
|
|||||||
|
|
||||||
sc->scene= G.scene;
|
sc->scene= G.scene;
|
||||||
|
|
||||||
if (!mainwin) {
|
if (!mainwin) {
|
||||||
mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized);
|
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) {
|
if (!mainwin) {
|
||||||
printf("ERROR: Unable to open Blender window\n");
|
printf("ERROR: Unable to open Blender window\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@@ -234,8 +234,10 @@ Window *window_open(char *title, int posx, int posy, int sizex, int sizey, int s
|
|||||||
inital_state= start_maximized?
|
inital_state= start_maximized?
|
||||||
GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal;
|
GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal;
|
||||||
#else
|
#else
|
||||||
inital_state= start_maximized?
|
if (start_maximized == 2)
|
||||||
GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal;
|
inital_state= GHOST_kWindowStateFullScreen;
|
||||||
|
else
|
||||||
|
inital_state= start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ghostwin= GHOST_CreateWindow(g_system,
|
ghostwin= GHOST_CreateWindow(g_system,
|
||||||
|
@@ -345,6 +345,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'W':
|
case 'W':
|
||||||
/* XXX, fixme zr, borderless on win32 */
|
/* XXX, fixme zr, borderless on win32 */
|
||||||
|
setfullscreen();
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
case 'N':
|
case 'N':
|
||||||
|
Reference in New Issue
Block a user