Commit 3d984388 authored by Sam Lantinga's avatar Sam Lantinga

Fixed creating a fullscreen window on iOS

parent 922a04d0
...@@ -83,6 +83,7 @@ UIKit_CreateDevice(int devindex) ...@@ -83,6 +83,7 @@ UIKit_CreateDevice(int devindex)
device->SetDisplayMode = UIKit_SetDisplayMode; device->SetDisplayMode = UIKit_SetDisplayMode;
device->PumpEvents = UIKit_PumpEvents; device->PumpEvents = UIKit_PumpEvents;
device->CreateWindow = UIKit_CreateWindow; device->CreateWindow = UIKit_CreateWindow;
device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
device->DestroyWindow = UIKit_DestroyWindow; device->DestroyWindow = UIKit_DestroyWindow;
device->GetWindowWMInfo = UIKit_GetWindowWMInfo; device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
typedef struct SDL_WindowData SDL_WindowData; typedef struct SDL_WindowData SDL_WindowData;
extern int UIKit_CreateWindow(_THIS, SDL_Window * window); 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 void UIKit_DestroyWindow(_THIS, SDL_Window * window);
extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo * info); struct SDL_SysWMinfo * info);
......
...@@ -186,6 +186,21 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) ...@@ -186,6 +186,21 @@ UIKit_CreateWindow(_THIS, SDL_Window *window)
} }
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 void
UIKit_DestroyWindow(_THIS, SDL_Window * window) UIKit_DestroyWindow(_THIS, SDL_Window * window)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment