SDL_MUSTLOCK(3)

πŸ’– SDL_MUSTLOCK β€” NAME πŸ’–

okay bestie, so SDL_MUSTLOCK is a macro, and it evaluates to true if the surface needs to be locked before access. that's literally the whole vibe. if it's giving true, lock that surface first, no cap. πŸ”’βœ¨


🌸 SYNOPSIS 🌸

first, you gotta pull in the header:

#include <SDL3/SDL_surface.h>

and here's the macro itself, exactly as it is, don't come for me:

#define SDL_MUSTLOCK(S) (((S)->flags & SDL_SURFACE_LOCK_NEEDED) == SDL_SURFACE_LOCK_NEEDED)

she's a one-liner and she ate. πŸ’…


πŸ¦‹ AVAILABILITY πŸ¦‹

this macro has been around since SDL 3.2.0. so if you're on something older... girl, upgrade. 😭


kay so that's the whole page, mwah 🫢 this iconic little entry comes to you from Simple Directmedia Layer, version SDL 3.4.18 β€” go forth and lock your surfaces responsibly, bestie πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from