The SDL documentation claims that if you blit an RGBA image to another
RGBA image with SDL_SRCALPHA off, the RGBA data will be copied to the
destination surface. However, when I load in an alpha-blended surface,
turn off SDL_SRCALPHA on the source surface, and do the copy, I end up
losing my alpha channel, even when the destination surface was
specifically created to be RGBA.
Note that I’m not trying to blend the one image onto another… I’m
just trying to copy a portion of it verbatim, preserving the alpha
My code is as follows:
temp = SDL_CreateRGBSurface(SDL_SRCALPHA, x_size, y_size, 24, 0, 0, 0, 0);
SDL_SetAlpha(sprite_bmp, 0, 128);
SDL_BlitSurface(sprite_bmp, src_rect, temp, dest_rect);
Am I misunderstanding something in the doumentation?