簡體   English   中英

LibGDX上的低fps

[英]Low fps on LibGDX

沒有此代碼,fps為60-65。 但是當我使用此代碼時,fps降至50。

另一個問題是某些設備上的FPS太低。 但是,游戲非常簡單。 我正在為所有形狀使用ShapeRenderer。 游戲在這里: 鏈接

    try {
            Thread.sleep((long)(1000/60-Gdx.graphics.getDeltaTime()));
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

編輯:我使用此代碼-> link解決了此問題。

您可以通過在應用程序加載程序的配置中定義前台 FPS,將FPS限制為libgdx應用程序中所需的任何值。

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = 640;
    config.height = 480;
    config.foregroundFPS = 60; // <- limit when focused
    config.backgroundFPS = 60; // <- limit when minimized
    config.samples =2; // AA for shape renderer.. not textures!
    new LwjglApplication(new libgdxapp(), config);

Android配置

連續渲染

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM