From f4ff04350e5ab21cf828595258f3924d61865bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 11 Sep 2013 09:08:55 +0200 Subject: [PATCH] Platform: ability to show extensions also for fully supported versions. --- src/Platform/magnum-info.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Platform/magnum-info.cpp b/src/Platform/magnum-info.cpp index 8def78d74..0bb1e4990 100644 --- a/src/Platform/magnum-info.cpp +++ b/src/Platform/magnum-info.cpp @@ -22,6 +22,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include #ifdef CORRADE_TARGET_NACL @@ -44,7 +45,16 @@ class MagnumInfo: public Platform::WindowlessApplication { int exec() override { return 0; } }; -MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplication(arguments) { +MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) { + Utility::Arguments args; + args.addBooleanOption("all-extensions") + .setHelp("all-extensions", "show extensions also for fully supported versions") + .setHelp("Displays information about Magnum engine and OpenGL capabilities.") + .parse(arguments.argc, arguments.argv); + + /* Create context after parsing arguments, so the help can be displayed + without creating context */ + createContext({}); Context* c = Context::current(); /* Pass debug output as messages to JavaScript */ @@ -127,8 +137,10 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat Version::None }; std::size_t future = 0; - while(versions[future] != Version::None && c->isVersionSupported(versions[future])) - ++future; + + if(!args.isSet("all-extensions")) + while(versions[future] != Version::None && c->isVersionSupported(versions[future])) + ++future; /* Display supported OpenGL extensions from unsupported versions */ for(std::size_t i = future; i != versions.size(); ++i) {