diff src/video/cocoa/SDL_cocoaopengl.m @ 5251:58265e606e4e

Window coordinates are in the global space and windows are not tied to a particular display. Also added Ctrl-Enter keybinding to the test code to toggle fullscreen mode for testing.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 10 Feb 2011 14:44:25 -0800
parents 514f811a4887
children 7a963be087ef
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoaopengl.m	Thu Feb 10 14:36:09 2011 -0800
+++ b/src/video/cocoa/SDL_cocoaopengl.m	Thu Feb 10 14:44:25 2011 -0800
@@ -72,7 +72,7 @@
 Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
 {
     NSAutoreleasePool *pool;
-    SDL_VideoDisplay *display = window->display;
+    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
     NSOpenGLPixelFormatAttribute attr[32];
     NSOpenGLPixelFormat *fmt;