Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed creating a fullscreen window on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 9, 2011
1 parent 870eeb9 commit 0218b5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -83,6 +83,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
device->SetDisplayMode = UIKit_SetDisplayMode;
device->PumpEvents = UIKit_PumpEvents;
device->CreateWindow = UIKit_CreateWindow;
device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
device->DestroyWindow = UIKit_DestroyWindow;
device->GetWindowWMInfo = UIKit_GetWindowWMInfo;

Expand Down
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitwindow.h
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -186,6 +186,21 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo

}

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)
{
Expand Down

0 comments on commit 0218b5a

Please sign in to comment.