Skip to content

Commit

Permalink
macOS: Fix non-highdpi OpenGL contexts not scaling properly in macOS …
Browse files Browse the repository at this point in the history
…10.15 (bug 4810 and 4822).
  • Loading branch information
slime73 committed Oct 14, 2019
1 parent 72660a5 commit 009226c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -1486,10 +1486,11 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
[contentView setWantsBestResolutionOpenGLSurface:YES];
}
/* Note: as of the macOS 10.15 SDK, this defaults to YES instead of NO when
* the NSHighResolutionCapable boolean is set in Info.plist. */
if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
BOOL highdpi = (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) != 0;
[contentView setWantsBestResolutionOpenGLSurface:highdpi];
}
#ifdef __clang__
#pragma clang diagnostic pop
Expand Down

0 comments on commit 009226c

Please sign in to comment.