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 7200 54c9f310f7c0
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
--- a/include/SDL_syswm.h	Mon May 20 12:25:16 2013 -0700
+++ b/include/SDL_syswm.h	Mon May 20 22:05:49 2013 -0700
@@ -82,6 +82,7 @@
 #include <Cocoa/Cocoa.h>
 #else
 typedef struct _NSWindow NSWindow;
+typedef struct _NSView NSView;
 #endif
 #endif
 
@@ -187,6 +188,7 @@
         struct
         {
             NSWindow *window;           /* The Cocoa window */
+            NSView *view;               /* The Cocoa view */
         } cocoa;
 #endif
 #if defined(SDL_VIDEO_DRIVER_UIKIT)
--- a/src/video/cocoa/SDL_cocoawindow.m	Mon May 20 12:25:16 2013 -0700
+++ b/src/video/cocoa/SDL_cocoawindow.m	Mon May 20 22:05:49 2013 -0700
@@ -1131,6 +1131,7 @@
     if (info->version.major <= SDL_MAJOR_VERSION) {
         info->subsystem = SDL_SYSWM_COCOA;
         info->info.cocoa.window = nswindow;
+        info->info.cocoa.view = [nswindow contentView];
         return SDL_TRUE;
     } else {
         SDL_SetError("Application not compiled with SDL %d.%d\n",