added UIViewController pointer to SDL_SysWMinfo for iOS
authorDavid Ludwig <dludwig@pobox.com>
Wed, 18 Jul 2012 22:26:47 -0400
changeset 83053d522e6d4ae1
parent 8304 a4bf0413d7c0
child 8306 0e9d258470b3
added UIViewController pointer to SDL_SysWMinfo for iOS
include/SDL_syswm.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/include/SDL_syswm.h	Fri Jul 06 17:44:08 2012 -0400
     1.2 +++ b/include/SDL_syswm.h	Wed Jul 18 22:26:47 2012 -0400
     1.3 @@ -92,6 +92,7 @@
     1.4  #include <UIKit/UIKit.h>
     1.5  #else
     1.6  typedef struct _UIWindow UIWindow;
     1.7 +typedef struct _UIViewController UIViewController;
     1.8  #endif
     1.9  #endif
    1.10  
    1.11 @@ -195,6 +196,7 @@
    1.12          struct
    1.13          {
    1.14              UIWindow *window;           /* The UIKit window */
    1.15 +            UIViewController *viewcontroller;   /* The UIKit view controller */
    1.16          } uikit;
    1.17  #endif
    1.18          /* Can't have an empty union */
     2.1 --- a/src/video/uikit/SDL_uikitwindow.m	Fri Jul 06 17:44:08 2012 -0400
     2.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Wed Jul 18 22:26:47 2012 -0400
     2.3 @@ -267,10 +267,12 @@
     2.4  UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
     2.5  {
     2.6      UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
     2.7 +    UIViewController *uiviewcontroller = ((SDL_WindowData *) window->driverdata)->viewcontroller;
     2.8  
     2.9      if (info->version.major <= SDL_MAJOR_VERSION) {
    2.10          info->subsystem = SDL_SYSWM_UIKIT;
    2.11          info->info.uikit.window = uiwindow;
    2.12 +        info->info.uikit.viewcontroller = uiviewcontroller;
    2.13          return SDL_TRUE;
    2.14      } else {
    2.15          SDL_SetError("Application not compiled with SDL %d.%d\n",