Smooth scrolling in the SDL port on macOS

This commit is contained in:
Lior Halphon 2021-09-06 15:21:02 +03:00
parent b27bd4eed7
commit d8a9f12a4f

View File

@ -682,10 +682,21 @@ static bool get_arg_flag(const char *flag, int *argc, char **argv)
return false;
}
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
static void enable_smooth_scrolling(void)
{
CFPreferencesSetAppValue(CFSTR("AppleMomentumScrollSupported"), kCFBooleanTrue, kCFPreferencesCurrentApplication);
}
#endif
int main(int argc, char **argv)
{
#ifdef _WIN32
SetProcessDPIAware();
#endif
#ifdef __APPLE__
enable_smooth_scrolling();
#endif
fprintf(stderr, "SameBoy v" GB_VERSION "\n");