summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3drender/scene2d/scene2d_p.h
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2016-11-02 15:57:43 +0200
committerAntti Määttä <antti.maatta@qt.io>2017-01-26 09:19:08 +0000
commitdcd5756f3870d9aed7f73c338cc8715d5fe35297 (patch)
treeae65407ca753fd41e8b50dcbee7a2d0fb2a69f98 /src/quick3d/quick3drender/scene2d/scene2d_p.h
parent6a7e0e2822875e8e532e3cd58f2263d5b3c12da4 (diff)
Update scene2d implementation
Add inline qml support with QQuickItem as default property. Change output to QRenderTargetOutput. Change backend node to use resource accessor and implement own fbo creation. Add event support. Change-Id: Ieb82b986696b00ba026ac9ab08c8dcbe87e84b1c Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3drender/scene2d/scene2d_p.h')
-rw-r--r--src/quick3d/quick3drender/scene2d/scene2d_p.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/quick3d/quick3drender/scene2d/scene2d_p.h b/src/quick3d/quick3drender/scene2d/scene2d_p.h
index 950ddaa5b..769916fc9 100644
--- a/src/quick3d/quick3drender/scene2d/scene2d_p.h
+++ b/src/quick3d/quick3drender/scene2d/scene2d_p.h
@@ -50,12 +50,14 @@
#include <Qt3DCore/qnodeid.h>
-#include <private/framegraphnode_p.h>
-#include <private/qscene2d_p.h>
-
#include <QtCore/QCoreApplication>
#include <QtCore/QSemaphore>
+#include <private/qscene2d_p.h>
+#include <private/qrendertargetoutput_p.h>
+#include <private/backendnode_p.h>
+#include <private/attachmentpack_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
@@ -79,30 +81,37 @@ private:
Scene2D *m_node;
};
-class Q_AUTOTEST_EXPORT Scene2D : public FrameGraphNode
+class Q_AUTOTEST_EXPORT Scene2D : public Qt3DRender::Render::BackendNode
{
public:
Scene2D();
~Scene2D();
- void attach();
void render();
void initializeRender();
void setSharedObject(Qt3DRender::Quick::Scene2DSharedObjectPtr sharedObject);
void cleanup();
- void setTexture(Qt3DCore::QNodeId textureId);
- void checkInitialized();
+ void setOutput(Qt3DCore::QNodeId outputId);
+ void initializeSharedObject();
+ void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_OVERRIDE;
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
- void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL;
+
+ bool updateFbo(QOpenGLTexture *texture);
+ void syncRenderControl();
QOpenGLContext *m_context;
- GraphicsContext *m_graphicsContext;
+ QOpenGLContext *m_shareContext;
QThread *m_renderThread;
- Qt3DCore::QNodeId m_textureId;
+ Qt3DCore::QNodeId m_outputId;
QSharedPointer<Qt3DRender::Quick::Scene2DSharedObject> m_sharedObject;
- AttachmentPack m_attachments;
- Texture *m_texture;
+ Qt3DCore::QNodeId m_peerId;
+ QSharedPointer<RenderBackendResourceAccessor> m_accessor;
+ Qt3DRender::Render::Attachment m_attachmentData;
+
+ GLuint m_fbo;
+ GLuint m_rbo;
+ QSize m_textureSize;
bool m_initialized;
bool m_renderInitialized;