SDL_UpdateWindowSurface(3)
β¨ SDL_UpdateWindowSurface β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, this one lives in SDL_UpdateWindowSurface(3) and it's literally the glow-up moment for your window π
πΈ NAME πΈ
SDL_UpdateWindowSurface β copy the window surface to the screen π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_video.h>
bool SDL_UpdateWindowSurface(SDL_Window *window);
π DESCRIPTION π
So here's the tea π β this is the function you use when you've been drawing on a surface and you need all those changes to actually show up on the screen. You did the art, now you make it visible. It's giving "reveal" energy β¨
And fun fact, no cap: this function is equivalent to the SDL 1.2 API SDL_Flip(). Same vibe, new era π
π FUNCTION PARAMETERS π
windowβ the window to update. that's it, that's the whole arg π«Ά
π RETURN VALUE π
Returns true on success or false on failure π and if it's giving failure, call SDL_GetError() for more information β she will tell you what went wrong, fr fr.
π§ THREAD SAFETY π§
β οΈ okay this part matters: this function should only be called on the main thread. do not try to be sneaky from another thread, that's not the move π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, bestie, you're not invited to this party π
π SEE ALSO π
Simple Directmedia Layer π¦ SDL 3.4.18 β mwah, that's the whole page bestie, go update that surface and slay π β¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms