Module gl1

Class Measures

java.lang.Object
de.grogra.glsl.Measures

public class Measures extends Object
Measures is a utility that may store and retrieve time measures for ViewComponentAdapter.repaint(int) and GLSLDisplay.render(int). This class is a singleton and will only produce correct results if not more than one Display-Window is open. The methods may be called within the XL-Console.
Author:
Konni Hartmann
  • Method Details

    • setRPTimeDiff

      public void setRPTimeDiff(int rpID, long value)
      Stores the time used to process a renderpass.
      Parameters:
      rpID - The ID of the renderpass. Renderpasses are arbitrarily categorized into groups ranging from 0 to 6.
      value - The time to be stored.
    • printRPSummary

      public void printRPSummary()
      Print a summary of collected renderpass time.
    • setCurrentFileName

      public void setCurrentFileName(String s)
      Sets the name for a file into which measures may be saved. This will be used as a filename only. No directory or ending should be added.
      Parameters:
      s - The filename.
    • printSummary

      public void printSummary()
      Print a summary of collected render times.
    • setRedraw

      public void setRedraw(boolean redraw)
      Changes behavior of measuring method.
      Parameters:
      redraw - If set to true, the scene will be redrawn after each call of the render method resulting in continuous drawing.
    • shouldRedraw

      public boolean shouldRedraw()
      Check if scene should be redrawn. This is used by the Displays render-method to test if it should issue the (protected) ViewComponent.repaint(int) method.
      Returns:
      true if scene should be redrawn.
    • saveTimeDiffSummary

      public void saveTimeDiffSummary()
      Store the rendertimes obtained from the used Display class to a csv-File in the current working directory. The name is specified by the method setCurrentFileName(String).
    • getInstance

      public static Measures getInstance()
      Returns:
      An instance of this class. Since this class is a singleton the same reference will be returned for all calls of this method.
    • restartNow

      public void restartNow()
      This will reset the measurement.
    • setCounter

      public void setCounter(int counter)
    • setData

      public void setData(int all, int rend)
    • stopTimer

      public void stopTimer(RenderState rs)
    • startTimer

      public void startTimer()