I'm trying to achieve proper animation using SDL. Used flags are SDL_HWSURFACE and SDL_DOUBLEBUF.
That what I'm getting is technically smooth (I think), but I can figure out what should I do to remove that trail? My animation is time-based (I'm calculating displacement with delta time).
Link to to video: https://vimeo.com/62065078
my (every-frame) drawing function is like:
for(int x = 0; x < screen->w; ++x)
for(int y = 0; y < screen->h; ++y)
draw_pixel(screen, x, y, 136, 136, 136);
and ball:
filledCircleColor(screen, ball.x, ball.y, 17, 0x000000ff);
and finally:
SDL_Flip(screen);
main loop is:
for(;;) {
curr_ts = stopwatch_seconds_elapsed(sw);
d_time = curr_ts - prev_ts;
prev_ts = curr_ts;
cpSpaceStep(space, d_time);
draw_scene(screen);
}