From 05f3e721694249a71f46cef3c87e0156b00363ee Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 1 Mar 2024 23:23:30 +0100 Subject: c --- main/main-impl.hpp | 1 + main/setup.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/main-impl.hpp b/main/main-impl.hpp index f87bd5fc..39e07d4c 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -59,6 +59,7 @@ struct main_impl final : Platform::Sdl2Application, floormat_main class world& reset_world(class world&& w) noexcept override; SDL_Window* window() noexcept override; void update_window_state(); + static unsigned get_window_refresh_rate(SDL_Window* window, unsigned min, unsigned max); float smoothed_frame_time() const noexcept override; fm_settings& settings() noexcept override; diff --git a/main/setup.cpp b/main/setup.cpp index b61e411b..93d28436 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -103,7 +103,7 @@ auto main_impl::make_gl_conf(const fm_settings&) -> GLConfiguration .setStencilBufferSize(0); } -unsigned get_window_refresh_rate(SDL_Window* window, unsigned min, unsigned max) +unsigned main_impl::get_window_refresh_rate(SDL_Window* window, unsigned min, unsigned max) { fm_assert(window != nullptr); if (int index = SDL_GetWindowDisplayIndex(window); index < 0) @@ -122,7 +122,6 @@ unsigned get_window_refresh_rate(SDL_Window* window, unsigned min, unsigned max) void main_impl::update_window_state() // todo window minimized, out of focus, fake vsync etc { - constexpr auto b = [](bool x) { return x ? "1" : "0"; }; const auto flags = (SDL_WindowFlags)SDL_GetWindowFlags(window()); int interval = std::abs(SDL_GL_GetSwapInterval()); @@ -146,6 +145,7 @@ void main_impl::update_window_state() // todo window minimized, out of focus, fa }; #if 0 + constexpr auto b = [](bool x) { return x ? "1" : "0"; }; DBG_nospace << "window:" << " " << _framebuffer_size.x() << "x" << _framebuffer_size.y() << " hz:" << hz << " vsync:" << b(vsync) -- cgit v1.2.3