Skip to content

Commit

Permalink
Call SDL_GL_SetSwapInterval() after GL context creation (#3997)
Browse files Browse the repository at this point in the history
  • Loading branch information
JupiterRider authored May 21, 2024
1 parent 9ef29af commit c7f098f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/platforms/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,11 +1499,6 @@ int InitPlatform(void)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
}

if (CORE.Window.flags & FLAG_VSYNC_HINT)
{
SDL_GL_SetSwapInterval(1);
}

if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
{
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
Expand Down Expand Up @@ -1537,6 +1532,15 @@ int InitPlatform(void)
TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height);
TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);

if (CORE.Window.flags & FLAG_VSYNC_HINT)
{
SDL_GL_SetSwapInterval(1);
}
else
{
SDL_GL_SetSwapInterval(0);
}
}
else
{
Expand Down

0 comments on commit c7f098f

Please sign in to comment.