blob: 17dbaf528dcd21e577d97c502b2ca11cc9998fb2 [file] [log] [blame]
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +00001//
2// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// QueryImpl.h: Defines the abstract rx::QueryImpl class.
8
9#ifndef LIBGLESV2_RENDERER_QUERYIMPL_H_
10#define LIBGLESV2_RENDERER_QUERYIMPL_H_
11
12#define GL_APICALL
13#include <GLES2/gl2.h>
14
15#include "common/angleutils.h"
16
17namespace rx
18{
19
20class QueryImpl
21{
22 public:
23 explicit QueryImpl(GLenum type) : mType(type), mStatus(GL_FALSE), mResult(0) { }
24 virtual ~QueryImpl() { }
25
26 virtual void begin() = 0;
27 virtual void end() = 0;
28 virtual GLuint getResult() = 0;
29 virtual GLboolean isResultAvailable() = 0;
30
31 GLenum getType() const { return mType; }
32
33 protected:
34 void setStatus(GLboolean status) { mStatus = status; }
35 GLboolean getStatus() const { return mStatus; }
36
37 void setResult(GLuint result) { mResult = result; }
38 GLuint getResult() const { return mResult; }
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(QueryImpl);
42
43 GLenum mType;
44 GLboolean mStatus;
45 GLuint mResult;
46};
47
48}
49
50#endif // LIBGLESV2_RENDERER_QUERYIMPL_H_