SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_CalculateGPUTextureFormatSize

Calculate the size in bytes of a texture format with dimensions.

Header File

Defined in <SDL3/SDL_gpu.h>

Syntax

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

Function Parameters

SDL_GPUTextureFormat format a texture format.
Uint32 width width in pixels.
Uint32 height height in pixels.
Uint32 depth_or_layer_count depth for 3D textures or layer count otherwise.

Return Value

(Uint32) Returns the size of a texture with this format and dimensions.

Version

This function is available since SDL 3.1.3.


CategoryAPI, CategoryAPIFunction, CategoryGPU


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.