Moved iOS-specific code into uikit target. Fixes crashes in X11 target.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 12 Sep 2012 19:36:18 -0400
changeset 6419b75e82af5ef1
parent 6418 9c12f2c8057b
child 6420 6f52dc57f05e
Moved iOS-specific code into uikit target. Fixes crashes in X11 target.
src/video/SDL_video.c
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/src/video/SDL_video.c	Mon Sep 10 20:25:55 2012 -0700
     1.2 +++ b/src/video/SDL_video.c	Wed Sep 12 19:36:18 2012 -0400
     1.3 @@ -1890,13 +1890,6 @@
     1.4      if (FULLSCREEN_VISIBLE(window)) {
     1.5          SDL_UpdateFullscreenMode(window, SDL_TRUE);
     1.6      }
     1.7 -
     1.8 -    /* This needs to be done on iOS to rebind the nscontext to the view,
     1.9 -       and (hopefully) doesn't hurt on other systems.
    1.10 -    */
    1.11 -    if (window == _this->current_glwin) {
    1.12 -        _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
    1.13 -    }
    1.14  }
    1.15  
    1.16  void
     2.1 --- a/src/video/uikit/SDL_uikitvideo.m	Mon Sep 10 20:25:55 2012 -0700
     2.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Wed Sep 12 19:36:18 2012 -0400
     2.3 @@ -85,6 +85,7 @@
     2.4      device->CreateWindow = UIKit_CreateWindow;
     2.5      device->ShowWindow = UIKit_ShowWindow;
     2.6      device->HideWindow = UIKit_HideWindow;
     2.7 +    device->RaiseWindow = UIKit_RaiseWindow;
     2.8      device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
     2.9      device->DestroyWindow = UIKit_DestroyWindow;
    2.10      device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
     3.1 --- a/src/video/uikit/SDL_uikitwindow.h	Mon Sep 10 20:25:55 2012 -0700
     3.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Wed Sep 12 19:36:18 2012 -0400
     3.3 @@ -31,6 +31,7 @@
     3.4  extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
     3.5  extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
     3.6  extern void UIKit_HideWindow(_THIS, SDL_Window * window);
     3.7 +extern void UIKit_RaiseWindow(_THIS, SDL_Window * window);
     3.8  extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
     3.9  extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
    3.10  extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
     4.1 --- a/src/video/uikit/SDL_uikitwindow.m	Mon Sep 10 20:25:55 2012 -0700
     4.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Wed Sep 12 19:36:18 2012 -0400
     4.3 @@ -226,6 +226,16 @@
     4.4  }
     4.5  
     4.6  void
     4.7 +UIKit_RaiseWindow(_THIS, SDL_Window * window)
     4.8 +{
     4.9 +    // We don't currently offer a concept of "raising" the SDL window, since
    4.10 +    //  we only allow one per display, in the iOS fashion.
    4.11 +    // However, we use this entry point to rebind the context to the view
    4.12 +    //  during OnWindowRestored processing.
    4.13 +    _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
    4.14 +}
    4.15 +
    4.16 +void
    4.17  UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
    4.18  {
    4.19      SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;