Top Description Fields Methods
com.jogamp.opengl

public Interface FPSCounter

Known Direct Subinterfaces
com.jogamp.opengl.GLAnimatorControl
Known Direct Implementers
jogamp.opengl.FPSCounterImpl, jogamp.opengl.GLAutoDrawableBase, com.jogamp.newt.opengl.GLWindow
Imports
java.io.PrintStream

FPSCounter feature.
An implementation initially has the FPSCounter feature disabled.
Use setUpdateFPSFrames(int, PrintStream) to enable and disable the FPSCounter feature.

Field Summary

Modifier and TypeField and Description
public static final int

Method Summary

Modifier and TypeMethod and Description
public long
getFPSStartTime()

Returns the time of the first display call in milliseconds after enabling this feature via setUpdateFPSFrames(int, PrintStream).

public float

Returns:

Last update interval's frames per seconds, getUpdateFPSFrames() / getLastFPSPeriod()
getLastFPS
()

public long

Returns:

Duration of the last update interval in milliseconds.
getLastFPSPeriod
()

public long
getLastFPSUpdateTime()

Returns the time of the last update interval in milliseconds, if this feature is enabled via setUpdateFPSFrames(int, PrintStream).

public float

Returns:

Total frames per seconds, getTotalFPSFrames() / getTotalFPSDuration()
getTotalFPS
()

public long

Returns:

Total duration in milliseconds, getLastFPSUpdateTime() - getFPSStartTime()
getTotalFPSDuration
()

public int

Returns:

Number of frame rendered since getFPSStartTime() up to getLastFPSUpdateTime()
getTotalFPSFrames
()

public int

Returns:

update interval in frames
getUpdateFPSFrames
()

public void
resetFPSCounter()

Reset all performance counter (startTime, currentTime, frame number)

public void
setUpdateFPSFrames(int
Update interval in frames.
At every rendered frames interval the currentTime and fps values are updated. If the frames interval is <= 0, no update will be issued, ie the FPSCounter feature is turned off. You may choose DEFAULT_FRAMES_PER_INTERVAL.
frames
,
PrintStream
optional print stream where the fps values gets printed if not null at every frames interval
out
)

Field Detail

DEFAULT_FRAMES_PER_INTERVALback to summary
public static final int DEFAULT_FRAMES_PER_INTERVAL

Method Detail

getFPSStartTimeback to summary
public long getFPSStartTime()

Returns the time of the first display call in milliseconds after enabling this feature via setUpdateFPSFrames(int, PrintStream).
This value is reset via resetFPSCounter().

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getLastFPSback to summary
public float getLastFPS()
Returns:float

Last update interval's frames per seconds, getUpdateFPSFrames() / getLastFPSPeriod()

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getLastFPSPeriodback to summary
public long getLastFPSPeriod()
Returns:long

Duration of the last update interval in milliseconds.

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getLastFPSUpdateTimeback to summary
public long getLastFPSUpdateTime()

Returns the time of the last update interval in milliseconds, if this feature is enabled via setUpdateFPSFrames(int, PrintStream).
This value is reset via resetFPSCounter().

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getTotalFPSback to summary
public float getTotalFPS()
Returns:float

Total frames per seconds, getTotalFPSFrames() / getTotalFPSDuration()

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getTotalFPSDurationback to summary
public long getTotalFPSDuration()
Returns:long

Total duration in milliseconds, getLastFPSUpdateTime() - getFPSStartTime()

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getTotalFPSFramesback to summary
public int getTotalFPSFrames()
Returns:int

Number of frame rendered since getFPSStartTime() up to getLastFPSUpdateTime()

See Also
setUpdateFPSFrames(int, PrintStream), resetFPSCounter()
getUpdateFPSFramesback to summary
public int getUpdateFPSFrames()
Returns:int

update interval in frames

See Also
setUpdateFPSFrames(int, PrintStream)
resetFPSCounterback to summary
public void resetFPSCounter()

Reset all performance counter (startTime, currentTime, frame number)

setUpdateFPSFramesback to summary
public void setUpdateFPSFrames(int frames, PrintStream out)
Parameters
frames:int

Update interval in frames.
At every rendered frames interval the currentTime and fps values are updated. If the frames interval is <= 0, no update will be issued, ie the FPSCounter feature is turned off. You may choose DEFAULT_FRAMES_PER_INTERVAL.

out:PrintStream

optional print stream where the fps values gets printed if not null at every frames interval