java.lang.Object
de.grogra.glsl.Measures
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 Summary
Modifier and TypeMethodDescriptionstatic MeasuresvoidPrint a summary of collected renderpass time.voidPrint a summary of collected render times.voidThis will reset the measurement.voidStore the rendertimes obtained from the used Display class to a csv-File in the current working directory.voidsetCounter(int counter) voidSets the name for a file into which measures may be saved.voidsetData(int all, int rend) voidsetRedraw(boolean redraw) Changes behavior of measuring method.voidsetRPTimeDiff(int rpID, long value) Stores the time used to process a renderpass.booleanCheck if scene should be redrawn.voidvoidstopTimer(RenderState rs)
-
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
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 methodsetCurrentFileName(String). -
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
-
startTimer
public void startTimer()
-