com.io7m.jcanephora.profiler

## Class JCGLProfiling

- java.lang.Object
- - com.io7m.jcanephora.profiler.JCGLProfiling

- All Implemented Interfaces:
    JCGLProfilingType

      public final class JCGLProfiling
      extends Object
      implements JCGLProfilingType

  The default implementation of the `JCGLProfilingType` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `frameDelay()` As polling profiling timers every frame would cause excessive GPU/CPU syncs, profiling implementations will typically lag behind by a given number of frames to avoid causing the driver to synchronize.
    `boolean` | `isEnabled()`
    `JCGLProfilingFrameMeasurementType` | `mostRecentlyMeasuredFrame()`
    `static JCGLProfilingType` | `newProfiling(JCGLTimersType t)` Construct a new profiling interface.
    `void` | `setEnabled(boolean e)` Enable/disable profiling.
    `JCGLProfilingFrameType` | `startFrame()` Start rendering a frame.
    `void` | `trimContexts()` Trim any cached internal storage.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newProfiling

          public static JCGLProfilingType newProfiling(JCGLTimersType t)

      Construct a new profiling interface.
      Parameters:
        `t` - Access to timers
      Returns:
        A profiling interface

    - #### startFrame

          public JCGLProfilingFrameType startFrame()

      Start rendering a frame.
      Specified by:
        `startFrame` in interface `JCGLProfilingType`
      Returns:
        A new frame

    - #### trimContexts

          public void trimContexts()

      Trim any cached internal storage. This is primarily useful because implementations are expected to reuse a lot of data structures internally (because the graph of renderers and filters being profiled rarely changes).
      Specified by:
        `trimContexts` in interface `JCGLProfilingType`

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `JCGLProfilingType`
      Returns:
        `true` iff profiling is enabled
      See Also:
        `setEnabled(boolean)`

    - #### setEnabled

          public void setEnabled(boolean e)

      Enable/disable profiling.
      Specified by:
        `setEnabled` in interface `JCGLProfilingType`
      Parameters:
        `e` - `true` iff profiling should be enabled

    - #### mostRecentlyMeasuredFrame

          public JCGLProfilingFrameMeasurementType mostRecentlyMeasuredFrame()

      Specified by:
        `mostRecentlyMeasuredFrame` in interface `JCGLProfilingType`
      Returns:
        The elapsed time of the most recently measured frame

    - #### frameDelay

          public int frameDelay()

      Description copied from interface: `JCGLProfilingType`
      As polling profiling timers every frame would cause excessive GPU/CPU syncs, profiling implementations will typically lag behind by a given number of frames to avoid causing the driver to synchronize. This method returns the number of frames behind that profiling data is lagging.
      Specified by:
        `frameDelay` in interface `JCGLProfilingType`
      Returns:
        The number of frames behind that profiling data typically lags

Copyright © 2017 <code@io7m.com> http://io7m.com