mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-02-04 11:15:57 +01:00
macOS: Fix non-highdpi OpenGL contexts not scaling properly in macOS 10.15 (bug 4810 and 4822).
This commit is contained in:
parent
72660a51dd
commit
009226c61e
@ -1486,10 +1486,11 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window)
|
|||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
#endif
|
#endif
|
||||||
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
|
/* 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:)]) {
|
if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
|
||||||
[contentView setWantsBestResolutionOpenGLSurface:YES];
|
BOOL highdpi = (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) != 0;
|
||||||
}
|
[contentView setWantsBestResolutionOpenGLSurface:highdpi];
|
||||||
}
|
}
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
Loading…
Reference in New Issue
Block a user