summaryrefslogtreecommitdiff
path: root/platform/qt/src/qquickmapboxglrenderer.hpp
blob: e0fc767d58b1833d89ef626a05d31f2b9a0ae491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "qmapbox.hpp"
#include "qmapboxgl.hpp"

#include <QObject>
#include <QQuickFramebufferObject>
#include <QScopedPointer>

class QGeoCoordinate;
class QOpenGLFramebufferObject;
class QSize;

class QQuickMapboxGLRenderer : public QObject, public QQuickFramebufferObject::Renderer
{
    Q_OBJECT

public:
    QQuickMapboxGLRenderer();
    virtual ~QQuickMapboxGLRenderer();

    virtual QOpenGLFramebufferObject * createFramebufferObject(const QSize &);

    virtual void render();
    virtual void synchronize(QQuickFramebufferObject *);

signals:
    void centerChanged(const QGeoCoordinate &);

private:
    bool m_initialized = false;

    QScopedPointer<QMapboxGL> m_map;
};