Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed bug 2696 - Mac: fix display mode refresh rate calculation
Alex Szpakowski SDL's Cocoa backend uses the CGDisplayMode API to get refresh rate information about a display mode, but CGDisplayModeGetRefreshRate will return 0 on most non-CRT monitors. The only way I know of to get correct refresh rate information in OS X is via the CoreVideo DisplayLink API. I have attached a patch which tries to use the CVDisplayLinkGetNominalOutputVideoRefreshPeriod function if CGDisplayModeGetRefreshRate fails, which fixes display mode refresh rate information on the monitors I tested. The CVDisplayLink API requires linking with the CoreVideo framework, and the patch updates the various build files to do so.
- Loading branch information
Showing
with
144 additions
and 5 deletions.
- +5 −0 CMakeLists.txt
- +8 −0 Xcode/SDL/SDL.xcodeproj/project.pbxproj
- +92 −0 Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
- +1 −0 configure
- +1 −0 configure.in
- +1 −0 premake/README-macosx.txt
- +1 −0 premake/projects/SDL2.lua
- +35 −5 src/video/cocoa/SDL_cocoamodes.m
# The Mac OS X platform requires special setup. | ||
EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" | ||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc" | ||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo" | ||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" | ||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" | ||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" |