Jump to content
  • Advertisement
Sign in to follow this  

Strange FPS increase/decrease

This topic is 3052 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

I've created a pretty nice graphics engine wrapped around SDL, but something weird is happening that I can't quite figure out. I've found that when my engine renders 10000 10x10 SDL_Surfaces with no alpha transparency (SDL_SetAlpha( surface_, SDL_SRCALPHA, 255 )) I get about 80 FPS. But, when the alpha level is below 255, the FPS jumps to somewhere between 120 and 130. In light of that, I decided that I should cap the alpha value at 254 which would ensure an FPS increase of about 40-50. But this causes all blits to change the color value just slightly. For instance, if a surface filled with the color red (255, 0, 0) and an alpha of the 254 cap is blitted onto a surface filled with cyan (0, 255, 255), the resulting color is an off red (253, 1, 1). As small as this difference is, it is still unacceptable. So, if I can't cap the alpha at 254, then I need a reason my FPS jumps that high at alpha levels below 255 and I need a way to reproduce that FPS increase without capping the alpha. Any ideas?

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!