Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112)

This commit is contained in:
Noel Berry 2022-08-24 11:25:13 -07:00 committed by GitHub
parent 70c781c803
commit 00452e47fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 122 additions and 142 deletions

View file

@ -385,28 +385,6 @@ Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
return 0;
}}
void
Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
{ @autoreleasepool
{
SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata;
NSView *contentView = windata.sdlContentView;
NSRect viewport = [contentView bounds];
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
/* This gives us the correct viewport for a Retina-enabled view. */
viewport = [contentView convertRectToBacking:viewport];
}
if (w) {
*w = viewport.size.width;
}
if (h) {
*h = viewport.size.height;
}
}}
int
Cocoa_GL_SetSwapInterval(_THIS, int interval)
{ @autoreleasepool