From d628232e8c4b476978bf65f58a89449de31f1d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 7 Oct 2018 14:41:18 +0200 Subject: [PATCH] GL: exposing GL::Context::Flag::ForwardCompatible. --- doc/changelog.dox | 5 +++++ src/Magnum/GL/Context.cpp | 6 ++++++ src/Magnum/GL/Context.h | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 30cf493b7..958ab8235 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -51,6 +51,11 @@ See also: and @ref DebugTools::CompareFileToImage comparators extending @ref DebugTools::CompareImage with convenient image file loading +@subsubsection changelog-latest-new-gl GL library + +- Exposing @ref GL::Context::Flag::ForwardCompatible through + @ref GL::Context::flags(), which was deliberately ignored before. + @subsubsection changelog-latest-new-math Math library - New @ref Math::CubicHermite class for cubic Hermite spline interpolation, diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 57f0c5033..89a7c98d0 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -890,6 +890,9 @@ Debug& operator<<(Debug& debug, const Context::Flag value) { /* LCOV_EXCL_START */ #define _c(value) case Context::Flag::value: return debug << "GL::Context::Flag::" #value; _c(Debug) + #ifndef MAGNUM_TARGET_GLES + _c(ForwardCompatible) + #endif _c(NoError) #ifndef MAGNUM_TARGET_GLES2 _c(RobustAccess) @@ -904,6 +907,9 @@ Debug& operator<<(Debug& debug, const Context::Flag value) { Debug& operator<<(Debug& debug, const Context::Flags value) { return Containers::enumSetDebugOutput(debug, value, "GL::Context::Flags{}", { Context::Flag::Debug, + #ifndef MAGNUM_TARGET_GLES + Context::Flag::ForwardCompatible, + #endif Context::Flag::NoError, #ifndef MAGNUM_TARGET_GLES2 Context::Flag::RobustAccess diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index 627dc2d22..c2a8777c9 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -164,6 +164,16 @@ class MAGNUM_GL_EXPORT Context { Debug = GL_CONTEXT_FLAG_DEBUG_BIT_KHR, #endif + #ifndef MAGNUM_TARGET_GLES + /** + * Forward compatible context + * @see @ref isCoreProfile() + * @requires_gl Core/compatibility profile distinction and forward + * compatibility applies only to desktop GL. + */ + ForwardCompatible = GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, + #endif + /** * Context without error reporting * @requires_gl46 Extension @gl_extension{KHR,no_error} @@ -489,8 +499,10 @@ class MAGNUM_GL_EXPORT Context { * * The result is cached, repeated queries don't result in repeated * OpenGL calls. - * @see @fn_gl{Get} with @def_gl_keyword{CORE_PROFILE_MASK} - * @requires_gl Not available on OpenGL ES or WebGL. + * @see @fn_gl{Get} with @def_gl_keyword{CORE_PROFILE_MASK}, + * @ref Flag::ForwardCompatible + * @requires_gl Core/compatibility profile distinction and forward + * compatibility applies only to desktop GL. */ bool isCoreProfile(); #endif