| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | */ |
| | | #include "../../SDL_internal.h" |
| | | |
| | | #if SDL_VIDEO_DRIVER_UIKIT |
| | | #if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2) |
| | | |
| | | #include "SDL_uikitopengles.h" |
| | | #import "SDL_uikitopenglview.h" |
| | |
| | | if (h) { |
| | | *h = glview.backingHeight; |
| | | } |
| | | } else { |
| | | SDL_GetWindowSize(window, w, h); |
| | | } |
| | | } |
| | | } |
| | |
| | | /* Set the scale to the natural scale factor of the screen - the |
| | | * backing dimensions of the OpenGL view will match the pixel |
| | | * dimensions of the screen rather than the dimensions in points. */ |
| | | #ifdef __IPHONE_8_0 |
| | | if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { |
| | | scale = data.uiwindow.screen.nativeScale; |
| | | } else |
| | | #endif |
| | | { |
| | | } else { |
| | | scale = data.uiwindow.screen.scale; |
| | | } |
| | | } |