SDL_SetAlpha

Name

SDL_SetAlpha -- Sets the alpha components of a surface

Synopsis

#include "SDL.h"

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

Description

If alpha is non-zero, this function sets the alpha value for the entire surface, as opposed to using the alpha component of each pixel. This value measures the range of transparency of the surface, 0 being completely opaque to 255 being completely transparent.

If flag is 0, alpha blending is disabled for the surface. This will also disable alpha channel on surfaces with an alpha channel (by default, surfaces with an alpha channel will be blitted with slower alpha-blending blit routines).

If flag is SDL_SRCALPHA, alpha blending is enabled for the surface.

If flag is SDL_RLEACCEL will request RLE acceleration when this surface is blitted with SDL_BlitSurface. This can substantially speed up alpha-blended blitting.

See Also

SDL_SetColorKey