Stutter when rendering moving objects

Hi,

I've made a simple program where a square moves and bounces in the screen. At low speed (i.e 1 pixel per render loop) the square moves smoothly. But at higher speeds rendering will start to "stutter".

Since raylib asks you to set the framerate I assume that the render loop is automatically controlled. Is there a non-hacky way to take control of that and make my own render loop algorithm?

Comments

  • Ok, just in case another newcomer stumbles upon this thing.. You can check the source and see that code in BeginDrawing and EndDrawing functions is pretty straightforward. If you want to take control of the render loop in your own terms just make your own functions for BeginDrawing/EndDrawing. That's what I will end up doing.
  • hey rixarn! sorry, I miss your message! You're right, BeginDrawing/EndDrawing is quite straightforward.

    You can also avoid SetTargetFPS and control timming yourself inside the loop, at the end.
  • Don't worry, thanks your writting back :)
Sign In or Register to comment.