PICCANTE  0.4
The hottest HDR imaging library!
timings.hpp
Go to the documentation of this file.
1 /*
2 
3 PICCANTE
4 The hottest HDR imaging library!
5 http://vcg.isti.cnr.it/piccante
6 
7 Copyright (C) 2014
8 Visual Computing Laboratory - ISTI CNR
9 http://vcg.isti.cnr.it
10 First author: Francesco Banterle
11 
12 This Source Code Form is subject to the terms of the Mozilla Public
13 License, v. 2.0. If a copy of the MPL was not distributed with this
14 file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 
16 */
17 
18 #ifndef PIC_UTIL_GL_TIMINGS_HPP
19 #define PIC_UTIL_GL_TIMINGS_HPP
20 
21 #include "../../gl.hpp"
22 
23 namespace pic {
24 
29 inline GLuint glBeginTimeQuery()
30 {
31  GLuint ret = 0;
32 #ifdef PIC_GL_TIMING
33  glGenQueries(1, &ret);
34  glFinish();
35  glBeginQuery(GL_TIME_ELAPSED, ret);
36 #endif
37 
38  return ret;
39 }
40 
46 inline GLuint64 glEndTimeQuery(GLuint64 ret)
47 {
48  GLuint64 timeVal = 0;
49 
50 #ifdef PIC_GL_TIMING
51  glEndQuery(GL_TIME_ELAPSED);
52  glGetQueryObjectui64v(ret, GL_QUERY_RESULT, &timeVal);
53 #endif
54 
55  return timeVal;
56 }
57 
58 } // end namespace pic
59 
60 #endif /* PIC_UTIL_GL_TIMINGS_HPP */
61 
GLuint glBeginTimeQuery()
glBeginTimeQuery
Definition: timings.hpp:29
GLuint64 glEndTimeQuery(GLuint64 ret)
glEndTimeQuery
Definition: timings.hpp:46
Definition: bilateral_separation.hpp:25