From fa3317f6cdc59e6490673d7900eb19f09e4da05f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 9 Feb 2020 11:54:09 -0800 Subject: [PATCH] Enable double buffering on SDL backends that support it --- app/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index 82e775fd..596476d0 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -347,6 +347,12 @@ int main(int argc, char *argv[]) // initializing the SDL video subsystem to have any effect. SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); + // For SDL backends that support it, use double buffering instead of triple buffering + // to save a frame of latency. This doesn't matter for MMAL or DRM renderers since they + // are drawing directly to the screen without involving SDL, but it may matter for other + // future KMSDRM platforms that use SDL for rendering. + SDL_SetHint(SDL_HINT_VIDEO_DOUBLE_BUFFER, "1"); + if (SDL_InitSubSystem(SDL_INIT_TIMER) != 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_InitSubSystem(SDL_INIT_TIMER) failed: %s",