mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-12 05:41:10 +01:00
cocoa: GL_GetDrawableSize only uses -[NSView convertRectToBacking] for highDPI.
On Mojave, this will report large numbers for retina displays in fullscreen mode, which isn't how it works on previous versions. (transplanted from c6c1731780e2bef94f944a4795e2dfbba46d9500)
This commit is contained in:
parent
b262b0ebc9
commit
072e17bf98
@ -347,10 +347,12 @@ Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
|
|||||||
NSView *contentView = [windata->nswindow contentView];
|
NSView *contentView = [windata->nswindow contentView];
|
||||||
NSRect viewport = [contentView bounds];
|
NSRect viewport = [contentView bounds];
|
||||||
|
|
||||||
/* This gives us the correct viewport for a Retina-enabled view, only
|
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
|
||||||
* supported on 10.7+. */
|
/* This gives us the correct viewport for a Retina-enabled view, only
|
||||||
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
* supported on 10.7+. */
|
||||||
viewport = [contentView convertRectToBacking:viewport];
|
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
||||||
|
viewport = [contentView convertRectToBacking:viewport];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w) {
|
if (w) {
|
||||||
|
Loading…
Reference in New Issue
Block a user