18 #include <Qt3DRender/QRenderCapture> 19 #include <Qt3DExtras/Qt3DWindow> 20 #include <Qt3DExtras/QForwardRenderer> 25 mWindow3D =
new Qt3DExtras::Qt3DWindow;
27 mCapture =
new Qt3DRender::QRenderCapture;
28 mWindow3D->activeFrameGraph()->setParent( mCapture );
29 mWindow3D->setActiveFrameGraph( mCapture );
39 Qt3DRender::QRenderCaptureReply *captureReply;
40 captureReply = mCapture->requestCapture();
41 connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed,
this, [ = ]
44 captureReply->deleteLater();
50 mWindow3D->defaultFrameGraph()->setClearColor( color );
55 mWindow3D->defaultFrameGraph()->setFrustumCullingEnabled( enabled );
60 mWindow3D->setRootEntity( root );
65 return mWindow3D->renderSettings();
70 return mWindow3D->camera();
75 return mWindow3D->size();
void requestCaptureImage() override
Starts a request for an image rendered by the engine.
void setRootEntity(Qt3DCore::QEntity *root) override
Sets root entity of the 3D scene.
void setClearColor(const QColor &color) override
Sets background color of the scene.
QWindow * window()
Returns the internal 3D window where all the rendered output is displayed.
Qt3DRender::QRenderSettings * renderSettings() override
Returns access to the engine's render settings (the frame graph can be accessed from here) ...
Qt3DRender::QCamera * camera() override
Returns pointer to the engine's camera entity.
void imageCaptured(const QImage &image)
Emitted after a call to requestCaptureImage() to return the captured image.
QSize size() const override
Returns size of the engine's rendering area in pixels.
void setFrustumCullingEnabled(bool enabled) override
Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities ...