| 15 | using namespace sibr; |
| 16 | |
| 17 | GPUQuery::GPUQuery(GLenum type, size_t count) : _count(count), _type(type){ |
| 18 | if(count < 2) { |
| 19 | SIBR_WRG << "Using a buffer of size >= 2 is recommended to avoid synchronization problems." << std::endl; |
| 20 | } |
| 21 | _ids.resize(count); |
| 22 | glGenQueries(GLsizei(_ids.size()), &_ids[0]); |
| 23 | _current = _count - 1; |
| 24 | // Dummy initial query. |
| 25 | for (int i = 0; i < _count; ++i) |
| 26 | { |
| 27 | begin(); |
| 28 | end(); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | void GPUQuery::begin() { |
| 33 | if(_observing) { |