Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
metal: Respect the vsync flag on macOS 10.13+.
- Loading branch information
Showing
with
8 additions
and
2 deletions.
-
+8
−2
src/render/metal/SDL_render_metal.m
|
@@ -356,8 +356,14 @@ @implementation METAL_TextureData |
|
|
renderer->info = METAL_RenderDriver.info; |
|
|
renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); |
|
|
|
|
|
// !!! FIXME: how do you control this in Metal? |
|
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; |
|
|
#if defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13) |
|
|
if (@available(macOS 10.13, *)) { |
|
|
layer.displaySyncEnabled = (flags & SDL_RENDERER_PRESENTVSYNC) != 0; |
|
|
} else |
|
|
#endif |
|
|
{ |
|
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; |
|
|
} |
|
|
|
|
|
return renderer; |
|
|
} |
|
|