From 8b67a492f459a47a1d2eeebc852c9741a77708d5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 Jan 2024 10:59:44 +0100 Subject: a --- main/ctor.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 main/ctor.cpp (limited to 'main/ctor.cpp') diff --git a/main/ctor.cpp b/main/ctor.cpp new file mode 100644 index 00000000..11bc8cb9 --- /dev/null +++ b/main/ctor.cpp @@ -0,0 +1,34 @@ +#include "main-impl.hpp" +#include "compat/fpu.hpp" +#include "src/path-search.hpp" +#include + +namespace floormat { + +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}, _shader{_tuc} +{ + if (s.vsync) + { + (void)setSwapInterval(1); + if (const auto list = GL::Context::current().extensionStrings(); + std::find(list.cbegin(), list.cend(), "EXT_swap_control_tear") != list.cend()) + (void)setSwapInterval(-1); + } + else + (void)setSwapInterval(0); + set_fp_mask(); + arrayReserve(_clickable_scenery, 128); + timeline.start(); +} + +class world& main_impl::reset_world(class world&& w) noexcept +{ + arrayResize(_clickable_scenery, 0); + _world = std::move(w); + return _world; +} + +} // namespace floormat -- cgit v1.2.3