summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-22 12:29:50 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-11-22 20:58:51 +0100
commit67ed3ae3eb25e5bb0ec2d0369d042438bd9b2c7f (patch)
treea71ef8fdf2ec4d080ceef8e4106e8db9ef5a26ff /include
parent9353fcbf4cde1f8ca2e0d30cabeb64aa3528682e (diff)
downloadqtlocation-mapboxgl-67ed3ae3eb25e5bb0ec2d0369d042438bd9b2c7f.tar.gz
[build] move GLFW-related files to platform/glfw
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp111
-rw-r--r--include/mbgl/platform/default/settings_json.hpp24
2 files changed, 0 insertions, 135 deletions
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp
deleted file mode 100644
index c640f188f9..0000000000
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#pragma once
-
-#include <mbgl/mbgl.hpp>
-#include <mbgl/map/backend.hpp>
-#include <mbgl/util/run_loop.hpp>
-#include <mbgl/util/timer.hpp>
-#include <mbgl/util/geometry.hpp>
-
-#if MBGL_USE_GLES2
-#define GLFW_INCLUDE_ES2
-#endif
-#define GL_GLEXT_PROTOTYPES
-#include <GLFW/glfw3.h>
-
-class GLFWView : public mbgl::View, public mbgl::Backend {
-public:
- GLFWView(bool fullscreen = false, bool benchmark = false);
- ~GLFWView() override;
-
- float getPixelRatio() const;
-
- void setMap(mbgl::Map*);
-
- // Callback called when the user presses the key mapped to style change.
- // The expected action is to set a new style, different to the current one.
- void setChangeStyleCallback(std::function<void()> callback);
-
- void setShouldClose();
-
- void setWindowTitle(const std::string&);
-
- void run();
-
- // mbgl::View implementation
- void updateViewBinding();
- void bind() override;
- mbgl::Size getSize() const;
- mbgl::Size getFramebufferSize() const;
-
- // mbgl::Backend implementation
- void activate() override;
- void deactivate() override;
- void invalidate() override;
-
-private:
- // Window callbacks
- static void onKey(GLFWwindow *window, int key, int scancode, int action, int mods);
- static void onScroll(GLFWwindow *window, double xoffset, double yoffset);
- static void onWindowResize(GLFWwindow *window, int width, int height);
- static void onFramebufferResize(GLFWwindow *window, int width, int height);
- static void onMouseClick(GLFWwindow *window, int button, int action, int modifiers);
- static void onMouseMove(GLFWwindow *window, double x, double y);
-
- // Internal
- void report(float duration);
-
- void setMapChangeCallback(std::function<void(mbgl::MapChange)> callback);
- void notifyMapChange(mbgl::MapChange change) override;
-
- mbgl::Color makeRandomColor() const;
- mbgl::Point<double> makeRandomPoint() const;
- static std::shared_ptr<const mbgl::SpriteImage>
- makeSpriteImage(int width, int height, float pixelRatio);
-
- void nextOrientation();
-
- void addRandomPointAnnotations(int count);
- void addRandomLineAnnotations(int count);
- void addRandomShapeAnnotations(int count);
- void addRandomCustomPointAnnotations(int count);
-
- void clearAnnotations();
- void popAnnotation();
-
- mbgl::AnnotationIDs annotationIDs;
- std::vector<std::string> spriteIDs;
-
- std::function<void(mbgl::MapChange)> mapChangeCallback;
-
-private:
- mbgl::Map* map = nullptr;
-
- bool fullscreen = false;
- const bool benchmark = false;
- bool tracking = false;
- bool rotating = false;
- bool pitching = false;
-
- // Frame timer
- int frames = 0;
- float frameTime = 0;
- double lastReported = 0;
-
- int width = 1024;
- int height = 768;
- int fbWidth;
- int fbHeight;
- float pixelRatio;
-
- double lastX = 0, lastY = 0;
-
- double lastClick = -1;
-
- std::function<void()> changeStyleCallback;
-
- mbgl::util::RunLoop runLoop;
- mbgl::util::Timer frameTick;
-
- GLFWwindow *window = nullptr;
- bool dirty = false;
-};
diff --git a/include/mbgl/platform/default/settings_json.hpp b/include/mbgl/platform/default/settings_json.hpp
deleted file mode 100644
index eb23b28bc8..0000000000
--- a/include/mbgl/platform/default/settings_json.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include <mbgl/map/mode.hpp>
-
-namespace mbgl {
-
-class Settings_JSON {
-public:
- Settings_JSON();
- void load();
- void save();
- void clear();
-
-public:
- double longitude = 0;
- double latitude = 0;
- double zoom = 0;
- double bearing = 0;
- double pitch = 0;
-
- EnumType debug = 0;
-};
-
-} // namespace mbgl