diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index ddf6e5cf20..28c3548201 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -443,7 +443,6 @@ int main(int argc, char *argv[]) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetSwapInterval(1); // Force fullscreen if the resolution is too low to run windowed. if (g_DesktopWidth < 480 * 2 && g_DesktopHeight < 272 * 2) { @@ -571,6 +570,9 @@ int main(int argc, char *argv[]) { NativeResized(); } + // Ensure that the swap interval is set after context creation (needed for kmsdrm) + SDL_GL_SetSwapInterval(1); + SDL_AudioSpec fmt, ret_fmt; memset(&fmt, 0, sizeof(fmt)); fmt.freq = 44100; diff --git a/headless/SDLHeadlessHost.cpp b/headless/SDLHeadlessHost.cpp index c5702eabc4..ac04878237 100644 --- a/headless/SDLHeadlessHost.cpp +++ b/headless/SDLHeadlessHost.cpp @@ -119,11 +119,13 @@ bool GLDummyGraphicsContext::InitFromRenderThread(std::string *errorMessage) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetSwapInterval(1); screen_ = CreateHiddenWindow(); glContext_ = SDL_GL_CreateContext(screen_); + // Ensure that the swap interval is set after context creation (needed for kmsdrm) + SDL_GL_SetSwapInterval(1); + #ifndef USING_GLES2 // Some core profile drivers elide certain extensions from GL_EXTENSIONS/etc. // glewExperimental allows us to force GLEW to search for the pointers anyway.