| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
SDL
SDL.Surface

# Method SDL.Surface()->display_format_alpha()

Method display_format_alpha

  `SDL.Surface display_format_alpha()`

Description

  This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast blitting onto the display surface. It calls convert_surface() .

  If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and / or alpha value before calling this function.

  This function can be used to convert a colourkey to an alpha channel, if the SDL.SRCCOLORKEY flag is set on the surface. The generated surface will then be transparent (alpha=0) where the pixels match the colourkey, and opaque (alpha=255) elsewhere.

Returns

  The new surface. An error is thrown if the conversion fails.