com.io7m.jcanephora.profiler

## Interface JCGLProfilingType

- All Known Implementing Classes:
    JCGLProfiling

      public interface JCGLProfilingType

  An interface providing profiling services to components of the rendering pipeline.

  Profiling proceeds by having the user first start a new frame with `startFrame()`. Then, the user typically creates a root context for the frame with `JCGLProfilingFrameType.getChildContext(String)`. Then, the created context is passed to the various renderers and filters that the user is using to render. The renderers and filters create new named child contexts which are then used to record timing information.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getFrameDelay()` 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.
    `JCGLProfilingFrameMeasurementType` | `getMostRecentlyMeasuredFrame()`
    `boolean` | `isEnabled()`
    `void` | `setEnabled(boolean e)` Enable/disable profiling.
    `JCGLProfilingFrameType` | `startFrame()` Start rendering a frame.
    `void` | `trimContexts()` Trim any cached internal storage.

- - ### Method Detail

    - #### startFrame

          JCGLProfilingFrameType startFrame()

      Start rendering a frame.
      Returns:
        A new frame

    - #### trimContexts

          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).

    - #### isEnabled

          boolean isEnabled()

      Returns:
        `true` iff profiling is enabled
      See Also:
        `setEnabled(boolean)`

    - #### setEnabled

          void setEnabled(boolean e)

      Enable/disable profiling.
      Parameters:
        `e` - `true` iff profiling should be enabled

    - #### getMostRecentlyMeasuredFrame

          JCGLProfilingFrameMeasurementType getMostRecentlyMeasuredFrame()

      Returns:
        The elapsed time of the most recently measured frame

    - #### getFrameDelay

          int getFrameDelay()

      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.
      Returns:
        The number of frames behind that profiling data typically lags

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