Fix for the Game Center status window always being behind the SDL window (untested!)
authorSam Lantinga
Sun, 22 Jul 2012 11:24:04 -0700
changeset 63798f224d0762ab
parent 6378 58c9e692aec5
child 6380 3990b7d564d7
Fix for the Game Center status window always being behind the SDL window (untested!)
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/src/video/uikit/SDL_uikitopengles.m	Fri Jul 20 12:57:25 2012 -0700
     1.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Sun Jul 22 11:24:04 2012 -0700
     1.3 @@ -90,13 +90,9 @@
     1.4          return;
     1.5      }
     1.6      [data->view swapBuffers];
     1.7 -    /* since now we've got something to draw
     1.8 -       make the window visible */
     1.9 -    [data->uiwindow makeKeyAndVisible];
    1.10  
    1.11      /* we need to let the event cycle run, or the OS won't update the OpenGL view! */
    1.12      SDL_PumpEvents();
    1.13 -
    1.14  }
    1.15  
    1.16  SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
     2.1 --- a/src/video/uikit/SDL_uikitvideo.m	Fri Jul 20 12:57:25 2012 -0700
     2.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Sun Jul 22 11:24:04 2012 -0700
     2.3 @@ -83,6 +83,8 @@
     2.4      device->SetDisplayMode = UIKit_SetDisplayMode;
     2.5      device->PumpEvents = UIKit_PumpEvents;
     2.6      device->CreateWindow = UIKit_CreateWindow;
     2.7 +    device->ShowWindow = UIKit_ShowWindow;
     2.8 +    device->HideWindow = UIKit_HideWindow;
     2.9      device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
    2.10      device->DestroyWindow = UIKit_DestroyWindow;
    2.11      device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
     3.1 --- a/src/video/uikit/SDL_uikitwindow.h	Fri Jul 20 12:57:25 2012 -0700
     3.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Sun Jul 22 11:24:04 2012 -0700
     3.3 @@ -29,6 +29,8 @@
     3.4  typedef struct SDL_WindowData SDL_WindowData;
     3.5  
     3.6  extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
     3.7 +extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
     3.8 +extern void UIKit_HideWindow(_THIS, SDL_Window * window);
     3.9  extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
    3.10  extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
    3.11  extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
     4.1 --- a/src/video/uikit/SDL_uikitwindow.m	Fri Jul 20 12:57:25 2012 -0700
     4.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Sun Jul 22 11:24:04 2012 -0700
     4.3 @@ -211,6 +211,22 @@
     4.4  }
     4.5  
     4.6  void
     4.7 +UIKit_ShowWindow(_THIS, SDL_Window * window)
     4.8 +{
     4.9 +    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
    4.10 +
    4.11 +    [uiwindow makeKeyAndVisible];
    4.12 +}
    4.13 +
    4.14 +void
    4.15 +UIKit_HideWindow(_THIS, SDL_Window * window)
    4.16 +{
    4.17 +    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
    4.18 +
    4.19 +    uiwindow.hidden = YES;
    4.20 +}
    4.21 +
    4.22 +void
    4.23  UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
    4.24  {
    4.25      SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;