OpenGL & Vulkan windowsSDL 3.2

SDL_GL_SwapWindow

Shows the OpenGL frame you just drew (swaps the back and front buffers).

Signature

bool SDL_GL_SwapWindow(SDL_Window *window);

How it works

The SDL equivalent of glfwSwapBuffers: call it once per frame after the last draw. With a swap interval of 1 it waits for the monitor's refresh.

Parameters

windowSDL_Window *

The OpenGL window.

Return value

true on success, false on failure.

Example

example.cpp
1glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
2drawScene();
3SDL_GL_SwapWindow(window);
Official SDL wiki