From a4a239d0f4c1864c6403242a2dd4668a0a43c275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 26 Feb 2021 12:37:23 +0100 Subject: [PATCH] Platform: take into account Flag::VerboseLog in WindowlessEglApplication. The app does its own EGL-specific verbose printing and thus should recognize this option the same way as GL::Context does. Right now it was only taking into account the command-line parameters and not the new Configuration. --- src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp | 5 +++++ src/Magnum/Platform/WindowlessEglApplication.cpp | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp index ba828124f..603a32abb 100644 --- a/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp @@ -38,12 +38,17 @@ WindowlessEglApplicationTest::WindowlessEglApplicationTest(const Arguments& argu Utility::Arguments args; args.addSkippedPrefix("magnum", "engine-specific options") .addBooleanOption("quiet").setHelp("quiet", "like --magnum-log quiet, but specified via a Context::Configuration instead") + .addBooleanOption("verbose").setHelp("verbose", "like --magnum-log verbose, but specified via a Context::Configuration instead") .addBooleanOption("gpu-validation").setHelp("gpu-validation", "like --magnum-gpu-validation, but specified via a Context::Configuration instead") .parse(arguments.argc, arguments.argv); Configuration conf; if(args.isSet("quiet")) conf.addFlags(Configuration::Flag::QuietLog); + /* Additional EGL-specific output is printed by the app, verify we take + the Configuration option into account as well, not just command line */ + if(args.isSet("verbose")) + conf.addFlags(Configuration::Flag::VerboseLog); if(args.isSet("gpu-validation")) conf.addFlags(Configuration::Flag::GpuValidation); createContext(conf); diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index e2e85e809..844fe7e38 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -102,7 +102,9 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G /* Otherwise find the display and initialize EGL */ { #ifndef MAGNUM_TARGET_WEBGL - const bool displayVerboseLog = magnumContext && (magnumContext->configurationFlags() >= GL::Context::Configuration::Flag::VerboseLog); + /* Display verbose log if specified either on command line or in + Configuration but not if the command line overrides it to be quiet */ + const bool displayVerboseLog = ((configuration.flags() & Configuration::Flag::VerboseLog) && (!magnumContext || !(magnumContext->configurationFlags() & GL::Context::Configuration::Flag::QuietLog))) || (magnumContext && (magnumContext->configurationFlags() >= GL::Context::Configuration::Flag::VerboseLog)); /* If relevant extensions are supported, try to find some display using those APIs, as that works reliably also when running headless. This