ScummVM API documentation
context.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_OPENGL_CONTEXT_H
23 #define GRAPHICS_OPENGL_CONTEXT_H
24 
25 #include "common/singleton.h"
26 
27 namespace OpenGL {
28 
29 enum ContextType {
30  kContextNone,
31  kContextGL,
32  kContextGLES,
33  kContextGLES2
34 };
35 
39 class Context : public Common::Singleton<Context> {
40 public:
41  Context();
42 
49  void initialize(ContextType contextType);
50 
56  void reset();
57 
59  ContextType type;
60 
62  inline bool isGLVersionOrHigher(int major, int minor) const {
63  return ((majorVersion > major) || ((majorVersion == major) && (minorVersion >= minor)));
64  }
65 
67  int majorVersion, minorVersion;
68 
71 
74 
77 
80 
83 
86 
89 
92 
98 
101 
104 
107 
110 
113 
116 
119 
122 
123 private:
128  int getGLSLVersion() const;
129 };
130 
131 } // End of namespace OpenGL
132 
134 #define OpenGLContext OpenGL::Context::instance()
135 
136 #endif
bool framebufferObjectSupported
Definition: context.h:88
int glslVersion
Definition: context.h:70
void initialize(ContextType contextType)
bool textureMirrorRepeatSupported
Definition: context.h:118
ContextType type
Definition: context.h:59
int maxTextureSize
Definition: context.h:73
bool multitextureSupported
Definition: context.h:85
bool textureEdgeClampSupported
Definition: context.h:112
bool framebufferObjectMultisampleSupported
Definition: context.h:91
int majorVersion
Definition: context.h:67
bool packedDepthStencilSupported
Definition: context.h:103
Definition: renderbuffer.h:27
bool textureMaxLevelSupported
Definition: context.h:121
bool packedPixelsSupported
Definition: context.h:100
int multisampleMaxSamples
Definition: context.h:97
bool OESDepth24
Definition: context.h:109
bool textureBorderClampSupported
Definition: context.h:115
bool NPOTSupported
Definition: context.h:76
bool isGLVersionOrHigher(int major, int minor) const
Definition: context.h:62
bool shadersSupported
Definition: context.h:79
bool enginesShadersSupported
Definition: context.h:82
Definition: context.h:39
bool unpackSubImageSupported
Definition: context.h:106
Definition: singleton.h:42