I put together a test program that just bounces 2 sprites around in a
window. They bounce off each other and off the sides of the window, and
it has a simple gravity caclulation. It has a collsion response function
that is fairly sophisticated but only runs when there is indeed a
collision, and my collision detection algorithm is linear and very
However, my CPU usage is always in the 80-90% range when the program is
running. I had some of my calculations as floating point operations, and
I converted them to use all integer ops where possible, and that seems to
have increased my framerate from 50fps to 75fps or so, but no reduction in
CPU load. Is this normal behavior? Could this be caused by the blitting?
I do a SDL_DisplayFormat() on the sprites after loading them so I assume
its not because SDL has to convert the images each blit. If anyone is
interested in seeing the code I put a tarball at
Vanity. Definitely my favorite sin.