SDL_FlipSurface(3)

πŸ’– SDL_FlipSurface(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_FlipSurface β€” yes, the one that flips a surface vertically or horizontally. it's giving "mirror mirror on the wall" but for pixels. πŸͺžβœ¨


🌸 NAME 🌸

SDL_FlipSurface β€” flip a surface vertically or horizontally. that's it, that's the whole job, and she does it flawlessly. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_surface.h>

bool SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);

like. two args. in, out, flipped. no cap. πŸ¦‹


✨ FUNCTION PARAMETERS ✨

  • surface β€” the surface you wanna flip. your canvas, your blorbo, your little pixel baby. 🫢
  • flip β€” the direction to flip. which way are we yeeting this thing? that's what SDL_FlipMode is here to tell you. 🧭

πŸ’œ RETURN VALUE πŸ’œ

returns true when it ate and left no crumbs (aka success), or false if it did NOT go well (aka failure). and if it failed, bestie, go call SDL_GetError() for more information β€” she will tell you exactly what went wrong, no gatekeeping. 😭


🧚 THREAD SAFETY 🧚

this function can be called on different threads with different surfaces. so yes, you and your mutuals can each flip your own surface simultaneously, everybody gets their own. it's called community, look it up. πŸ‘‘


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. if you're on anything older, she simply does not exist yet, so. upgrade era. 🌈


lowkey a reminder: flip responsibly, check your return value, and always SDL_GetError() when things get messy. the error message is your bestie too. πŸ’–

mwah πŸ’‹ that's the whole page! this lil' slice of the manual is brought to you by Simple Directmedia Layer, straight outta SDL 3.4.18, and this specific page is dated SDL_FlipSurface(3) β€” yeah, same name as the function, the page said "I am her." πŸŽ€βœ¨ bye bestie, go flip something pretty! πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from