public abstract class PlatformUtils
extends java.lang.Object
| Constructor and Description |
|---|
PlatformUtils() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cancelPerformanceMode()
Cancels performance mode on the device.
|
abstract long |
currentTimeMillis()
Platform independent version of
System.currentTimeMillis() |
abstract ZlibStream |
decompress(byte[] compressedData)
Returns a
ZlibStream to decompress data |
abstract void |
enablePerformanceMode()
Enables performance mode on the device.
|
abstract void |
exit(boolean ignorePlatformRestrictions)
Exits the game
|
abstract long |
getAvailableMemory()
Gets the total memory available for the game
|
double |
getAverageFrameDuration()
Returns the average duration of frames (update/interpolate/render/flush)
|
double |
getAverageFrameInterval()
Returns the average interval of frames (the delta)
|
double |
getAverageInterpolateDuration()
Returns the average duration of interpolate()
|
double |
getAverageRenderDuration()
Returns the average duration of render(
Graphics) |
double |
getAverageUpdateDuration()
Returns the average duration of update()
|
int |
getFramesPerSecond()
Returns the number of frames per second
|
double |
getMaxFrameDuration()
Returns the max duration of frames (update/interpolate/render/flush) in the last second
|
double |
getMaxInterpolateDuration()
Returns the maximum interpolate() duration in the last second
|
double |
getMaxRenderDuration()
Returns the maximum render() duration in the last second
|
double |
getMaxUpdateDuration()
Returns the maximum update() duration in the last second
|
abstract long |
getTotalMemory()
Gets the total memory that can be used by the game
|
int |
getUpdatesPerSecond()
Returns the number of updates per second
|
int |
getUpdatesThisSecond()
Returns the number of frames that have occurred so far this second
|
abstract long |
getUsedMemory()
Gets the total memory used by the game
|
abstract boolean |
isGameThread()
Indicates if the current thread is the game thread
|
void |
markFrameBegin()
Internal usage only: marks a new frame
|
void |
markFrameEnd() |
void |
markInterpolateBegin()
Internal usage only: marks the beginning of interpolate operations
|
void |
markInterpolateEnd()
Internal usage only: marks the end of interpolate operations
|
void |
markRenderBegin()
Internal usage only: marks the beginning of rendering operations
|
void |
markRenderEnd()
Internal usage only: marks the end of rendering operations
|
void |
markUpdateBegin()
Internal usage only: marks the beginning of update operations
|
void |
markUpdateEnd()
Internal usage only: marks the end of update operations
|
abstract long |
nanoTime()
Platform independent version of
System.nanoTime() |
abstract java.lang.String |
timestampToDateFormat(long millis,
java.lang.String format)
Converts a timestamp to the specified date format
|
public abstract void exit(boolean ignorePlatformRestrictions)
ignorePlatformRestrictions - exit even if platform rules don't permit exiting programmatically. Should be
used only for debug purposes and always set to false for release builds.public abstract long nanoTime()
System.nanoTime()System.nanoTime()public abstract long currentTimeMillis()
System.currentTimeMillis()System.currentTimeMillis()public abstract long getTotalMemory()
public abstract long getAvailableMemory()
public abstract long getUsedMemory()
public abstract boolean isGameThread()
public abstract void enablePerformanceMode()
public abstract void cancelPerformanceMode()
public void markUpdateBegin()
public void markInterpolateBegin()
public void markInterpolateEnd()
public void markRenderBegin()
public void markRenderEnd()
public void markUpdateEnd()
public void markFrameBegin()
public void markFrameEnd()
public int getUpdatesPerSecond()
public int getFramesPerSecond()
public int getUpdatesThisSecond()
public double getAverageUpdateDuration()
public double getMaxUpdateDuration()
public double getAverageInterpolateDuration()
public double getMaxInterpolateDuration()
public double getAverageRenderDuration()
Graphics)public double getMaxRenderDuration()
public double getAverageFrameInterval()
public double getAverageFrameDuration()
public double getMaxFrameDuration()
public abstract ZlibStream decompress(byte[] compressedData)
ZlibStream to decompress datacompressedData - The compressed data as a byte arrayZlibStream instancepublic abstract java.lang.String timestampToDateFormat(long millis,
java.lang.String format)
millis - The timestamp (in millis) to convertformat - The date format (e.g. yyyy-MM-dd HH:mm:ss)