*** empty log message ***

This commit is contained in:
Caspian Rychlik-Prince 2004-05-05 14:33:03 +00:00
parent b697fb3ecf
commit 2c39ddfd0b
1 changed files with 3 additions and 4 deletions

View File

@ -232,12 +232,11 @@ public final class Display {
/** /**
* Synchronize the display to a capped frame rate. * Synchronize the display to a capped frame rate.
* @param frameTime The desired frame time in seconds * @param fps The desired frame rate, in frames per second
*/ */
public static void sync(float frameRate) { public static void sync(int fps) {
float frameTime = 1.0f / (float) fps;
timeNow = Sys.getTime(); timeNow = Sys.getTime();
System.out.println(Sys.getTimerResolution());
System.out.println(timeNow+" "+timeThen+" "+((float) (timeNow - timeThen) / (float) Sys.getTimerResolution()));
while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameRate) { while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameRate) {
// This is a system-friendly way of allowing other stuff to use CPU if it wants to // This is a system-friendly way of allowing other stuff to use CPU if it wants to
Thread.yield(); Thread.yield();