SDL_UpdateRect(3)
π SDL_UpdateRect(3) β the SDL API Reference glow-up β¨
okay bestie, so this one's from the SDL API Reference and it's giving "make my pixels show up" energy. let's get into it π«Ά
πΈ NAME πΈ
SDL_UpdateRect β makes sure the given area is updated on the given screen. that's it, that's the whole job, and she does it flawlessly π
β¨ SYNOPSIS β¨
#include "SDL.h"
void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w,
Sint32 h);
like yes, she takes five args. we love a thorough queen π
π DESCRIPTION π
so basically, SDL_UpdateRect makes sure the given area is updated on the given screen. iconic. that's her main character moment.
β οΈ but listen, the rectangle must be confined within the screen boundaries β no clipping is done. not a single pixel gets trimmed for you. so don't come at her with a rectangle that's hanging off the edge, she will NOT be fixing that for you π
if x, y, w and h are all 0, then SDL_UpdateRect will update the entire screen. zeroes across the board = full-screen slay, no cap π
π« and this part is important fr fr: this function should not be called while screen is locked. locked screen + update = do not. just don't. π
π¦ SEE ALSO π¦
SDL_UpdateRectsβ the plural version, she does many at once πSDL_Rectβ the rectangle struct of your dreamsSDL_Surfaceβ the screen/thing you're drawing onSDL_LockSurfaceβ the lock in question. remember the warning above bestie, iykyk π
and that's the whole page, periodt. π this was pulled straight from the SDL API Reference, dated Tue 11 Sep 2001, 23:01 β a vintage queen, honestly, and she still ate. mwah πβ¨π
π¦ 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