Sign in to follow this  

Strange FPS increase/decrease

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this