Limit FPS in Libgdx game with Thread.sleep() doesn't work

前端 未结 4 2018
清酒与你
清酒与你 2021-01-03 11:36

I am developing a little game for android with libgdx and want to limit the fps to 30 to save battery. The problem is that it doesn\'t work. The fps just drops from 60 to 56

4条回答
  •  孤街浪徒
    2021-01-03 11:55

    You might look into Libgdx's "non-continuous rendering" as an alternative way of reducing the frame rate on Android. As it stands your app's UI thread will be stuck sleeping and so your app may be a bit less responsive (though sleeping for a 30th of a second isn't really that long).

    Depending on your game the non-continuous rendering support might let you reduce the frame rate even further (any time there is no change to the graphics and no input expected, you do not need to draw new frames).

提交回复
热议问题