Update main.c

Fixed interface Scale in MacOS in get_scale function
This commit is contained in:
Nikolai Sinyov 2021-08-19 10:07:46 +03:00 committed by GitHub
parent b6af395fc7
commit 1687bbd92d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -18,9 +18,13 @@
SDL_Window *window;
static double get_scale(void) {
#ifdef __APPLE__
return 1.0;
#else
float dpi = 96.0;
SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
return dpi / 96.0;
#endif
}