summaryrefslogtreecommitdiff
path: root/common/glfw_view.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/glfw_view.hpp')
-rw-r--r--common/glfw_view.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/glfw_view.hpp b/common/glfw_view.hpp
new file mode 100644
index 0000000000..1d1a256699
--- /dev/null
+++ b/common/glfw_view.hpp
@@ -0,0 +1,39 @@
+#ifndef LLMR_COMMON_GLFW_VIEW
+#define LLMR_COMMON_GLFW_VIEW
+
+#include <GLFW/glfw3.h>
+#include <llmr/llmr.hpp>
+
+class MapView {
+public:
+ MapView(llmr::Settings &settings, bool fullscreen = false);
+ ~MapView();
+
+ void init();
+
+ static void key(GLFWwindow *window, int key, int scancode, int action, int mods);
+ static void scroll(GLFWwindow *window, double xoffset, double yoffset);
+ static void resize(GLFWwindow *window, int, int);
+ static void mouseclick(GLFWwindow *window, int button, int action, int modifiers);
+ static void mousemove(GLFWwindow *window, double x, double y);
+
+ int run();
+ void fps();
+
+public:
+ bool fullscreen = false;
+
+ bool dirty = true;
+ double last_x = 0, last_y = 0;
+ bool tracking = false;
+
+ bool rotating = false;
+
+ double last_click = -1;
+
+ GLFWwindow *window = nullptr;
+ llmr::Settings &settings;
+ llmr::Map map;
+};
+
+#endif