comparison src/video/quartz/SDL_QuartzVideo.m @ 56:ce9cd2cf0d0d

Date: Sun, 10 Jun 2001 17:33:44 -0500 From: Darrell Walisser <dwaliss1@purdue.edu> Subject: Re: [SDL] Mac OS X Goodies For You Updates and fixes: -fixed erasing window when minmizing it (with some minor window redraw problems) -implemented close box to send SDLQuit event -fixed messed up alpha on 32bpp windows
author Sam Lantinga <slouken@lokigames.com>
date Mon, 11 Jun 2001 00:08:10 +0000
parents 45b1c4303f87
children bd6b0a910a65
comparison
equal deleted inserted replaced
55:55f1f1b3e27d 56:ce9cd2cf0d0d
353 NSRect rect; 353 NSRect rect;
354 rect = NSMakeRect (0, 0, width, height); 354 rect = NSMakeRect (0, 0, width, height);
355 355
356 /* Manually create a window, avoids having a nib file resource */ 356 /* Manually create a window, avoids having a nib file resource */
357 window = [ [ SDL_QuartzWindow alloc ] initWithContentRect:rect 357 window = [ [ SDL_QuartzWindow alloc ] initWithContentRect:rect
358 styleMask:(NSTitledWindowMask | NSMiniaturizableWindowMask) 358 styleMask:(NSTitledWindowMask | NSMiniaturizableWindowMask |
359 NSClosableWindowMask)
359 backing: //NSBackingStoreBuffered 360 backing: //NSBackingStoreBuffered
360 NSBackingStoreRetained 361 NSBackingStoreRetained
361 defer:NO ]; 362 defer:NO ];
362 363
363 if (window == nil) { 364 if (window == nil) {
366 } 367 }
367 368
368 current->w = width; 369 current->w = width;
369 current->h = height; 370 current->h = height;
370 371
372 [ window setReleasedWhenClosed:YES ];
371 [ window setTitle:windowTitle ]; 373 [ window setTitle:windowTitle ];
372 [ window setAcceptsMouseMovedEvents:YES ]; 374 [ window setAcceptsMouseMovedEvents:YES ];
375 [ window setViewsNeedDisplay:NO ];
373 [ window center ]; 376 [ window center ];
374 377 [ window setDelegate:
378 [ [ [ SDL_QuartzWindowDelegate alloc ] init ] autorelease ] ];
379
375 /* For OpenGL, we set the content view to a NSOpenGLView */ 380 /* For OpenGL, we set the content view to a NSOpenGLView */
376 if ( flags & SDL_OPENGL ) { 381 if ( flags & SDL_OPENGL ) {
377 382
378 if ( ! QZ_SetupOpenGL (this, bpp, flags) ) { 383 if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
379 return NULL; 384 return NULL;
445 break; 450 break;
446 case 24: 451 case 24:
447 SDL_SetError ("24bpp is not available"); 452 SDL_SetError ("24bpp is not available");
448 return NULL; 453 return NULL;
449 case 32: /* (8)-8-8-8 ARGB */ 454 case 32: /* (8)-8-8-8 ARGB */
450 amask = 0xFF000000; 455 amask = 0x00000000; /* per-pixel alpha needs to be fixed */
451 rmask = 0x00FF0000; 456 rmask = 0x00FF0000;
452 gmask = 0x0000FF00; 457 gmask = 0x0000FF00;
453 bmask = 0x000000FF; 458 bmask = 0x000000FF;
454 break; 459 break;
455 } 460 }