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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms