javax.media.opengl

## Interface FPSCounter

- All Known Subinterfaces:
    GLAnimatorControl

      public interface FPSCounter

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_FRAMES_PER_INTERVAL`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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()`.
    `float` | `getLastFPS()`
    `long` | `getLastFPSPeriod()`
    `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()`.
    `float` | `getTotalFPS()`
    `long` | `getTotalFPSDuration()`
    `int` | `getTotalFPSFrames()`
    `int` | `getUpdateFPSFrames()`
    `void` | `resetFPSCounter()` Reset all performance counter (startTime, currentTime, frame number)
    `void` | `setUpdateFPSFrames(int frames, PrintStream out)`

- - ### Field Detail

    - #### DEFAULT_FRAMES_PER_INTERVAL

          static final int DEFAULT_FRAMES_PER_INTERVAL

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setUpdateFPSFrames

          void setUpdateFPSFrames(int frames,
                                PrintStream out)

      Parameters:
        `frames` - 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` - optional print stream where the fps values gets printed if not null at every frames interval

    - #### resetFPSCounter

          void resetFPSCounter()

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

    - #### getUpdateFPSFrames

          int getUpdateFPSFrames()

      Returns:
        update interval in frames
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`

    - #### getFPSStartTime

          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()`

    - #### getLastFPSUpdateTime

          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()`

    - #### getLastFPSPeriod

          long getLastFPSPeriod()

      Returns:
        Duration of the last update interval in milliseconds.
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`, `resetFPSCounter()`

    - #### getLastFPS

          float getLastFPS()

      Returns:
        Last update interval's frames per seconds, `getUpdateFPSFrames()` / `getLastFPSPeriod()`
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`, `resetFPSCounter()`

    - #### getTotalFPSFrames

          int getTotalFPSFrames()

      Returns:
        Number of frame rendered since `getFPSStartTime()` up to `getLastFPSUpdateTime()`
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`, `resetFPSCounter()`

    - #### getTotalFPSDuration

          long getTotalFPSDuration()

      Returns:
        Total duration in milliseconds, `getLastFPSUpdateTime()` - `getFPSStartTime()`
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`, `resetFPSCounter()`

    - #### getTotalFPS

          float getTotalFPS()

      Returns:
        Total frames per seconds, `getTotalFPSFrames()` / `getTotalFPSDuration()`
      See Also:
        `setUpdateFPSFrames(int, PrintStream)`, `resetFPSCounter()`

Copyright 2010 JogAmp Community.