SDL_ISPIXELFORMAT_ALPHA - Man Page

Name

SDL_ISPIXELFORMAT_ALPHA ā€” A macro to determine if an SDL_PixelFormat
has an alpha channel.

Header File

Defined in SDL3/SDL_pixels.h

Synopsis

#include "SDL3/SDL.h"

#define SDL_ISPIXELFORMAT_ALPHA(format)   .BI ((SDL_ISPIXELFORMAT_PACKED(format)&&.BI      ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || .BI (SDL_PIXELORDER(format)==SDL_PACKEDORDER_RGBA)||.BI       (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || .BI (SDL_PIXELORDER(format)==SDL_PACKEDORDER_BGRA)))||.BI     (SDL_ISPIXELFORMAT_ARRAY(format) && .BI ((SDL_PIXELORDER(format)==SDL_ARRAYORDER_ARGB)||.BI       (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || .BI (SDL_PIXELORDER(format)==SDL_ARRAYORDER_ABGR)||.BI       (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))

Description

Note that this macro double-evaluates its parameter, so do not use expressions with side-effects here.

Return Value

Returns true if the format has alpha, false otherwise.

Thread Safety

It is safe to call this macro from any thread.

Availability

This macro is available since SDL 3.2.0.

Info

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS