I'm trying to get a transparent SDL_Surface (to blit translucent rectangles on it), and here's what I've done:
surface := SDL_CreateRGBSurface(SDL_SWSURFACE, XMAX*TILE_SIZE,
YMAX*TILE_SIZE, BPP, 0, 0, 0, SDL_ALPHA_TRANSPARENT);
SDL_FillRect(surface, nil, SDL_MapRGBA(surface^.format, 0, 0, 0, 0));
This still doesn't work, the surface I get is black instead of being transparent. Any idea?
BONUS: To avoid the blitting of multiple translucide rectangles on top of each other, is there any way I can remove these rectangles then blit the new one (without blitting again the background ...) ?