Use an LWJGL support function to cap our frame rate at 60 when we're not

visible and can't rely on the vsync doing it for us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4039 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2006-04-20 18:36:14 +00:00
parent d544f127a4
commit 6a56d42079
+6
View File
@@ -27,6 +27,8 @@ import com.samskivert.util.Queue;
import com.samskivert.util.RunQueue;
import com.samskivert.util.StringUtil;
import org.lwjgl.opengl.Display;
import com.jme.renderer.Camera;
import com.jme.renderer.ColorRGBA;
import com.jme.renderer.Renderer;
@@ -160,6 +162,10 @@ public class JmeApp
processEvents(frameStart);
_failures = 0;
// cap our frame rate at 60 if we're not visible and thus don't
// automatically cap due to being vsynced
Display.sync(60);
} catch (Throwable t) {
Log.logStackTrace(t);
// stick a fork in things if we fail too many times in a row