1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Query.h: Defines the gl::Query class 16 17 #ifndef LIBGL_QUERY_H_ 18 #define LIBGL_QUERY_H_ 19 20 #include "common/Object.hpp" 21 #include "Renderer/Renderer.hpp" 22 23 #define _GDI32_ 24 #include <windows.h> 25 #include <GL/GL.h> 26 #include <GL/glext.h> 27 28 namespace gl 29 { 30 31 class Query : public NamedObject 32 { 33 public: 34 Query(GLuint name, GLenum type); 35 virtual ~Query(); 36 37 void begin(); 38 void end(); 39 GLuint getResult(); 40 GLboolean isResultAvailable(); 41 42 GLenum getType() const; 43 44 private: 45 GLboolean testQuery(); 46 47 sw::Query* mQuery; 48 GLenum mType; 49 GLboolean mStatus; 50 GLint mResult; 51 }; 52 53 } 54 55 #endif // LIBGL_QUERY_H_ 56