diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-26 19:33:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-26 19:33:06 +0200 |
commit | 8898bebd8dcb4361b35dde37bdf424d09b498d60 (patch) | |
tree | b934672158ceda6ed42e0c7e63a5bc57318213a4 /main | |
parent | eb5097b993286ffe44214ad493db75e1749c8ec9 (diff) |
simplify argv handling
Diffstat (limited to 'main')
-rw-r--r-- | main/debug.cpp | 1 | ||||
-rw-r--r-- | main/setup.cpp | 14 |
2 files changed, 5 insertions, 10 deletions
diff --git a/main/debug.cpp b/main/debug.cpp index e5b3c2cf..14f6131e 100644 --- a/main/debug.cpp +++ b/main/debug.cpp @@ -59,6 +59,7 @@ static void _debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type t void main_impl::register_debug_callback() { + GL::DebugOutput::setEnabled(GL::DebugOutput::Source::Api, GL::DebugOutput::Type::Other, {131185}, false); // nvidia krap GL::DebugOutput::setCallback(_debug_callback, this); } diff --git a/main/setup.cpp b/main/setup.cpp index 48ee7832..b6488bad 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -8,20 +8,15 @@ main_impl::main_impl(floormat_app& app, fm_settings&& s, int& fake_argc) noexcep make_conf(s), make_gl_conf(s)}, s{std::move(s)}, app{app} { - switch (s.vsync) // NOLINT(bugprone-use-after-move) + if (s.vsync) { - case fm_tristate::on: (void)setSwapInterval(1); if (const auto list = GL::Context::current().extensionStrings(); std::find(list.cbegin(), list.cend(), "EXT_swap_control_tear") != list.cbegin()) (void)setSwapInterval(-1); - break; - case fm_tristate::off: - setSwapInterval(0); - break; - default: - break; } + else + (void)setSwapInterval(0); set_fp_mask(); fm_assert(framebufferSize() == windowSize()); timeline.start(); @@ -97,8 +92,7 @@ void main_impl::update_window_state() dt_expected.jitter = 0; if (flags & SDL_WINDOW_HIDDEN) dt_expected.value = 1; - else if (int interval = std::abs(SDL_GL_GetSwapInterval()); - s.vsync >= fm_tristate::maybe && interval > 0) + else if (int interval = std::abs(SDL_GL_GetSwapInterval()); s.vsync && interval > 0) { int hz = get_window_refresh_rate(window()) / interval; if (!(flags & SDL_WINDOW_INPUT_FOCUS)) |