summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-01 23:23:30 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-02 05:09:57 +0100
commit05f3e721694249a71f46cef3c87e0156b00363ee (patch)
tree729a060a0a2ff47b011434f1dd18b6d3a23dff1b /main
parent14188d4c05bb2724bb79ac7b6e3b549b686dbdd3 (diff)
c
Diffstat (limited to 'main')
-rw-r--r--main/main-impl.hpp1
-rw-r--r--main/setup.cpp4
2 files changed, 3 insertions, 2 deletions
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)