#endif
}
+inline GLProfile _get_gl_profile()
+{
+ if(get_gl_api()==OPENGL && get_gl_version()>=Version(3, 0))
+ {
+ int mask;
+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);
+ if(mask==GL_CONTEXT_CORE_PROFILE_BIT)
+ return CORE_PROFILE;
+ }
+
+ return COMPATIBILITY_PROFILE;
+}
+
+GLProfile get_gl_profile()
+{
+ static GLProfile profile = _get_gl_profile();
+ return profile;
+}
+
inline Version _get_gl_version()
{
const char *gl_ver_ptr = reinterpret_cast<const char *>(glGetString(GL_VERSION));
OPENGL_ES2
};
+enum GLProfile
+{
+ CORE_PROFILE,
+ COMPATIBILITY_PROFILE
+};
+
struct Version
{
/** Returns the API for which the library was compiled. */
GLApi get_gl_api();
+/** Returns the OpenGL profile for the active context. */
+GLProfile get_gl_profile();
+
/** Returns the OpenGL version number, as reported by the implementation. */
const Version &get_gl_version();