Fixed creating a fullscreen window on iOS
authorSam Lantinga <slouken@libsdl.org>
Wed, 09 Nov 2011 02:35:49 -0500
changeset 60739738f2a8eee4
parent 6072 8b473f33c766
child 6074 3e1323cbb807
Fixed creating a fullscreen window on iOS
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/src/video/uikit/SDL_uikitvideo.m	Wed Nov 09 00:27:44 2011 -0500
     1.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Wed Nov 09 02:35:49 2011 -0500
     1.3 @@ -83,6 +83,7 @@
     1.4      device->SetDisplayMode = UIKit_SetDisplayMode;
     1.5      device->PumpEvents = UIKit_PumpEvents;
     1.6      device->CreateWindow = UIKit_CreateWindow;
     1.7 +    device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
     1.8      device->DestroyWindow = UIKit_DestroyWindow;
     1.9      device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
    1.10  
     2.1 --- a/src/video/uikit/SDL_uikitwindow.h	Wed Nov 09 00:27:44 2011 -0500
     2.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Wed Nov 09 02:35:49 2011 -0500
     2.3 @@ -28,6 +28,7 @@
     2.4  typedef struct SDL_WindowData SDL_WindowData;
     2.5  
     2.6  extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
     2.7 +extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
     2.8  extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
     2.9  extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
    2.10                                        struct SDL_SysWMinfo * info);
     3.1 --- a/src/video/uikit/SDL_uikitwindow.m	Wed Nov 09 00:27:44 2011 -0500
     3.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Wed Nov 09 02:35:49 2011 -0500
     3.3 @@ -187,6 +187,21 @@
     3.4  }
     3.5  
     3.6  void
     3.7 +UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
     3.8 +{
     3.9 +    UIScreen *uiscreen = (UIScreen *) display->driverdata;
    3.10 +    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
    3.11 +
    3.12 +    if (fullscreen) {
    3.13 +        [UIApplication sharedApplication].statusBarHidden = YES;
    3.14 +        uiwindow.frame = [uiscreen bounds];
    3.15 +    } else {
    3.16 +        [UIApplication sharedApplication].statusBarHidden = NO;
    3.17 +        uiwindow.frame = [uiscreen applicationFrame];
    3.18 +    }
    3.19 +}
    3.20 +
    3.21 +void
    3.22  UIKit_DestroyWindow(_THIS, SDL_Window * window)
    3.23  {
    3.24      SDL_WindowData *data = (SDL_WindowData *)window->driverdata;