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:
@@ -27,6 +27,8 @@ import com.samskivert.util.Queue;
|
|||||||
import com.samskivert.util.RunQueue;
|
import com.samskivert.util.RunQueue;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.Display;
|
||||||
|
|
||||||
import com.jme.renderer.Camera;
|
import com.jme.renderer.Camera;
|
||||||
import com.jme.renderer.ColorRGBA;
|
import com.jme.renderer.ColorRGBA;
|
||||||
import com.jme.renderer.Renderer;
|
import com.jme.renderer.Renderer;
|
||||||
@@ -160,6 +162,10 @@ public class JmeApp
|
|||||||
processEvents(frameStart);
|
processEvents(frameStart);
|
||||||
_failures = 0;
|
_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) {
|
} catch (Throwable t) {
|
||||||
Log.logStackTrace(t);
|
Log.logStackTrace(t);
|
||||||
// stick a fork in things if we fail too many times in a row
|
// stick a fork in things if we fail too many times in a row
|
||||||
|
|||||||
Reference in New Issue
Block a user