VTK  9.7.20261004
vtkOpenGLRenderTimer.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
30
31#ifndef vtkOpenGLRenderTimer_h
32#define vtkOpenGLRenderTimer_h
33
34#include "vtkRenderingOpenGL2Module.h" // For export macro
35#include "vtkType.h" // For vtkTypeUint64, etc
36
37VTK_ABI_NAMESPACE_BEGIN
38class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderTimer
39{
40public:
43
48 static bool IsSupported();
49
53 void Reset();
54
58 void Start();
59
63 void Stop();
64
68 bool Started();
69
73 bool Stopped();
74
78 bool Ready();
79
81
86 vtkTypeUInt64 GetElapsedNanoseconds();
88
90
119
125 vtkTypeUInt64 GetStartTime();
126 vtkTypeUInt64 GetStopTime();
128
134
135protected:
138
139 vtkTypeUInt32 StartQuery;
140 vtkTypeUInt32 EndQuery;
141
142 vtkTypeUInt64 StartTime;
143 vtkTypeUInt64 EndTime;
144
147
148private:
150 void operator=(const vtkOpenGLRenderTimer&) = delete;
151};
152
153VTK_ABI_NAMESPACE_END
154#endif // vtkOpenGLRenderTimer_h
155
156// VTK-HeaderTest-Exclude: vtkOpenGLRenderTimer.h
void ReusableStart()
This class can also be used in a reusable manner where the start and stop events stay in flight until...
void Reset()
Clear out any previous results and prepare for a new query.
bool Stopped()
Returns true if the timer has been stopped.
bool Started()
Returns true if the timer has been started.
vtkTypeUInt64 GetElapsedNanoseconds()
If Ready() returns true, get the elapsed time in the requested units.
float GetReusableElapsedSeconds()
This class can also be used in a reusable manner where the start and stop events stay in flight until...
void Start()
Mark the start of a timed event.
float GetElapsedMilliseconds()
If Ready() returns true, get the elapsed time in the requested units.
void ReusableStop()
This class can also be used in a reusable manner where the start and stop events stay in flight until...
vtkTypeUInt64 GetStopTime()
If Ready() returns true, return the start or stop time in nanoseconds.
vtkTypeUInt64 GetStartTime()
If Ready() returns true, return the start or stop time in nanoseconds.
void Stop()
Mark the end of a timed event.
float GetElapsedSeconds()
If Ready() returns true, get the elapsed time in the requested units.
void ReleaseGraphicsResources()
Simply calls Reset() to ensure that query ids are freed.
static bool IsSupported()
Returns true if timer events are supported by the current OpenGL implementation.
bool Ready()
Returns true when the timing results are available.