diff src/video/cocoa/SDL_cocoawindow.m @ 1936:83946ee0ff1f

Implemented OpenGL support on Mac OS X The OpenGL renderer works without changes, yay! :)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 25 Jul 2006 06:22:42 +0000
parents 7ee5297340f7
children 05e88d266921
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoawindow.m	Mon Jul 24 23:30:14 2006 +0000
+++ b/src/video/cocoa/SDL_cocoawindow.m	Tue Jul 25 06:22:42 2006 +0000
@@ -31,6 +31,7 @@
 
 static __inline__ void ConvertNSRect(NSRect *r)
 {
+    /* FIXME: Cache the display used for this window */
     r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height;
 }
 
@@ -325,6 +326,7 @@
     NSRect rect;
     unsigned int style;
     NSString *title;
+    int status;
 
     pool = [[NSAutoreleasePool alloc] init];
 
@@ -380,18 +382,15 @@
 
     if (SetupWindowData(window, nswindow, YES) < 0) {
         [nswindow release];
-        [pool release];
         return -1;
     }
 #ifdef SDL_VIDEO_OPENGL
-    /*
     if (window->flags & SDL_WINDOW_OPENGL) {
         if (Cocoa_GL_SetupWindow(_this, window) < 0) {
             Cocoa_DestroyWindow(_this, window);
             return -1;
         }
     }
-    */
 #endif
     return 0;
 }
@@ -522,11 +521,9 @@
     if (data) {
         NSAutoreleasePool *pool;
 #ifdef SDL_VIDEO_OPENGL
-        /*
         if (window->flags & SDL_WINDOW_OPENGL) {
             Cocoa_GL_CleanupWindow(_this, window);
         }
-        */
 #endif
         pool = [[NSAutoreleasePool alloc] init];
         [data->listener close];