SDL_GETGPUTEXTUREFORMATFROMPIXELFORMAT(3)

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

✨ NAME ✨

SDL_GetGPUTextureFormatFromPixelFormat β€” bestie, this is the little translator that takes an SDL pixel format and tells you which GPU texture format it matches up with πŸ’–


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

SDL_GPUTextureFormat SDL_GetGPUTextureFormatFromPixelFormat(SDL_PixelFormat format);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • format β€” a pixel format. that's it, that's the whole vibe, just hand her the pixel format and she'll do the rest 🫢

πŸ¦‹ RETURN VALUE πŸ¦‹

She hands you back the corresponding GPU texture format β€” iconic, no notes ✨

But listen carefully: if there's literally no corresponding GPU texture format, you get SDL_GPU_TEXTUREFORMAT_INVALID back instead. Not an error code, not a vibe, just that. so like, check for it, okay? 😭


πŸ’… AVAILABILITY πŸ’…

This function has been serving looks since SDL 3.4.0. if your SDL is older than that, she simply does not exist yet, sorry bestie πŸ’€


and that's the whole page, you ate it, periodt πŸ‘‘ this lil slice of wisdom came to you from Simple Directmedia Layer, version SDL 3.4.18 β€” go forth and format your textures, iykyk πŸŒˆπŸ§šπŸ’œ

πŸ“¦ where this page comes from