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

Re: SDL Surface Bliting

On Fri, Jan 19, 2007 at 08:05:26PM -0700, dulsi@xxxxxxxxxxxxxxxxxxxxx wrote:
> Quoting Brian <brian.ripoff@xxxxxxxxx>:
> >Can you post some code? What you're describing should work.
> Hmm... I was hoping it was something simple and obvious.  I put together
> a small example at:
> http://identicalsoftware.com/testsdl.tgz
> Uncomment the define for DIRECT to see it work.
> >Make sure you check the return values of any surface creation, loading
> >or blitting functions to see if any errors have occurred.
> Everything returns correctly.
> Dennis Payne
> dulsi@xxxxxxxxxxxxxxxxxxxxx

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.

Christian Henz