SDL_DEFINE_PIXELFOURCC(3)

πŸ’– SDL_DEFINE_PIXELFOURCC πŸ’–

okay bestie, welcome to the SDL_DEFINE_PIXELFOURCC(3) page from the SDL3 FUNCTIONS crew β€” this one's short, sweet, and lowkey iconic. it's a macro. it makes custom FourCC pixel formats. that's the whole vibe. let's go ✨


🌸 NAME 🌸

SDL_DEFINE_PIXELFOURCC β€” a macro for defining custom FourCC pixel formats. yes, that's literally the whole job. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_pixels.h>

#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)

look at her. four lil args in, one format value out. she's giving minimalist queen. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the way this works is: you hand her four characters, she hands you back a FourCC-style pixel format. that's it. that's the function.

like, for example, defining SDL_PIXELFORMAT_YV12 looks exactly like this:

SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2')

and boom, you've got yourself a format. obsessed. fr fr πŸ“


✨ MACRO PARAMETERS ✨

  • A β€” the first character of the FourCC code. the opening act. the main character entrance. πŸ‘‘
  • B β€” the second character of the FourCC code. keeping the momentum going, we love to see it.
  • C β€” the third character of the FourCC code. third-wheel energy but make it essential. πŸ’œ
  • D β€” the fourth character of the FourCC code. the closer. the periodt of the group. πŸ”₯

🌈 RETURN VALUE 🌈

Returns a format value in the style of SDL_PixelFormat. so like, a real, usable format, not just some cute little number. she delivers. 🫢


🧚 THREAD SAFETY 🧚

It is safe to call this macro from any thread. go wild, bestie β€” every thread can have a lil taste. no drama, no locks, no tears. 😭✨


⭐ AVAILABILITY ⭐

This macro is available since SDL 3.2.0. so if you're on something older, sorry babe, upgrade time. πŸŽ€


πŸ’€ tiny warning from me to you: this is a macro, not a function, so there's no runtime anything happening β€” it's all compile-time handiwork. just keep those four chars exactly how you mean them, iykyk.

okay that's the whole page, and honestly? she ate. short, useful, four characters of pure destiny. mwah πŸ’–

k bye, this was the SDL_DEFINE_PIXELFOURCC(3) page β€” brought to you by Simple Directmedia Layer, version SDL 3.4.18, from the SDL 3.4.18 manual era. love u, go define some FourCCs πŸŒΈπŸ’…

πŸ“¦ where this page comes from