I'm trying to implement a frame rate feature, and I have noticed that using 60 frames per second causes the screen to leave a drawn trail of textures, when there is movement.

Here's the code I'm using to make the frame rate feature:

public void render(float deltaT){

    if((fps+=deltaT) >= 1.0/60.0){
        fps = 0;

    Gdx.gl.glClearColor(103 / 255f, 69 / 255f, 117 / 255f, 1);

    currentLevel.updateScreen(deltaT, gameCamera);

The currentLevel.updateWorld updates the game's logic. The currentLevel.updateScreen method updates the camera's position, drawn to the screen.

  • \$\begingroup\$ @Charanor Hi, I'm trying to limit frame rate while using the normal render speed for the game's logic, is there any other way to do this besides what I'm doing? I've tried turning vSync ON but it still gives me a sprite trail when the my character moves. \$\endgroup\$
    – Joao
    May 12, 2017 at 15:21
  • \$\begingroup\$ @Joao there's no real reason to limit one but not the other. Not limiting the framerate will just increase your CPU load and use unnecessary resources and battery (if you're on mobile) for no real gain. As for the sprite trail that's probably a render problem so you will have to supply your rendering code if we're to help you fix it. \$\endgroup\$
    – Charanor
    May 12, 2017 at 18:29

1 Answer 1


You don't need to limit the framerate yourself within LibGDX. The framework handles that for you. You can enable vsync in your game by adding this line to your desktop configuration:

config.vSyncEnabled = true;

Or in-game using


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .