blob: 16bb0c73629fd971bb66085ee716cd39c21eb0a8 (
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
35
|
#pragma once
#include "drape/oglcontextfactory.hpp"
#include "qt/qtoglcontext.hpp"
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
class QtOGLContextFactory : public dp::OGLContextFactory
{
public:
QtOGLContextFactory(QOpenGLContext * rootContext);
~QtOGLContextFactory();
bool LockFrame();
GLuint GetTextureHandle() const;
QRectF const & GetTexRect() const;
void UnlockFrame();
virtual dp::OGLContext * getDrawContext();
virtual dp::OGLContext * getResourcesUploadContext();
protected:
virtual bool isDrawContextCreated() const { return m_drawContext != nullptr; }
virtual bool isUploadContextCreated() const { return m_uploadContext != nullptr; }
QOffscreenSurface * createSurface();
private:
QOpenGLContext * m_rootContext;
QtRenderOGLContext * m_drawContext;
QOffscreenSurface * m_drawSurface;
QtUploadOGLContext * m_uploadContext;
QOffscreenSurface * m_uploadSurface;
};
|