Function SDL_SetTextureAlphaMod

pub unsafe extern "C" fn SDL_SetTextureAlphaMod(
    texture: *mut SDL_Texture,
    alpha: u8,
) -> bool
Available on crate feature dep_sdl3 only.
Expand description

Set an additional alpha value multiplied into render copy operations.

When this texture is rendered, during the copy operation the source alpha value is modulated by this alpha value according to the following formula:

srcA = srcA * (alpha / 255)

Alpha modulation is not always supported by the renderer; it will return false if alpha modulation is not supported.

§Parameters

  • texture: the texture to update.
  • alpha: the source alpha value multiplied into copy operations.

§Return value

Returns true on success or false on failure; call SDL_GetError() for more information.

§Thread safety

This function should only be called on the main thread.

§Availability

This function is available since SDL 3.2.0.

§See also