Fixed creating a fullscreen window on iOS
authorSam Lantinga <slouken@libsdl.org>
Wed, 09 Nov 2011 02:35:49 -0500
changeset 6073 9738f2a8eee4
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
--- a/src/video/uikit/SDL_uikitvideo.m	Wed Nov 09 00:27:44 2011 -0500
+++ b/src/video/uikit/SDL_uikitvideo.m	Wed Nov 09 02:35:49 2011 -0500
@@ -83,6 +83,7 @@
     device->SetDisplayMode = UIKit_SetDisplayMode;
     device->PumpEvents = UIKit_PumpEvents;
     device->CreateWindow = UIKit_CreateWindow;
+    device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
     device->DestroyWindow = UIKit_DestroyWindow;
     device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
 
--- a/src/video/uikit/SDL_uikitwindow.h	Wed Nov 09 00:27:44 2011 -0500
+++ b/src/video/uikit/SDL_uikitwindow.h	Wed Nov 09 02:35:49 2011 -0500
@@ -28,6 +28,7 @@
 typedef struct SDL_WindowData SDL_WindowData;
 
 extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
+extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
 extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
 extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
                                       struct SDL_SysWMinfo * info);
--- a/src/video/uikit/SDL_uikitwindow.m	Wed Nov 09 00:27:44 2011 -0500
+++ b/src/video/uikit/SDL_uikitwindow.m	Wed Nov 09 02:35:49 2011 -0500
@@ -187,6 +187,21 @@
 }
 
 void
+UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
+{
+    UIScreen *uiscreen = (UIScreen *) display->driverdata;
+    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
+
+    if (fullscreen) {
+        [UIApplication sharedApplication].statusBarHidden = YES;
+        uiwindow.frame = [uiscreen bounds];
+    } else {
+        [UIApplication sharedApplication].statusBarHidden = NO;
+        uiwindow.frame = [uiscreen applicationFrame];
+    }
+}
+
+void
 UIKit_DestroyWindow(_THIS, SDL_Window * window)
 {
     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;