Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Moved iOS-specific code into uikit target. Fixes crashes in X11 target.

  • Loading branch information
icculus committed Sep 12, 2012
1 parent f2ce8f0 commit 4916f55cea7984774c0c18129308758ccdb6e220
@@ -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
@@ -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;
@@ -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,
@@ -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)
{

0 comments on commit 4916f55

Please sign in to comment.