comparison src/video/cocoa/SDL_cocoaopengl.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 db3ba6c0d0df
children 114a541cfae2
comparison
equal deleted inserted replaced
1972:a0e278364188 1973:81255f93dfcd
245 CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max); 245 CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max);
246 } 246 }
247 247
248 /* End Wisdom from Apple Engineer section. --ryan. */ 248 /* End Wisdom from Apple Engineer section. --ryan. */
249 249
250 /* FIXME: should this go somewhere else? */
251 if (window->flags & SDL_WINDOW_FULLSCREEN) {
252 [nscontext setFullScreen];
253 }
254
255 [pool release]; 250 [pool release];
256 return nscontext; 251 return nscontext;
257 } 252 }
258 253
259 int 254 int
265 260
266 if (context) { 261 if (context) {
267 SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata; 262 SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
268 NSOpenGLContext *nscontext = (NSOpenGLContext *)context; 263 NSOpenGLContext *nscontext = (NSOpenGLContext *)context;
269 264
270 [nscontext setView:[windowdata->window contentView]]; 265 if (window->flags & SDL_WINDOW_FULLSCREEN) {
271 [nscontext update]; 266 [nscontext setFullScreen];
267 } else {
268 [nscontext setView:[windowdata->window contentView]];
269 [nscontext update];
270 }
272 [nscontext makeCurrentContext]; 271 [nscontext makeCurrentContext];
273 } else { 272 } else {
274 [NSOpenGLContext clearCurrentContext]; 273 [NSOpenGLContext clearCurrentContext];
275 } 274 }
276 275