Skip to main content

SDL_SetSurfaceAlphaMod

Function SDL_SetSurfaceAlphaMod 

Source
pub unsafe extern "C" fn SDL_SetSurfaceAlphaMod(
    surface: *mut SDL_Surface,
    alpha: Uint8,
) -> bool
Expand description

Set an additional alpha value used in blit operations.

When this surface is blitted, during the blit operation the source alpha value is modulated by this alpha value according to the following formula:

srcA = srcA * (alpha / 255)

Parameter: surface the SDL_Surface structure to update. Parameter: alpha the alpha value multiplied into blit operations. Returns: true on success or false on failure; call SDL_GetError() for more information.

Thread Safety: This function can be called on different threads with different surfaces.

Available Since: This function is available since SDL 3.2.0.

See Also: SDL_GetSurfaceAlphaMod See Also: SDL_SetSurfaceColorMod