forked from StarOpenSource/Engine
Fix FPS calculation
This commit is contained in:
parent
d6d890b259
commit
485b813853
1 changed files with 2 additions and 2 deletions
|
@ -203,7 +203,7 @@ public final class Renderer {
|
||||||
bgfx_dbg_text_printf(0, 0, 0x0f, "Time: " + NumberUtil.padNumbers(LocalTime.now().getHour(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getMinute(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getSecond(), 2));
|
bgfx_dbg_text_printf(0, 0, 0x0f, "Time: " + NumberUtil.padNumbers(LocalTime.now().getHour(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getMinute(), 2) + ":" + NumberUtil.padNumbers(LocalTime.now().getSecond(), 2));
|
||||||
bgfx_dbg_text_printf(0, 1, 0x0f, "Frames: " + Renderer.getFrameCount());
|
bgfx_dbg_text_printf(0, 1, 0x0f, "Frames: " + Renderer.getFrameCount());
|
||||||
bgfx_dbg_text_printf(0, 2, 0x0f, "Frames/s: " + Renderer.getFramesPerSecond());
|
bgfx_dbg_text_printf(0, 2, 0x0f, "Frames/s: " + Renderer.getFramesPerSecond());
|
||||||
bgfx_dbg_text_printf(0, 3, 0x0f, "Delta: " + Renderer.getDeltaTime());
|
bgfx_dbg_text_printf(0, 3, 0x0f, "Delta: " + Renderer.getDeltaTime() + "s");
|
||||||
bgfx_dbg_text_printf(0, 4, 0x0f, "V-Sync mode: " + RenderingSubsystemConfiguration.getInstance().getVsyncMode().name());
|
bgfx_dbg_text_printf(0, 4, 0x0f, "V-Sync mode: " + RenderingSubsystemConfiguration.getInstance().getVsyncMode().name());
|
||||||
bgfx_dbg_text_printf(0, 6, 0x0f, "Rendering time:");
|
bgfx_dbg_text_printf(0, 6, 0x0f, "Rendering time:");
|
||||||
for (String item : lastFrameTime.keySet()) {
|
for (String item : lastFrameTime.keySet()) {
|
||||||
|
@ -366,7 +366,7 @@ public final class Renderer {
|
||||||
// Perform per-second operations
|
// Perform per-second operations
|
||||||
if (System.currentTimeMillis() >= timesPSO) {
|
if (System.currentTimeMillis() >= timesPSO) {
|
||||||
// Calculate FPS count
|
// Calculate FPS count
|
||||||
framesPerSecond = 1 / deltaTime;
|
framesPerSecond = 1 / NumberUtil.calculateMeanDouble(deltaTimes);
|
||||||
|
|
||||||
// Log frame count
|
// Log frame count
|
||||||
if (RenderingSubsystemConfiguration.getInstance().isDebugFrames())
|
if (RenderingSubsystemConfiguration.getInstance().isDebugFrames())
|
||||||
|
|
Loading…
Reference in a new issue