added UIViewController pointer to SDL_SysWMinfo for iOS
This commit is contained in:
parent
850da41f50
commit
fb4a889ee9
2 changed files with 4 additions and 0 deletions
|
@ -92,6 +92,7 @@ typedef struct _NSWindow NSWindow;
|
||||||
#include <UIKit/UIKit.h>
|
#include <UIKit/UIKit.h>
|
||||||
#else
|
#else
|
||||||
typedef struct _UIWindow UIWindow;
|
typedef struct _UIWindow UIWindow;
|
||||||
|
typedef struct _UIViewController UIViewController;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -195,6 +196,7 @@ struct SDL_SysWMinfo
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
UIWindow *window; /* The UIKit window */
|
UIWindow *window; /* The UIKit window */
|
||||||
|
UIViewController *viewcontroller; /* The UIKit view controller */
|
||||||
} uikit;
|
} uikit;
|
||||||
#endif
|
#endif
|
||||||
/* Can't have an empty union */
|
/* Can't have an empty union */
|
||||||
|
|
|
@ -267,10 +267,12 @@ SDL_bool
|
||||||
UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
|
UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
|
||||||
{
|
{
|
||||||
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
|
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
|
||||||
|
UIViewController *uiviewcontroller = ((SDL_WindowData *) window->driverdata)->viewcontroller;
|
||||||
|
|
||||||
if (info->version.major <= SDL_MAJOR_VERSION) {
|
if (info->version.major <= SDL_MAJOR_VERSION) {
|
||||||
info->subsystem = SDL_SYSWM_UIKIT;
|
info->subsystem = SDL_SYSWM_UIKIT;
|
||||||
info->info.uikit.window = uiwindow;
|
info->info.uikit.window = uiwindow;
|
||||||
|
info->info.uikit.viewcontroller = uiviewcontroller;
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
SDL_SetError("Application not compiled with SDL %d.%d\n",
|
SDL_SetError("Application not compiled with SDL %d.%d\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue