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