Fixed bug 731 - No mechanism to extract the NSView for 3d library
authorSam Lantinga <slouken@libsdl.org>
Mon, 20 May 2013 22:05:49 -0700
changeset 720054c9f310f7c0
parent 7199 6d4cad3fb837
child 7201 c6b3d3c32507
Fixed bug 731 - No mechanism to extract the NSView for 3d library
include/SDL_syswm.h
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/include/SDL_syswm.h	Mon May 20 12:25:16 2013 -0700
     1.2 +++ b/include/SDL_syswm.h	Mon May 20 22:05:49 2013 -0700
     1.3 @@ -82,6 +82,7 @@
     1.4  #include <Cocoa/Cocoa.h>
     1.5  #else
     1.6  typedef struct _NSWindow NSWindow;
     1.7 +typedef struct _NSView NSView;
     1.8  #endif
     1.9  #endif
    1.10  
    1.11 @@ -187,6 +188,7 @@
    1.12          struct
    1.13          {
    1.14              NSWindow *window;           /* The Cocoa window */
    1.15 +            NSView *view;               /* The Cocoa view */
    1.16          } cocoa;
    1.17  #endif
    1.18  #if defined(SDL_VIDEO_DRIVER_UIKIT)
     2.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon May 20 12:25:16 2013 -0700
     2.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon May 20 22:05:49 2013 -0700
     2.3 @@ -1131,6 +1131,7 @@
     2.4      if (info->version.major <= SDL_MAJOR_VERSION) {
     2.5          info->subsystem = SDL_SYSWM_COCOA;
     2.6          info->info.cocoa.window = nswindow;
     2.7 +        info->info.cocoa.view = [nswindow contentView];
     2.8          return SDL_TRUE;
     2.9      } else {
    2.10          SDL_SetError("Application not compiled with SDL %d.%d\n",