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

added UIViewController pointer to SDL_SysWMinfo for iOS

  • Loading branch information
DavidLudwig committed Jul 19, 2012
1 parent 0031845 commit 5f1642bce940476a55821a511a971831f8983d75
Showing with 4 additions and 0 deletions.
  1. +2 −0 include/SDL_syswm.h
  2. +2 −0 src/video/uikit/SDL_uikitwindow.m
@@ -92,6 +92,7 @@ typedef struct _NSWindow NSWindow;
#include <UIKit/UIKit.h>
#else
typedef struct _UIWindow UIWindow;
typedef struct _UIViewController UIViewController;
#endif
#endif

@@ -195,6 +196,7 @@ struct SDL_SysWMinfo
struct
{
UIWindow *window; /* The UIKit window */
UIViewController *viewcontroller; /* The UIKit view controller */
} uikit;
#endif
/* Can't have an empty union */
@@ -267,10 +267,12 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
{
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
UIViewController *uiviewcontroller = ((SDL_WindowData *) window->driverdata)->viewcontroller;

if (info->version.major <= SDL_MAJOR_VERSION) {
info->subsystem = SDL_SYSWM_UIKIT;
info->info.uikit.window = uiwindow;
info->info.uikit.viewcontroller = uiviewcontroller;
return SDL_TRUE;
} else {
SDL_SetError("Application not compiled with SDL %d.%d\n",

0 comments on commit 5f1642b

Please sign in to comment.