Jump to content
  • Advertisement
Sign in to follow this  
Alpha Nox

SDL - RLE_ACCEL

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!