SDL_GETGPUSWAPCHAINTEXTUREFORMAT(3)

πŸ’– NAME πŸ’–

SDL_GetGPUSwapchainTextureFormat β€” the little guy that tells you what texture format your window's swapchain is serving, bestie πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_gpu.h>

SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(
    SDL_GPUDevice *device,
    SDL_Window *window);

🌸 DESCRIPTION 🌸

okay so real talk: this function hands you the texture format of the swapchain for the window you pass in. that's it, that's the job, and it does it flawlessly πŸ’…

⚠️ heads up queen: this format can change if the swapchain parameters change. so don't go hard-coding it once and pretending it's forever β€” that's not the vibe, that's a bug. check it again when things shift, iykyk.

🫢 FUNCTION PARAMETERS 🫢

  • device β€” a GPU context. the whole GPU situation. your main character device ✨
  • window β€” an SDL_Window that has been claimed. not just any window, bestie β€” a claimed one. respect the claim πŸ™ˆ

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns the texture format of the swapchain. that's the SDL_GPUTextureFormat, no cap πŸ’–


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on something older, it's giving ✨nothing✨, sorry babe 😭


and that's the whole page, fr fr. go forth and format your swapchains correctly, you absolute legend πŸ¦‹

β€” brought to you by the lovely people at Simple Directmedia Layer, this is SDL 3.4.18, page SDL_GetGPUSwa...TextureFormat(3) πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from