src/video/cocoa/SDL_cocoawindow.m
changeset 7746 6a05d7352575
parent 7740 415bb39617a1
child 7771 4434498bf4b9
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Sep 27 22:09:51 2013 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Sep 20 13:43:00 2013 -0400
     1.3 @@ -34,6 +34,13 @@
     1.4  #include "SDL_cocoamouse.h"
     1.5  #include "SDL_cocoaopengl.h"
     1.6  
     1.7 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
     1.8 +/* Taken from AppKit/NSOpenGLView.h in 10.8 SDK. */
     1.9 +@interface NSView (NSOpenGLSurfaceResolution)
    1.10 +- (BOOL)wantsBestResolutionOpenGLSurface;
    1.11 +- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
    1.12 +@end
    1.13 +#endif
    1.14  
    1.15  static Uint32 s_moveHack;
    1.16  
    1.17 @@ -739,6 +746,13 @@
    1.18      /* Create a default view for this window */
    1.19      rect = [nswindow contentRectForFrameRect:[nswindow frame]];
    1.20      NSView *contentView = [[SDLView alloc] initWithFrame:rect];
    1.21 +
    1.22 +    if ((window->flags & SDL_WINDOW_ALLOW_HIGHDPI) > 0) {
    1.23 +        if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
    1.24 +            [contentView setWantsBestResolutionOpenGLSurface:YES];
    1.25 +        }
    1.26 +    }
    1.27 +
    1.28      [nswindow setContentView: contentView];
    1.29      [contentView release];
    1.30