[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: SDL Surface Bliting



That solved the problem thanks. I remember seeing a note in the SDL_CreateRGBSurface about turning off alpha sometimes not working and needing to call SDL_SetAlpha. I didn't think it would be a problem for me since I did specify it and was drawing a solid image first.

Quoting Christian Henz <chrhenz@xxxxxx>:

This seems to be an alpha-blending problem.
Here is a quick fix:

SDL_Surface *display = SDL_CreateRGBSurface(SDL_SWSURFACE, 112, 88, 32, rmask, gmask, bmask, amask);
if (display)
std::cout << "Display Good" << std::endl;
SDL_SetAlpha( display, 0, 0 ); // Ignore the alpha-channel when blitting this surface


See the documentation for SDL_SetAlpha for details.

cheers,
Christian Henz