mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
metal: Respect the vsync flag on macOS 10.13+.
This commit is contained in:
parent
e24dc9053b
commit
42b19c9749
@ -356,8 +356,14 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
renderer->info = METAL_RenderDriver.info;
|
renderer->info = METAL_RenderDriver.info;
|
||||||
renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
||||||
|
|
||||||
// !!! FIXME: how do you control this in Metal?
|
#if defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13)
|
||||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
if (@available(macOS 10.13, *)) {
|
||||||
|
layer.displaySyncEnabled = (flags & SDL_RENDERER_PRESENTVSYNC) != 0;
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||||
|
}
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user