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 
30 #ifndef vtkOpenGLRenderTimer_h
31 #define vtkOpenGLRenderTimer_h
32 
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
34 #include "vtkType.h" // For vtkTypeUint64, etc
35 
36 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderTimer
37 {
38 public:
41 
45  void Reset();
46 
50  void Start();
51 
55  void Stop();
56 
60  bool Started();
61 
65  bool Stopped();
66 
70  bool Ready();
71 
73 
76  float GetElapsedSeconds();
77  float GetElapsedMilliseconds();
78  vtkTypeUInt64 GetElapsedNanoseconds();
80 
82 
107  void ReusableStart();
108  void ReusableStop();
109  float GetReusableElapsedSeconds();
111 
116  void ReleaseGraphicsResources();
117 
118 protected:
120  bool EndReady;
121 
122  vtkTypeUInt32 StartQuery;
123  vtkTypeUInt32 EndQuery;
124 
125  vtkTypeUInt64 StartTime;
126  vtkTypeUInt64 EndTime;
127 
130 
131 private:
132  vtkOpenGLRenderTimer(const vtkOpenGLRenderTimer&) VTK_DELETE_FUNCTION;
133  void operator=(const vtkOpenGLRenderTimer&) VTK_DELETE_FUNCTION;
134 };
135 
136 #endif // vtkOpenGLRenderTimer_h
137 
138 // VTK-HeaderTest-Exclude: vtkOpenGLRenderTimer.h
Asynchronously measures GPU execution time.