Package arc.profiling

Class GLProfiler

java.lang.Object
arc.profiling.GLProfiler

public class GLProfiler extends Object
When enabled, collects statistics about GL calls and checks for GL errors. Enabling will wrap Core.gl* instances with delegate classes which provide described functionality and route GL calls to the actual GL instances.
See Also:
  • Constructor Details

    • GLProfiler

      public GLProfiler(Graphics graphics)
      Create a new instance of GLProfiler to monitor a Graphics instance's gl calls
      Parameters:
      graphics - instance to monitor with this instance
  • Method Details

    • enable

      public void enable()
      Enables profiling by replacing the GL20 and GL30 instances with profiling ones.
    • disable

      public void disable()
      Disables profiling by resetting the GL20 and GL30 instances with the original ones.
    • getListener

      public GLErrorListener getListener()
      Returns:
      the current GLErrorListener
    • setListener

      public void setListener(GLErrorListener errorListener)
      Set the current listener for the GLProfiler to errorListener
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if the GLProfiler is currently profiling
    • getCalls

      public int getCalls()
      Returns:
      the total gl calls made since the last reset
    • getTextureBindings

      public int getTextureBindings()
      Returns:
      the total amount of texture bindings made since the last reset
    • getStateChanges

      public int getStateChanges()
    • getDrawCalls

      public int getDrawCalls()
      Returns:
      the total amount of draw calls made since the last reset
    • getShaderSwitches

      public int getShaderSwitches()
      Returns:
      the total amount of shader switches made since the last reset
    • getVertexCount

      public FloatCounter getVertexCount()
      Returns:
      FloatCounter containing information about rendered vertices since the last reset
    • reset

      public void reset()
      Will reset the statistical information which has been collected so far. This should be called after every frame. Error listener is kept as it is.