Browse Source

Using isVersionSupported() instead of plain comparison.

It is more descriptive and easier to fix/modify when it is in one place.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
9459d4c6a1
  1. 2
      src/Context.cpp
  2. 4
      src/Context.h

2
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

4
src/Context.h

@ -235,7 +235,7 @@ class MAGNUM_EXPORT Context {
* @see isExtensionSupported(const Extension&) const
*/
template<class T> 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

Loading…
Cancel
Save