comparison src/video/cocoa/SDL_cocoawindow.m @ 1973:81255f93dfcd

Fixed fullscreen modes with Cocoa video driver.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 06 Aug 2006 08:55:37 +0000
parents c92e5f3e68d9
children 4685ccd33d0e
comparison
equal deleted inserted replaced
1972:a0e278364188 1973:81255f93dfcd
258 258
259 index = _data->videodata->mouse; 259 index = _data->videodata->mouse;
260 SDL_SendMouseWheel(index, (int)([theEvent deltaY]+0.9f)); 260 SDL_SendMouseWheel(index, (int)([theEvent deltaY]+0.9f));
261 } 261 }
262 262
263 @end
264
265 @interface SDLWindow : NSWindow
266 /* These are needed for borderless/fullscreen windows */
267 - (BOOL)canBecomeKeyWindow;
268 - (BOOL)canBecomeMainWindow;
269 @end
270
271 @implementation SDLWindow
272 - (BOOL)canBecomeKeyWindow
273 {
274 return YES;
275 }
276
277 - (BOOL)canBecomeMainWindow
278 {
279 return YES;
280 }
263 @end 281 @end
264 282
265 static int 283 static int
266 SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created) 284 SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created)
267 { 285 {
377 } 395 }
378 if (window->flags & SDL_WINDOW_RESIZABLE) { 396 if (window->flags & SDL_WINDOW_RESIZABLE) {
379 style |= NSResizableWindowMask; 397 style |= NSResizableWindowMask;
380 } 398 }
381 399
382 nswindow = [[NSWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE]; 400 nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE];
383 401
384 [pool release]; 402 [pool release];
385 403
386 if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) { 404 if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) {
387 [nswindow release]; 405 [nswindow release];