git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit d8a9f12a4fa4ed81f02ccc722fb9cfeb8e37f7cb
parent b27bd4eed7e569d0f534ddb3a6f4cf689a0593a9
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Mon,  6 Sep 2021 15:21:02 +0300

Smooth scrolling in the SDL port on macOS

Diffstat:
MSDL/main.c11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/SDL/main.c b/SDL/main.c @@ -682,11 +682,22 @@ 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"); bool fullscreen = get_arg_flag("--fullscreen", &argc, argv) || get_arg_flag("-f", &argc, argv);

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.