27 #ifndef _CEGUIOpenGL_h_
28 #define _CEGUIOpenGL_h_
30 #include "CEGUI/Config.h"
32 #if defined CEGUI_USE_EPOXY
36 #elif defined CEGUI_USE_GLEW
42 # if (defined( __WIN32__ ) || defined( _WIN32 ))
47 # include <OpenGL/glu.h>
51 #error Either "CEGUI_USE_EPOXY" or "CEGUI_USE_GLEW" must be defined. Defining both or none is invalid.
55 #define GL_RGB565 0x8D62
58 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
59 # if defined(CEGUIOPENGLRENDERER_EXPORTS) || defined(CEGUIOPENGLES2RENDERER_EXPORTS)
60 # define OPENGL_GUIRENDERER_API __declspec(dllexport)
62 # define OPENGL_GUIRENDERER_API __declspec(dllimport)
65 # define OPENGL_GUIRENDERER_API
76 class OPENGL_GUIRENDERER_API OpenGLInfo
91 static OpenGLInfo& getSingleton() {
return s_instance; }
106 Type type()
const {
return d_type; }
112 bool isUsingDesktopOpengl()
const {
return type() == TYPE_DESKTOP; }
118 bool isUsingOpenglEs()
const {
return type() == TYPE_ES; }
125 GLint verMajor()
const {
return d_verMajor; }
132 GLint verMinor()
const {
return d_verMinor; }
139 bool verAtLeast(GLint major, GLint minor) {
140 return verMajor() > major || (verMajor() == major && verMinor() >= minor); }
149 bool isS3tcSupported()
const {
return d_isS3tcSupported; }
155 bool isNpotTextureSupported()
const {
return d_isNpotTextureSupported; }
161 bool isReadBufferSupported()
const
162 {
return d_isReadBufferSupported; }
168 bool isPolygonModeSupported()
const
169 {
return d_isPolygonModeSupported; }
175 bool isVaoSupported()
const {
return d_isVaoSupported; }
182 bool isSeperateReadAndDrawFramebufferSupported()
const
183 {
return d_isSeperateReadAndDrawFramebufferSupported; }
185 bool isSizedInternalFormatSupported()
const
186 {
return d_isSizedInternalFormatSupported; }
195 void verForce(GLint verMajor_, GLint verMinor_);
199 static OpenGLInfo s_instance;
201 void initTypeAndVer();
202 void initSupportedFeatures();
207 GLint d_verMajorForce;
208 GLint d_verMinorForce;
209 bool d_isS3tcSupported;
210 bool d_isNpotTextureSupported;
211 bool d_isReadBufferSupported;
212 bool d_isPolygonModeSupported;
213 bool d_isSeperateReadAndDrawFramebufferSupported;
214 bool d_isVaoSupported;
215 bool d_isSizedInternalFormatSupported;
220 #endif // end of guard _CEGUIOpenGL_h_