Browse Source

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.
euler-xxx
Vladimír Vondruš 5 years ago
parent
commit
a4a239d0f4
  1. 5
      src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp
  2. 4
      src/Magnum/Platform/WindowlessEglApplication.cpp

5
src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp

@ -38,12 +38,17 @@ WindowlessEglApplicationTest::WindowlessEglApplicationTest(const Arguments& argu
Utility::Arguments args; Utility::Arguments args;
args.addSkippedPrefix("magnum", "engine-specific options") args.addSkippedPrefix("magnum", "engine-specific options")
.addBooleanOption("quiet").setHelp("quiet", "like --magnum-log quiet, but specified via a Context::Configuration instead") .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") .addBooleanOption("gpu-validation").setHelp("gpu-validation", "like --magnum-gpu-validation, but specified via a Context::Configuration instead")
.parse(arguments.argc, arguments.argv); .parse(arguments.argc, arguments.argv);
Configuration conf; Configuration conf;
if(args.isSet("quiet")) if(args.isSet("quiet"))
conf.addFlags(Configuration::Flag::QuietLog); 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")) if(args.isSet("gpu-validation"))
conf.addFlags(Configuration::Flag::GpuValidation); conf.addFlags(Configuration::Flag::GpuValidation);
createContext(conf); createContext(conf);

4
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -102,7 +102,9 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G
/* Otherwise find the display and initialize EGL */ /* Otherwise find the display and initialize EGL */
{ {
#ifndef MAGNUM_TARGET_WEBGL #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 /* If relevant extensions are supported, try to find some display using
those APIs, as that works reliably also when running headless. This those APIs, as that works reliably also when running headless. This

Loading…
Cancel
Save