VTK
vtkOpenGLRenderTimer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLRenderTimer.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
31 #ifndef vtkOpenGLRenderTimer_h
32 #define vtkOpenGLRenderTimer_h
33 
34 #include "vtkRenderingOpenGL2Module.h" // For export macro
35 #include "vtkType.h" // For vtkTypeUint64, etc
36 
37 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderTimer
38 {
39 public:
42 
47  static bool IsSupported();
48 
52  void Reset();
53 
57  void Start();
58 
62  void Stop();
63 
67  bool Started();
68 
72  bool Stopped();
73 
77  bool Ready();
78 
80 
83  float GetElapsedSeconds();
84  float GetElapsedMilliseconds();
85  vtkTypeUInt64 GetElapsedNanoseconds();
87 
89 
114  void ReusableStart();
115  void ReusableStop();
116  float GetReusableElapsedSeconds();
118 
123  vtkTypeUInt64 GetStartTime();
124  vtkTypeUInt64 GetStopTime();
131  void ReleaseGraphicsResources();
132 
133 protected:
135  bool EndReady;
136 
137  vtkTypeUInt32 StartQuery;
138  vtkTypeUInt32 EndQuery;
139 
140  vtkTypeUInt64 StartTime;
141  vtkTypeUInt64 EndTime;
142 
145 
146 private:
148  void operator=(const vtkOpenGLRenderTimer&) = delete;
149 };
150 
151 #endif // vtkOpenGLRenderTimer_h
152 
153 // VTK-HeaderTest-Exclude: vtkOpenGLRenderTimer.h
Asynchronously measures GPU execution time for a single event.