diff --git a/src/Context.cpp b/src/Context.cpp index 3f6f11916..d26f2a97f 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -182,7 +182,7 @@ Context::Context() { Version::None }; size_t future = 0; - while(versions[future] != Version::None && versions[future] < _version) + while(versions[future] != Version::None && !isVersionSupported(_version)) ++future; /* List of extensions from future versions (extensions from current and diff --git a/src/Context.h b/src/Context.h index d9f6decd2..d74630b15 100644 --- a/src/Context.h +++ b/src/Context.h @@ -235,7 +235,7 @@ class MAGNUM_EXPORT Context { * @see isExtensionSupported(const Extension&) const */ template inline bool isExtensionSupported() const { - return _version >= T::coreVersion() || (_version >= T::requiredVersion() && extensionStatus[T::Index]); + return isVersionSupported(T::coreVersion()) || (isVersionSupported(T::requiredVersion()) && extensionStatus[T::Index]); } /** @@ -248,7 +248,7 @@ class MAGNUM_EXPORT Context { * @see supportedExtensions(), Extension::extensions() */ inline bool isExtensionSupported(const Extension& extension) const { - return _version >= extension._coreVersion || (_version >= extension._requiredVersion && extensionStatus[extension._index]); + return isVersionSupported(extension._coreVersion) || (isVersionSupported(extension._requiredVersion) && extensionStatus[extension._index]); } #ifndef DOXYGEN_GENERATING_OUTPUT