[SDL] Setting a colorkey on a primitive function?

Started by
10 comments, last by KazenoZ 12 years, 9 months ago
I thought that RLE was automatically set when you use DisplayFormat()?

It's not. DisplayFormat only converts the surface to the same format as the screen surface so it don't have to make the conversion every time you call SDL_BlitSurface.

Also SetColorKey doesn't work if you only set it at the beginning, you need to set it each time you're using the color, but even though that is only done once, still it causes the slowdown....
You should only have to set the colorkey once for each surface you use it on and you probably want to set it when you have finished blitting to it. So in the example code I posted I think it is in a good place.

Are you you creating the overlay surface every frame? How do you notice the slowdown? Do SDL_RLEACCEL make any difference at all?
Advertisement
That did all the difference, put it on every instance of SetColorKey and now there's no drop at all, going as fast as it should, thanks alot =)

This topic is closed to new replies.

Advertisement