diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-02 02:23:37 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-02 02:23:37 +0100 |
commit | 316f7bef0d81f86eb099e6a07b517bb24ed4a3dd (patch) | |
tree | b596622c1edb6570b1d7383c66a9aa09921c7acd /main/setup.cpp | |
parent | 8f6fc959ffbb3c612e9115c9b155f5379bee66d8 (diff) |
app, main: allow Magnum to parse argv --magnum-foo opts
Diffstat (limited to 'main/setup.cpp')
-rw-r--r-- | main/setup.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/main/setup.cpp b/main/setup.cpp index 38df0ccf..742272a8 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -2,11 +2,12 @@ #include "compat/fpu.hpp" #include <algorithm> #include <Corrade/Containers/StringView.h> +#include <Corrade/Containers/StringIterable.h> namespace floormat { -main_impl::main_impl(floormat_app& app, fm_settings&& se, int& fake_argc) noexcept : - Platform::Sdl2Application{Arguments{fake_argc, nullptr}, +main_impl::main_impl(floormat_app& app, fm_settings&& se, int& argc, char** argv) noexcept : + Platform::Sdl2Application{Arguments{argc, argv}, make_conf(se), make_gl_conf(se)}, s{std::move(se)}, app{app} { @@ -43,18 +44,6 @@ auto main_impl::make_window_flags(const fm_settings& s) -> Configuration::Window auto main_impl::make_conf(const fm_settings& s) -> Configuration { - switch (s.log_level) - { - default: - SDL_setenv("MAGNUM_LOG_LEVEL", "normal", 1); - break; - case fm_log_level::quiet: - SDL_setenv("MAGNUM_LOG_LEVEL", "quiet", 1); - break; - case fm_log_level::verbose: - SDL_setenv("MAGNUM_LOG_LEVEL", "verbose", 1); - break; - } return Configuration{} .setTitle(s.title) .setSize(s.resolution, Configuration::DpiScalingPolicy::Virtual) |