Skip to content

Commit

Permalink
Rely on SDL for Android fullscreen window behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Oct 8, 2019
1 parent 274ae5f commit bb2af5e
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 241 deletions.
17 changes: 17 additions & 0 deletions project/src/backend/sdl/SDLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ namespace lime {

int sdlWindowFlags = 0;

#ifdef ANDROID
if (flags & WINDOW_FLAG_FULLSCREEN) sdlWindowFlags |= SDL_WINDOW_FULLSCREEN;
#else
if (flags & WINDOW_FLAG_FULLSCREEN) sdlWindowFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
#endif
if (flags & WINDOW_FLAG_RESIZABLE) sdlWindowFlags |= SDL_WINDOW_RESIZABLE;
if (flags & WINDOW_FLAG_BORDERLESS) sdlWindowFlags |= SDL_WINDOW_BORDERLESS;
if (flags & WINDOW_FLAG_HIDDEN) sdlWindowFlags |= SDL_WINDOW_HIDDEN;
Expand Down Expand Up @@ -163,6 +167,7 @@ namespace lime {
if (!sdlWindow) {

printf ("Could not create SDL window: %s.\n", SDL_GetError ());
return;

}

Expand Down Expand Up @@ -289,6 +294,14 @@ namespace lime {

}

#ifdef ANDROID
// TODO: Is this extra call needed?
if (flags & WINDOW_FLAG_FULLSCREEN)
{
SetFullscreen(true);
}
#endif

}


Expand Down Expand Up @@ -925,6 +938,9 @@ namespace lime {

if (fullscreen) {

#ifdef ANDROID
SDL_SetWindowFullscreen (sdlWindow, SDL_WINDOW_FULLSCREEN);
#else
if (displayModeSet) {

SDL_SetWindowFullscreen (sdlWindow, SDL_WINDOW_FULLSCREEN);
Expand All @@ -934,6 +950,7 @@ namespace lime {
SDL_SetWindowFullscreen (sdlWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);

}
#endif

} else {

Expand Down
Loading

0 comments on commit bb2af5e

Please sign in to comment.