| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static boolean | initialised
whether the initialisation code has run |
| private static final long | NANOS_IN_SECOND
number of nano seconds in a second |
| private static long | nextFrame
The time to sleep/yield until the next frame |
| private static Sync. | sleepDurations
for calculating the averages the previous sleep/yield times are stored |
| private static Sync. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static long | |
| private static void | initialise()
This method will initialise the sync method by setting initial values for sleepDurations/yieldDurations and nextFrame. |
| public static void | sync(int
- the desired frame rate, in frames per second fps)An accurate sync method that will attempt to run at a constant frame rate. |
| initialised | back to summary |
|---|---|
| private static boolean initialised whether the initialisation code has run | |
| NANOS_IN_SECOND | back to summary |
|---|---|
| private static final long NANOS_IN_SECOND number of nano seconds in a second | |
| nextFrame | back to summary |
|---|---|
| private static long nextFrame The time to sleep/yield until the next frame | |
| sleepDurations | back to summary |
|---|---|
| private static Sync. for calculating the averages the previous sleep/yield times are stored | |
| yieldDurations | back to summary |
|---|---|
| private static Sync. | |
| Sync | back to summary |
|---|---|
| pack-priv Sync() | |
| getTime | back to summary |
|---|---|
| private static long getTime() Get the system time in nano seconds
| |
| initialise | back to summary |
|---|---|
| private static void initialise() This method will initialise the sync method by setting initial values for sleepDurations/yieldDurations and nextFrame. If running on windows it will start the sleep timer fix. | |
| sync | back to summary |
|---|---|
| public static void sync(int fps) An accurate sync method that will attempt to run at a constant frame rate. It should be called once every frame.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final float | |
| private static final long | |
| private int | |
| private final long[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public long | |
| public void | |
| public void |
| DAMPEN_FACTOR | back to summary |
|---|---|
| private static final float DAMPEN_FACTOR | |
| DAMPEN_THRESHOLD | back to summary |
|---|---|
| private static final long DAMPEN_THRESHOLD | |
| offset | back to summary |
|---|---|
| private int offset | |
| slots | back to summary |
|---|---|
| private final long[] slots | |
| RunningAvg | back to summary |
|---|---|
| public RunningAvg(int slotCount) | |
| add | back to summary |
|---|---|
| public void add(long value) | |
| avg | back to summary |
|---|---|
| public long avg() | |
| dampenForLowResTicker | back to summary |
|---|---|
| public void dampenForLowResTicker() | |
| init | back to summary |
|---|---|
| public void init(long value) | |