|
|
|
|
@ -189,9 +189,11 @@ Context::Context() {
|
|
|
|
|
previous versions should be supported automatically, so we don't need |
|
|
|
|
to check for them) */ |
|
|
|
|
unordered_map<string, Extension> futureExtensions; |
|
|
|
|
for(size_t i = future; i != versions.size(); ++i) |
|
|
|
|
for(const Extension& extension: Extension::extensions(versions[i])) |
|
|
|
|
futureExtensions.insert(make_pair(extension._string, extension)); |
|
|
|
|
for(size_t i = future; i != versions.size(); ++i) { |
|
|
|
|
const std::vector<Extension>& extensions = Extension::extensions(versions[i]); |
|
|
|
|
for(auto it = extensions.begin(); it != extensions.end(); ++it) |
|
|
|
|
futureExtensions.insert(make_pair(it->_string, *it)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Check for presence of extensions in future versions */ |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
@ -217,8 +219,8 @@ Context::Context() {
|
|
|
|
|
const char* e = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); |
|
|
|
|
if(e) { |
|
|
|
|
vector<string> extensions = Corrade::Utility::split(e, ' '); |
|
|
|
|
for(const string& extension: extensions) { |
|
|
|
|
auto found = futureExtensions.find(extension); |
|
|
|
|
for(auto it = extensions.begin(); it != extensions.end(); ++it) { |
|
|
|
|
auto found = futureExtensions.find(*it); |
|
|
|
|
if(found != futureExtensions.end()) { |
|
|
|
|
_supportedExtensions.push_back(found->second); |
|
|
|
|
extensionStatus.set(found->second._index); |
|
|
|
|
@ -252,8 +254,8 @@ Context::~Context() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Version Context::supportedVersion(initializer_list<Version> versions) const { |
|
|
|
|
for(auto version: versions) |
|
|
|
|
if(isVersionSupported(version)) return version; |
|
|
|
|
for(auto it = versions.begin(); it != versions.end(); ++it) |
|
|
|
|
if(isVersionSupported(*it)) return *it; |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
return Version::GL210; |
|
|
|
|
|