Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

SDL2, Box2D, and Display Stuttering

$
0
0

I have a basic implementation of SDL2 and Box2D with a ball bouncing inside of a box.  Ball movement is occasionally jittery.  After a couple of days of debugging, I still can't figure out what's wrong.

Here are my constants:

    const float HALF = 0.5f;
    const float DOUBLE = 2.0f;
    const float INVERT = -1.0f;
    const float FRAMES_PER_SECOND = 60.0f;

    const int PHYSICS_POSITION_ITERATIONS = 8;
    const int PHYSICS_VELOCITY_ITERATIONS = 12;

    const float WORLD_UNIT = 2.0f;
    const float WORLD_WIDTH = 80.0f;
    const float WORLD_HEIGHT = 60.0f;
    const float WORLD_TIME_RESOLUTION = 1.0f / FRAMES_PER_SECOND;
    const float WORLD_TIME_ELAPSED_ZERO = 0.0f;
    const float WORLD_GRAVITY_ZERO = 0 …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>