Files
MapLibreParticleLab/include/mbgl/renderer/renderer.hpp
Ivo van Dongen bda6ed26c6 [core] send signal to RenderCustomLayer when gl context has been lost
- Prevents cleaning up of GL resources that no longer exist, resulting in a crash
2017-09-22 23:33:56 +03:00

56 lines
1.5 KiB
C++

#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 FileSource;
class RendererBackend;
class RendererObserver;
class RenderedQueryOptions;
class Scheduler;
class SourceQueryOptions;
class UpdateParameters;
class Renderer {
public:
Renderer(RendererBackend&, float pixelRatio_, FileSource&, Scheduler&,
GLContextMode = GLContextMode::Unique,
const optional<std::string> programCacheDir = {});
~Renderer();
void markContextLost();
void setObserver(RendererObserver*);
void render(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