gpt4 book ai didi

javafx-8 - 如何忽略 javafx 中的 60fps 限制?

转载 作者:行者123 更新时间:2023-12-02 22:09:52 25 4
gpt4 key购买 nike

我需要创建一个 100fps 动画,该动画显示来自包含 100 帧每秒的文件的 3d 数据。但是 javaFx 中的 AnimationTimer 只允许我获得 60fps。如何克服它?

最佳答案

删除 JavaFX 帧速率上限

您可以通过设置系统属性来删除 60fps JavaFX 帧速率上限,例如,

java -Djavafx.animation.fullspeed=true MyApp

这是一个 undocumented and unsupported setting .

删除 JavaFX 帧速率上限可能会使您的应用程序在资源使用方面的效率大大降低(例如,没有帧速率上限的 JavaFX 应用程序将比具有帧速率上限的应用程序消耗更多 CPU)。

配置 JavaFX 帧速率上限

此外,您可以尝试另一个未记录的系统属性:
javafx.animation.framerate

我没试过。

调试 JavaFX 帧(脉冲)

other settings like -Djavafx.pulseLogger=true 您可以启用它以帮助您调试 JavaFX 体系结构并验证您的应用程序实际上以您期望的帧速率运行。

JavaFX 8 has a Pulse Logger (-Djavafx.pulseLogger=true system property) that "prints out a lot of crap" (in a good way) about the JavaFX engine's execution. There is a lot of provided information on a per-pulse basis including pulse number (auto-incremented integer), pulse duration, and time since last pulse. The information also includes thread details and events details. This data allows a developer to see what is taking most of the time.



警告

使用未记录功能的正常警告适用,如 Richard Bair from the JavaFX team笔记:

Just a word of caution, if we haven't documented the command line switches, they're fair game for removal / modification in subsequent releases :-)

关于javafx-8 - 如何忽略 javafx 中的 60fps 限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28819409/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com