Function SDL_BITSPERPIXEL
pub const fn SDL_BITSPERPIXEL(format: SDL_PixelFormat) -> u8
Available on crate feature
dep_sdl3
only.Expand description
A macro to determine an SDL_PixelFormat’s bits per pixel.
Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.
FourCC formats will report zero here, as it rarely makes sense to measure them per-pixel.
§Parameters
format
: anSDL_PixelFormat
to check.
§Return value
Returns the bits-per-pixel of format
.
§Thread safety
It is safe to call this macro from any thread.
§Availability
This macro is available since SDL 3.2.0.