SDL_GETPIXELFORMATFROMGPUTEXTUREFORMAT(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– SDL_GetPixelFormatFromGPUTextureFormat πŸ’–

okay bestie, so this one lives in the SDL3 functions manual (that's the SDL_GetPixelF...TextureFormat(3) page, the name got a lil truncated in the header, no biggie, she's still iconic) πŸ’…


✨ NAME ✨

SDL_GetPixelFormatFromGPUTextureFormat β€” get the SDL pixel format that corresponds to a GPU texture format. like, you got a GPU texture format and you wanna know which pixel format matches it. that's the whole gig πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_gpu.h>

SDL_PixelFormat SDL_GetPixelFormatFromGPUTextureFormat(SDL_GPUTextureFormat format);

✨ FUNCTION PARAMETERS ✨

  • format β€” a texture format. that's it, that's the input πŸ¦‹

✨ RETURN VALUE ✨

She hands you back the corresponding pixel format, and if there's genuinely no corresponding pixel format to be found? You get SDL_PIXELFORMAT_UNKNOWN instead. not me getting the unknown format 😭 but fr, that's the signal that nothing matched.


✨ AVAILABILITY ✨

This function is available since SDL 3.4.0. so if you're on an older SDL she simply isn't there yet, vibe check your version first 🌸


and that's the whole page, bestie, short and slay. this manual is brought to you by the Simple Directmedia Layer legends, SDL 3.4.18 era, SDL_GetPixelF...TextureFormat(3) β€” mwah, obsessed with her πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from