comparison src/video/cocoa/SDL_cocoamodes.m @ 3528:59ff7a2beb57

Added an API function to query geometry of multiple monitors: SDL_GetDisplayBounds() Implemented multi-monitor window positions on Windows
author Sam Lantinga <slouken@libsdl.org>
date Sun, 06 Dec 2009 08:03:38 +0000
parents 455a6c47d2c6
children 3d91e31fcf71
comparison
equal deleted inserted replaced
3527:444cb12cadb6 3528:59ff7a2beb57
198 } 198 }
199 } 199 }
200 SDL_stack_free(displays); 200 SDL_stack_free(displays);
201 } 201 }
202 202
203 /* This is needed on 10.4, where NSRect and CGRect are different */ 203 int
204 NSRect 204 Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect)
205 Cocoa_DisplayBounds(CGDirectDisplayID display) 205 {
206 { 206 SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
207 NSRect nsrect;
208 CGRect cgrect; 207 CGRect cgrect;
209 208
210 cgrect = CGDisplayBounds(display); 209 cgrect = CGDisplayBounds(displaydata->display);
211 nsrect.origin.x = cgrect.origin.x; 210 rect->x = (int)cgrect.origin.x;
212 nsrect.origin.y = cgrect.origin.y; 211 rect->y = (int)cgrect.origin.y;
213 nsrect.size.width = cgrect.size.width; 212 rect->w = (int)cgrect.size.width;
214 nsrect.size.height = cgrect.size.height; 213 rect->h = (int)cgrect.size.height;
215 return nsrect; 214 return 0;
216 } 215 }
217 216
218 static void 217 static void
219 AddDisplayMode(const void *moderef, void *context) 218 AddDisplayMode(const void *moderef, void *context)
220 { 219 {