Skip to main content

SDL_SetWindowOpacity

Function SDL_SetWindowOpacity 

Source
pub unsafe extern "C" fn SDL_SetWindowOpacity(
    window: *mut SDL_Window,
    opacity: f32,
) -> bool
Expand description

Set the opacity for a window.

The parameter opacity will be clamped internally between 0.0f (transparent) and 1.0f (opaque).

This function also returns false if setting the opacity isn’t supported.

Parameter: window the window which will be made transparent or opaque. Parameter: opacity the opacity value (0.0f - transparent, 1.0f - opaque). 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.

Available Since: This function is available since SDL 3.2.0.

See Also: SDL_GetWindowOpacity