summaryrefslogtreecommitdiff
path: root/platform/qt/src/qquickmapboxglrenderer.hpp
blob: 1fb7a50f4aaf599ec544db03a244693e3500e831 (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 <QGeoCoordinate>
#include <QObject>
#include <QOpenGLFramebufferObject>
#include <QQuickFramebufferObject>
#include <QScopedPointer>
#include <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;
    qreal m_pixelRatio = 1;

    QScopedPointer<QMapboxGL> m_map;
};