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

Commit

Permalink
Moved iOS-specific code into uikit target. Fixes crashes in X11 target.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 12, 2012
1 parent f2ce8f0 commit 4916f55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/video/SDL_video.c
Expand Up @@ -1890,13 +1890,6 @@ SDL_OnWindowRestored(SDL_Window * window)
if (FULLSCREEN_VISIBLE(window)) {
SDL_UpdateFullscreenMode(window, SDL_TRUE);
}

/* This needs to be done on iOS to rebind the nscontext to the view,
and (hopefully) doesn't hurt on other systems.
*/
if (window == _this->current_glwin) {
_this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
}
}

void
Expand Down
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -85,6 +85,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
device->CreateWindow = UIKit_CreateWindow;
device->ShowWindow = UIKit_ShowWindow;
device->HideWindow = UIKit_HideWindow;
device->RaiseWindow = UIKit_RaiseWindow;
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 @@ -31,6 +31,7 @@ typedef struct SDL_WindowData SDL_WindowData;
extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
extern void UIKit_HideWindow(_THIS, SDL_Window * window);
extern void UIKit_RaiseWindow(_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,
Expand Down
10 changes: 10 additions & 0 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -225,6 +225,16 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
uiwindow.hidden = YES;
}

void
UIKit_RaiseWindow(_THIS, SDL_Window * window)
{
// We don't currently offer a concept of "raising" the SDL window, since
// we only allow one per display, in the iOS fashion.
// However, we use this entry point to rebind the context to the view
// during OnWindowRestored processing.
_this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
}

void
UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
{
Expand Down

0 comments on commit 4916f55

Please sign in to comment.