src/video/cocoa/SDL_cocoawindow.m
changeset 1951 7177581dc9fa
parent 1937 05e88d266921
child 1952 420716272158
--- a/src/video/cocoa/SDL_cocoawindow.m	Wed Jul 26 06:34:54 2006 +0000
+++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Jul 27 06:53:23 2006 +0000
@@ -242,9 +242,10 @@
 @end
 
 static int
-SetupWindowData(SDL_Window * window, NSWindow *nswindow, BOOL created)
+SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created)
 {
     NSAutoreleasePool *pool;
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_WindowData *data;
 
     /* Allocate the window data */
@@ -256,7 +257,7 @@
     data->windowID = window->id;
     data->window = nswindow;
     data->created = created;
-    data->videodata = (SDL_VideoData *) SDL_GetVideoDevice()->driverdata;
+    data->videodata = videodata;
 
     pool = [[NSAutoreleasePool alloc] init];
 
@@ -380,7 +381,7 @@
 
     [pool release];
 
-    if (SetupWindowData(window, nswindow, YES) < 0) {
+    if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) {
         [nswindow release];
         return -1;
     }
@@ -413,7 +414,7 @@
 
     [pool release];
 
-    return SetupWindowData(window, nswindow, NO);
+    return SetupWindowData(_this, window, nswindow, SDL_FALSE);
 }
 
 void