SDL_Calculat...ureFormatSize(3)

πŸ’– NAME πŸ’–

SDL_CalculateGPUTextureFormatSize β€” bestie, this is the glow-up math function that tells you how many bytes a texture format is gonna eat up when you give it some dimensions. ✨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

Uint32 SDL_CalculateGPUTextureFormatSize(
    SDL_GPUTextureFormat format,
    Uint32 width,
    Uint32 height,
    Uint32 depth_or_layer_count);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • format β€” the texture format in question, girl. which flavor of pixels are we working with πŸ’…
  • width β€” width, measured in pixels. yes, actual pixels, not vibes πŸ¦‹
  • height β€” height, also in pixels. the vertical situation πŸ“
  • depth_or_layer_count β€” this one's giving dual citizenship πŸ‘‘ it's the depth if you're doing a 3D texture, and the layer count for literally anything else

⭐ RETURN VALUE ⭐

It hands you back the size of a texture that has this format and these dimensions. that's it, that's the whole gift 🎁 no cap.


🌈 AVAILABILITY 🌈

This one's been on the scene since SDL 3.2.0. iconic behavior, honestly πŸ’…βœ¨


okay so that's the whole page, bestie β€” go forth and calculate those texture sizes like the main character you are πŸ«ΆπŸ’œ

with love from the Simple Directmedia Layer girlies, SDL 3.4.18 era, SDL_CalculateGPUTextureFormatSize(3) πŸŽ€πŸ’–

πŸ“¦ where this page comes from