Add borderless fullscreen option

This commit is contained in:
Jack Karamanian 2017-12-14 19:36:46 -06:00 committed by Geoffrey McRae
parent d08fba9cf9
commit 606da0ae47

View file

@ -67,6 +67,7 @@ struct AppParams
bool allowResize; bool allowResize;
bool keepAspect; bool keepAspect;
bool borderless; bool borderless;
bool fullscreen;
bool center; bool center;
int x, y; int x, y;
unsigned int w, h; unsigned int w, h;
@ -87,6 +88,7 @@ struct AppParams params =
.allowResize = true, .allowResize = true,
.keepAspect = true, .keepAspect = true,
.borderless = false, .borderless = false,
.fullscreen = false,
.center = true, .center = true,
.x = 0, .x = 0,
.y = 0, .y = 0,
@ -667,6 +669,7 @@ int run()
params.h, params.h,
( (
SDL_WINDOW_SHOWN | SDL_WINDOW_SHOWN |
(params.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) |
(params.allowResize ? SDL_WINDOW_RESIZABLE : 0) | (params.allowResize ? SDL_WINDOW_RESIZABLE : 0) |
(params.borderless ? SDL_WINDOW_BORDERLESS : 0) | (params.borderless ? SDL_WINDOW_BORDERLESS : 0) |
sdlFlags sdlFlags
@ -891,7 +894,7 @@ void doLicense()
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
int c; int c;
while((c = getopt(argc, argv, "hf:sc:p:jMmkanrdx:y:w:b:l")) != -1) while((c = getopt(argc, argv, "hf:sc:p:jMmkanrdFx:y:w:b:l")) != -1)
switch(c) switch(c)
{ {
case '?': case '?':
@ -948,6 +951,10 @@ int main(int argc, char * argv[])
params.borderless = true; params.borderless = true;
break; break;
case 'F':
params.fullscreen = true;
break;
case 'x': case 'x':
params.center = false; params.center = false;
params.x = atoi(optarg); params.x = atoi(optarg);