SDL_SurfaceFlags(3type)

πŸ’– SDL_SurfaceFlags πŸ’–

okay bestie, welcome to the SDL_SurfaceFlags(3type) page β€” this is from the SDL3 datatypes corner of the manual, and it's genuinely such a cute little typedef, no cap. sit down, grab a strawberry πŸ“, let's get into it.


✨ NAME ✨

SDL_SurfaceFlags β€” the flags on an SDL_Surface.

like, all of them. the whole vibe check of a surface, in one Uint32. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_surface.h>

typedef Uint32 SDL_SurfaceFlags;

#define SDL_SURFACE_PREALLOCATED    0x00000001u /**< Surface uses preallocated pixel memory */
#define SDL_SURFACE_LOCK_NEEDED     0x00000002u /**< Surface needs to be locked to access pixels */
#define SDL_SURFACE_LOCKED          0x00000004u /**< Surface is currently locked */
#define SDL_SURFACE_SIMD_ALIGNED    0x00000008u /**< Surface uses pixel memory allocated with SDL_aligned_alloc() */

okay so let's break down the cast of characters, because each one of these is a whole personality:

  • SDL_SURFACE_PREALLOCATED β€” value 0x00000001u β€” the surface is using preallocated pixel memory. she came with her own pixels, she didn't borrow yours. πŸ’–
  • SDL_SURFACE_LOCK_NEEDED β€” value 0x00000002u β€” the surface needs to be locked before you can access pixels. read the room, lock first. πŸ”’
  • SDL_SURFACE_LOCKED β€” value 0x00000004u β€” the surface is currently locked. right now. as we speak. πŸ‘€
  • SDL_SURFACE_SIMD_ALIGNED β€” value 0x00000008u β€” the surface uses pixel memory allocated with SDL_aligned_alloc(). aligned, gorgeous, SIMD-ready, main character energy. ✨
ngl, the exact hex values matter β€” don't go renaming them or remixing them, they're literally bit flags and the bits are doing bits. πŸŽ€

πŸ’œ DESCRIPTION πŸ’œ

so these flags? they're generally considered read-only. like, look but don't touch. admire from afar. do not be out here editing them and then acting surprised when things get weird. πŸ™ˆ

that's the whole description. short, iconic, periodt. πŸ‘‘


πŸ¦‹ AVAILABILITY πŸ¦‹

this datatype has been available since SDL 3.2.0. so if you're on anything older, bestie, it's giving "not yet" 😭 β€” go update.


and that's the page!! every flag accounted for, nothing skipped, we ate and left no crumbs 🫢✨

sending you off with love from Simple Directmedia Layer β€” this was SDL 3.4.18, and yes, this exact page is SDL_SurfaceFlags(3type). mwah πŸ’‹ go lock your surfaces. πŸ’…

πŸ“¦ where this page comes from