From 9459d4c6a1b8fda4bd5797495896b02c110af5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 8 Nov 2012 19:24:22 +0100 Subject: [PATCH] Using isVersionSupported() instead of plain comparison. It is more descriptive and easier to fix/modify when it is in one place. --- src/Context.cpp | 2 +- src/Context.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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