From 05fe7f86791cf6142a4878eb529a64845e75fe07 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 8 May 2006 20:58:48 +0000 Subject: [PATCH] Don't choke if getFrequency() returns 0. We may want to check for that specifically as this doesn't do the right thing for something like 50fps, but does anyone actually use less than 60? git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4097 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/jme/JmeApp.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java index 662cd461c..301131081 100644 --- a/src/java/com/threerings/jme/JmeApp.java +++ b/src/java/com/threerings/jme/JmeApp.java @@ -93,8 +93,10 @@ public class JmeApp // create an appropriate timer _timer = Timer.getTimer(_api); - // start with the target FPS equal to the refresh rate - setTargetFPS(_display.getFrequency()); + // start with the target FPS equal to the refresh rate (but + // sometimes the refresh rate is reported as zero so don't let that + // freak us out) + setTargetFPS(Math.max(_display.getFrequency(), 60)); // initialize our main camera controls and user input handling initInput();