SDL - RLE_ACCEL

Started by
3 comments, last by Alpha Nox 18 years, 7 months ago
Hello everyone, First, I wanna thank everyone for being extremely helpful with my questions and doubts. I successfully implemented SDL alpha blending effects in SDL and they are working good, but I notice some performance slow down in the game performance. I'm not using SDL_RLEACCEL in SDL_Colorkey and neither in Alpha Blending effects. I'm using like this: SDL_SetAlpha(fadescr,SDL_SRCALPHA,AlphaValue); But when i try to put: SDL_SetAlpha(fadescr,SDL_RLEACCEL,AlphaValue); it doesnt work... Is it right? What's wrong with it? Do I have considerable gains with RLEACCEL? Thanks very much, Victor Freire
Advertisement
SDL_RLEACCEL should help blitting only paletted images (e.g. 8 bit). RLE is short for length encoding which means that the image is stored in a different format than usual. In this case an image doesn't consist of raw pixels but a combination of number of pixels followed by the color, e.g. instead of:
xxxxx
xxooo
oooxx
the image is stored as followed:
5x
2x3o
3o2x
This has the advantage that during colorkeying not every pixel has to be masked because it is known beforehand how many pixels are opaque and how many transparent.
baumep
I got it now, but am I using it correctly?
Most of my game sprites and stored in 256 color bitmap files.

Should I use it?

Will I have a good amount of performance gain?

Thanks for the quick anwser.
Yes, use it.
But if your screen depth is higher than 8 bits it might be better to convert all surfaces to the display format (SDL_DisplayFormat) before blitting.
And if you're relying heavily on transparency effects and want best performance I'd suggest using glSDL (an OpenGL backend for SDL).
baumep
Ok, I will try it.

Thanks very much for your help.

This topic is closed to new replies.

Advertisement