• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 es2::Query class
16 
17 #ifndef LIBGLESV2_QUERY_H_
18 #define LIBGLESV2_QUERY_H_
19 
20 #include "common/Object.hpp"
21 #include "Renderer/Renderer.hpp"
22 
23 #include <GLES2/gl2.h>
24 
25 namespace es2
26 {
27 
28 class Query : public gl::NamedObject
29 {
30 public:
31 	Query(GLuint name, GLenum type);
32 	virtual ~Query();
33 
34 	void begin();
35 	void end();
36 	GLuint getResult();
37 	GLboolean isResultAvailable();
38 
39 	GLenum getType() const;
40 
41 private:
42 	GLboolean testQuery();
43 
44 	sw::Query* mQuery;
45 	GLenum mType;
46 	GLboolean mStatus;
47 	GLint mResult;
48 };
49 
50 }
51 
52 #endif   // LIBGLESV2_QUERY_H_
53