SDL_memset4(3)

πŸ’– SDL_memset4 β€” the 32-bit glow-up πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS manual page for SDL_memset4(3) πŸŽ€ like yes it's a memset, no it's not the boring byte one, stay with me.


✨ NAME ✨

SDL_memset4 β€” fill a whole buffer of memory with one specific value, but make it 32-bit words instead of sad little bytes πŸ¦‹


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

void * SDL_memset4(void *dst, Uint32 val, size_t dwords);

✨ DESCRIPTION ✨

So here's the vibe: this function takes the buffer of dwords Uint32 values that dst points at, and sets every single one of them to the value you put in val. That's it. That's the whole slay. πŸ’…

And the reason she's iconic? Unlike SDL_memset, this one sets 32-bit values, not bytes β€” which means it is not stuck in that tiny 0-255 range. no cap. she can hold so much more 🫢


✨ FUNCTION PARAMETERS ✨

  • dst β€” the destination memory region. Must not be NULL. like literally do not. she will not forgive you 😭
  • val β€” the Uint32 value you wanna set. the whole point of the party.
  • dwords β€” how many Uint32 values you want set in dst. yes, dwords, not bytes, read it again bestie.

✨ RETURN VALUE ✨

Returns dst. she gives you back exactly what you handed her. main character behaviour honestly πŸ‘‘


✨ THREAD SAFETY ✨

It is safe to call this function from any thread. go off, concurrent queen 🌈


✨ AVAILABILITY ✨

This function has been available since SDL 3.2.0. so if you're on anything older… girl. upgrade. ⭐


fr fr: dst must not be NULL. that's not a suggestion, that's a boundary πŸ’€

and that's the page!! Simple Directmedia Layer, SDL 3.4.18, dated SDL_memset4(3) β€” mwah, tysm for reading, go fill some buffers with 32-bit values, ily bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from