summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer/renderer.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-06-13 10:50:16 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-07-18 10:45:12 +0200
commit3832f8d0d8194b81ea34a045e19b0d5bc7a89e25 (patch)
treebbb4b277e1e74bde457271b9b9a5b6a9ec3ad5fb /include/mbgl/renderer/renderer.hpp
parent39a732d7ae3cb1b927d94c4b1154b42d9565356a (diff)
downloadqtlocation-mapboxgl-3832f8d0d8194b81ea34a045e19b0d5bc7a89e25.tar.gz
[core] renderer interface
Diffstat (limited to 'include/mbgl/renderer/renderer.hpp')
-rw-r--r--include/mbgl/renderer/renderer.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/mbgl/renderer/renderer.hpp b/include/mbgl/renderer/renderer.hpp
new file mode 100644
index 0000000000..6626f74d3d
--- /dev/null
+++ b/include/mbgl/renderer/renderer.hpp
@@ -0,0 +1,54 @@
+#pragma once
+
+#include <mbgl/map/mode.hpp>
+#include <mbgl/renderer/query.hpp>
+#include <mbgl/annotation/annotation.hpp>
+#include <mbgl/util/geo.hpp>
+#include <mbgl/util/geo.hpp>
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace mbgl {
+
+class Backend;
+class FileSource;
+class RendererObserver;
+class RenderedQueryOptions;
+class Scheduler;
+class SourceQueryOptions;
+class UpdateParameters;
+class View;
+
+class Renderer {
+public:
+ Renderer(Backend&, float pixelRatio_, FileSource&, Scheduler&,
+ GLContextMode = GLContextMode::Unique,
+ const optional<std::string> programCacheDir = optional<std::string>());
+ ~Renderer();
+
+ void setObserver(RendererObserver*);
+
+ void render(View& view, const UpdateParameters&);
+
+ // Feature queries
+ std::vector<Feature> queryRenderedFeatures(const ScreenLineString&, const RenderedQueryOptions& options = {}) const;
+ std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate& point, const RenderedQueryOptions& options = {}) const;
+ std::vector<Feature> queryRenderedFeatures(const ScreenBox& box, const RenderedQueryOptions& options = {}) const;
+ std::vector<Feature> querySourceFeatures(const std::string& sourceID, const SourceQueryOptions& options = {}) const;
+ AnnotationIDs queryPointAnnotations(const ScreenBox& box) const;
+
+ // Debug
+ void dumpDebugLogs();
+
+ // Memory
+ void onLowMemory();
+
+private:
+ class Impl;
+ std::unique_ptr<Impl> impl;
+};
+
+} // namespace mbgl