Skip to content

Commit

Permalink
Add support for fullscreen borderless window
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz82 committed Mar 8, 2019
1 parent d45d339 commit 0410864
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions es-app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ bool parseArgs(int argc, char* argv[])
Settings::getInstance()->setBool("Debug", true);
Settings::getInstance()->setBool("HideConsole", false);
Log::setReportingLevel(LogDebug);
}else if(strcmp(argv[i], "--fullscreen-borderless") == 0)
{
Settings::getInstance()->setBool("FullscreenBorderless", true);
}else if(strcmp(argv[i], "--windowed") == 0)
{
Settings::getInstance()->setBool("Windowed", true);
Expand Down
2 changes: 1 addition & 1 deletion es-core/src/Renderer_init_sdlgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace Renderer
sdlWindow = SDL_CreateWindow("EmulationStation",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
windowWidth, windowHeight,
SDL_WINDOW_OPENGL | (Settings::getInstance()->getBool("Windowed") ? 0 : SDL_WINDOW_FULLSCREEN));
SDL_WINDOW_OPENGL | (Settings::getInstance()->getBool("Windowed") ? 0 : (Settings::getInstance()->getBool("FullscreenBorderless") ? SDL_WINDOW_BORDERLESS : SDL_WINDOW_FULLSCREEN)));

if(sdlWindow == NULL)
{
Expand Down
2 changes: 2 additions & 0 deletions es-core/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ std::vector<const char*> settings_dont_save {
{ "SplashScreen" },
{ "SplashScreenProgress" },
{ "VSync" },
{ "FullscreenBorderless" },
{ "Windowed" },
{ "WindowWidth" },
{ "WindowHeight" },
Expand Down Expand Up @@ -59,6 +60,7 @@ void Settings::setDefaults()
mBoolMap["ShowHiddenFiles"] = false;
mBoolMap["DrawFramerate"] = false;
mBoolMap["ShowExit"] = true;
mBoolMap["FullscreenBorderless"] = false;
mBoolMap["Windowed"] = false;
mBoolMap["SplashScreen"] = true;
mBoolMap["SplashScreenProgress"] = true;
Expand Down

0 comments on commit 0410864

Please sign in to comment.