SDL_Flip(3)
π SDL_Flip(3) π
ok so we're in the SDL API Reference bestie, and today's main character is SDL_Flip π«Ά
β¨ NAME β¨
SDL_Flip β swaps screen buffers π
πΈ SYNOPSIS πΈ
#include "SDL.h"
int SDL_Flip(SDL_Surface *screen);
π¦ DESCRIPTION π¦
okok so listen. If your hardware is out here supporting double-buffering, this function literally just sets up a flip and dips β returns immediately, no waiting around π . The hardware itself will wait for vertical retrace, and then it swaps the video buffers. And that swap happens before the next video surface blit or lock returns. it's giving synchronized, it's giving no tearing, we love to see it β¨
Now if your hardware does NOT support double-buffering? Then bestie, this is literally equivalent to calling SDL_UpdateRect(screen, 0, 0, 0, 0). Same thing, no cap.
π¨ IMPORTANT VIBE CHECK: theSDL_DOUBLEBUFflag must have been passed toSDL_SetVideoModewhen you were setting the video mode. No flag, no hardware flipping. periodt.
π RETURN VALUE π
0β slayed, it worked π-1β nope, there was an error π
π SEE ALSO π
SDL_SetVideoModeSDL_UpdateRectSDL_Surface
and that's the whole page bestie, hope this was iconic for u π stay hydrated, go flip some buffers π
SDL Β· Tue 11 Sep 2001, 23:01 π¦ mwah, catch u in the next manpage π«Άβ¨
π¦ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms