mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +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.
This commit is contained in:
parent
4db5e872aa
commit
eac3fd28d8
@ -347,11 +347,13 @@ 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];
|
||||||
|
|
||||||
|
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
|
||||||
/* This gives us the correct viewport for a Retina-enabled view, only
|
/* This gives us the correct viewport for a Retina-enabled view, only
|
||||||
* supported on 10.7+. */
|
* supported on 10.7+. */
|
||||||
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
||||||
viewport = [contentView convertRectToBacking:viewport];
|
viewport = [contentView convertRectToBacking:viewport];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (w) {
|
if (w) {
|
||||||
*w = viewport.size.width;
|
*w = viewport.size.width;
|
||||||
|
Loading…
Reference in New Issue
Block a user