[SDL] SDL_BlitSurface on MacOSX 10.3.9
Michael Ryan Bannon
ryan.bannon at humagade.com
Wed Jun 28 14:21:19 PDT 2006
Some further information (I'm really hoping somebody might be able to help
me with this...)
The problem, I believe, has something to do with the alpha blending. Each
surface has the following done before the blit:
surface->format->Amask = 0; // turns off per-pixel alpha; note that surface
is an SDL_Surface
SDL_SetAlpha(surface, SDL_SRCALPHA, constantAlpha);
"cosntantAlpha" is a number between 0 and 255. Now, if I set the Amask
parameter to 1, the SDL_SetAlpha call is ignored (I assume) because SDL
thinks that each pixel now has an individual alpha. When I do this, there's
no more 2nd background, which is what I want, but at the same time there's
obviously no alpha blending.
So, I've determined that per-surface alpha blending has something to do with
it (along with Mac OS 10.3.9). Aside from that I'm stumped.
"Michael Ryan Bannon" <ryan.bannon at humagade.com> wrote in message
news:e7pgkp$o7a$1 at sea.gmane.org...
> I'm using SDL_BlitSurface to blend two 800x600 backgrounds. One
> background stays at an alpha at 255 and goes to 0 while the other one, on
> top of it, goes from 0 to 255 at the same rate. Everything works fine
> except for one odd anomoly: my code works fine on MacOSX 10.4.6 version
> but not on my 10.3.9. On the 10.3.9 machine, the back image (the one
> starting at 255) is shifted to the right about 5 pixels. I even tried to
> simplfy it by doing the following:
> SDL_BlitSurface(srcSurface, NULL, targetSurface, NULL);
> I can remedy the problem by setting the position of the backgrounds to the
> right one pixel.
> SDL_Rect rect;
> rect.x = 1;
> rect.y = 0;
> SDL_BlitSurface(srcSurface, NULL, m_targetSurface, rect);
> This works on both OSs, however I would then have a small black line on
> the left side of my window.
> Has anybody seen this problem before or have any idea what might be
> causing it? I can provide more info if needed.
More information about the SDL