summaryrefslogtreecommitdiffhomepage
path: root/main/app.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-19 06:25:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-19 06:25:39 +0200
commitbafde6416401672cc7838f02af504561d34681fb (patch)
tree35a99b8241e19240bc339b9efbaece19ee87907e /main/app.hpp
parentf07d626a2661858c0c5f820bd64c7151c76a4ecd (diff)
a
Diffstat (limited to 'main/app.hpp')
-rw-r--r--main/app.hpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/main/app.hpp b/main/app.hpp
index 7417962e..bf8ea7d0 100644
--- a/main/app.hpp
+++ b/main/app.hpp
@@ -19,14 +19,20 @@
namespace floormat {
-struct app final : Platform::Application
+struct app final : private Platform::Application
{
+ static int run_from_argv(int argc, char** argv);
+ virtual ~app();
+
+private:
+ struct app_settings;
+
+ [[maybe_unused]] static void usage(const Utility::Arguments& args);
+ explicit app(const Arguments& arguments, app_settings opts);
+
using dpi_policy = Platform::Implementation::Sdl2DpiScalingPolicy;
using tile_atlas_ = std::shared_ptr<tile_atlas>;
- explicit app(const Arguments& arguments);
- virtual ~app();
-
void update(float dt);
void do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated);
@@ -68,6 +74,8 @@ struct app final : Platform::Application
void debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type, UnsignedInt id,
GL::DebugOutput::Severity severity, const std::string& str) const;
+ static void _debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type, UnsignedInt id,
+ GL::DebugOutput::Severity severity, const std::string& str, const void* self);
void* register_debug_callback();
global_coords pixel_to_tile(Vector2d position) const;
@@ -102,6 +110,12 @@ struct app final : Platform::Application
float _frame_time = 0;
bool _cursor_in_imgui = false;
+ struct app_settings {
+ bool vsync = true;
+ };
+
+ app_settings _settings;
+
static constexpr std::int16_t BASE_X = 0, BASE_Y = 0;
};