QSGAbstractRenderer Class
QSGAbstractRenderer gives access to the scene graph nodes and rendering. \inmodule
QtQuick \since
5.4 \internal
. More...
Header: | #include <QSGAbstractRenderer> |
Inherits: | QObject |
Inherited By: |
Public Types
flags | ClearMode |
enum | ClearModeBit { ClearColorBuffer, ClearDepthBuffer, ClearStencilBuffer } |
enum | MatrixTransformFlag { MatrixTransformFlipY } |
flags | MatrixTransformFlags |
Public Functions
virtual | ~QSGAbstractRenderer() override |
QColor | clearColor() const |
ClearMode | clearMode() const |
QRect | deviceRect() const |
QMatrix4x4 | projectionMatrix() const |
QMatrix4x4 | projectionMatrixWithNativeNDC() const |
QSGRootNode * | rootNode() const |
void | setClearColor(const QColor &color) |
void | setClearMode(ClearMode mode) |
void | setDeviceRect(const QRect &rect) |
void | setProjectionMatrix(const QMatrix4x4 &matrix) |
void | setProjectionMatrixToRect(const QRectF &rect) |
void | setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags) |
void | setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags, bool nativeNDCFlipY) |
void | setProjectionMatrixWithNativeNDC(const QMatrix4x4 &matrix) |
void | setRootNode(QSGRootNode *node) |
void | setViewportRect(const QRect &rect) |
QRect | viewportRect() const |
Protected Functions
QSGAbstractRenderer(QObject *parent = nullptr) |
Detailed Description
Member Type Documentation
enum QSGAbstractRenderer::ClearModeBit
flags QSGAbstractRenderer::ClearMode
Used with setClearMode() to indicate which buffer should be cleared before the scene render.
Constant | Value | Description |
---|---|---|
QSGAbstractRenderer::ClearColorBuffer | 0x0001 | Clear the color buffer using clearColor(). |
QSGAbstractRenderer::ClearDepthBuffer | 0x0002 | Clear the depth buffer. |
QSGAbstractRenderer::ClearStencilBuffer | 0x0004 | Clear the stencil buffer. |
The ClearMode type is a typedef for QFlags<ClearModeBit>. It stores an OR combination of ClearModeBit values.
See also setClearMode() and setClearColor().
enum QSGAbstractRenderer::MatrixTransformFlag
flags QSGAbstractRenderer::MatrixTransformFlags
Used with setProjectionMatrixToRect() to indicate the expectations towards the generated projection matrix.
Constant | Value | Description |
---|---|---|
QSGAbstractRenderer::MatrixTransformFlipY | 0x01 | The traditional assumption in Qt Quick is that Y points up in the normalized device coordinate system. There is at least one modern graphics API where this is not the case (Vulkan). This flag can then be used to get a projection that is appropriate for such an API. |
\since
5.14
The MatrixTransformFlags type is a typedef for QFlags<MatrixTransformFlag>. It stores an OR combination of MatrixTransformFlag values.
See also setProjectionMatrixToRect().
Member Function Documentation
[explicit protected]
QSGAbstractRenderer::QSGAbstractRenderer(QObject *parent = nullptr)
\internal
[override virtual noexcept]
QSGAbstractRenderer::~QSGAbstractRenderer()
\internal
QColor QSGAbstractRenderer::clearColor() const
Returns the color that clears the framebuffer at the beginning of the rendering.
See also setClearColor() and clearMode().
ClearMode QSGAbstractRenderer::clearMode() const
Flags defining which attachment of the framebuffer will be cleared before each scene render.
See also setClearMode() and clearColor().
QRect QSGAbstractRenderer::deviceRect() const
Returns the device rect of the surface being rendered to.
See also setDeviceRect().
QMatrix4x4 QSGAbstractRenderer::projectionMatrix() const
Returns the projection matrix
See also setProjectionMatrix() and setProjectionMatrixToRect().
QMatrix4x4 QSGAbstractRenderer::projectionMatrixWithNativeNDC() const
\internal
See also setProjectionMatrixWithNativeNDC().
QSGRootNode *QSGAbstractRenderer::rootNode() const
Returns the root of the QSGNode scene.
See also setRootNode().
void QSGAbstractRenderer::setClearColor(const QColor &color)
Use color to clear the framebuffer when clearMode() is set to QSGAbstractRenderer::ClearColorBuffer.
See also clearColor() and setClearMode().
void QSGAbstractRenderer::setClearMode(ClearMode mode)
Defines which attachment of the framebuffer should be cleared before each scene render with the mode flag.
See also clearMode() and setClearColor().
void QSGAbstractRenderer::setDeviceRect(const QRect &rect)
Sets rect as the geometry of the surface being rendered to.
See also deviceRect().
void QSGAbstractRenderer::setProjectionMatrix(const QMatrix4x4 &matrix)
Use matrix to project the QSGNode coordinates onto surface pixels.
See also projectionMatrix() and setProjectionMatrixToRect().
void QSGAbstractRenderer::setProjectionMatrixToRect(const QRectF &rect)
Convenience method that calls setProjectionMatrix() with an orthographic matrix generated from rect.
Note: This function assumes that the graphics API uses Y up in its normalized device coordinate system.
See also setProjectionMatrix() and projectionMatrix().
void QSGAbstractRenderer::setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags)
Convenience method that calls setProjectionMatrix() with an orthographic matrix generated from rect.
Set MatrixTransformFlipY in flags when the graphics API uses Y down in its normalized device coordinate system (for example, Vulkan).
\since
5.14
See also setProjectionMatrix() and projectionMatrix().
void QSGAbstractRenderer::setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags, bool nativeNDCFlipY)
Convenience method that calls setProjectionMatrix() with an orthographic matrix generated from rect.
Set MatrixTransformFlipY in flags when the graphics API uses Y down in its normalized device coordinate system (for example, Vulkan).
Convenience method that calls setProjectionMatrixWithNativeNDC() with an orthographic matrix generated from rect.
Set true to nativeNDCFlipY to flip the Y axis relative to projection matrix in its normalized device coordinate system.
\since
6.7
See also setProjectionMatrix(), projectionMatrix(), setProjectionMatrixWithNativeNDC(), and projectionMatrixWithNativeNDC().
void QSGAbstractRenderer::setProjectionMatrixWithNativeNDC(const QMatrix4x4 &matrix)
\internal
See also projectionMatrixWithNativeNDC().
void QSGAbstractRenderer::setRootNode(QSGRootNode *node)
Sets the node as the root of the QSGNode scene that you want to render. You need to provide a node before trying to render the scene.
Note: This doesn't take ownership of node.
See also rootNode().
void QSGAbstractRenderer::setViewportRect(const QRect &rect)
Sets rect as the geometry of the viewport to render on the surface.
See also viewportRect().
QRect QSGAbstractRenderer::viewportRect() const
Returns the rect of the viewport to render.
See also setViewportRect().