src/video/cocoa/SDL_cocoaopengl.m
branchSDL-ryan-batching-renderer
changeset 12350 b1a820d2f1aa
parent 11811 5d94cb6b24d3
child 12343 84eaa0636bac
equal deleted inserted replaced
12349:a67dedb293c8 12350:b1a820d2f1aa
   345 {
   345 {
   346     SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
   346     SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
   347     NSView *contentView = [windata->nswindow contentView];
   347     NSView *contentView = [windata->nswindow contentView];
   348     NSRect viewport = [contentView bounds];
   348     NSRect viewport = [contentView bounds];
   349 
   349 
   350     /* This gives us the correct viewport for a Retina-enabled view, only
   350     if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
   351      * supported on 10.7+. */
   351         /* This gives us the correct viewport for a Retina-enabled view, only
   352     if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
   352          * supported on 10.7+. */
   353         viewport = [contentView convertRectToBacking:viewport];
   353         if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
       
   354             viewport = [contentView convertRectToBacking:viewport];
       
   355         }
   354     }
   356     }
   355 
   357 
   356     if (w) {
   358     if (w) {
   357         *w = viewport.size.width;
   359         *w = viewport.size.width;
   358     }
   360     }