QSGAbstractRenderergives access to the scene graph nodes and rendering of aQSGEngine. 更多 …
def
clearColor
()
def
clearMode
()
def
deviceRect
()
def
projectionMatrix
()
def
setClearColor
(color)
def
setClearMode
(mode)
def
setDeviceRect
(rect)
def
setDeviceRect
(size)
def
setProjectionMatrix
(matrix)
def
setProjectionMatrixToRect
(rect)
def
setProjectionMatrixToRect
(rect, flags)
def
setProjectionMatrixWithNativeNDC
(matrix)
def
setViewportRect
(rect)
def
setViewportRect
(size)
def
viewportRect
()
def
nodeChanged
(node, state)
def
renderScene
([fboId=0])
def
sceneGraphChanged
()
A
QSGAbstractRenderercreated by aQSGEngineallows you to set yourQSGNodetree throughsetRootNode()and control the rendering viewport throughsetDeviceRect(),setViewportRect()andsetProjectionMatrixToRect(). You can finally trigger the rendering to the desired framebuffer throughrenderScene().
QSGAbstractRendereris only available when used with aQSGEngineand isn’t exposed when used internally byQQuickWindow.
QSGAbstractRenderer
(
[
parent=None
]
)
¶
parent
–
QObject
PySide2.QtQuick.QSGAbstractRenderer.
ClearModeBit
¶
Used with
setClearMode()
to indicate which buffer should be cleared before the scene render.
|
常量 |
描述 |
|---|---|
|
QSGAbstractRenderer.ClearColorBuffer |
Clear the color buffer using
|
|
QSGAbstractRenderer.ClearDepthBuffer |
Clear the depth buffer. |
|
QSGAbstractRenderer.ClearStencilBuffer |
Clear the stencil buffer. |
PySide2.QtQuick.QSGAbstractRenderer.
MatrixTransformFlag
¶
Used with
setProjectionMatrixToRect()
to indicate the expectations towards the generated projection matrix.
|
常量 |
描述 |
|---|---|
|
QSGAbstractRenderer.MatrixTransformFlipY |
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. |
New in version 5.14.
PySide2.QtQuick.QSGAbstractRenderer.
clearColor
(
)
¶
QColor
Returns the color that clears the framebuffer at the beginning of the rendering.
PySide2.QtQuick.QSGAbstractRenderer.
clearMode
(
)
¶
ClearMode
Flags defining which attachment of the framebuffer will be cleared before each scene render.
PySide2.QtQuick.QSGAbstractRenderer.
deviceRect
(
)
¶
QRect
Returns the device rect of the surface being rendered to.
另请参阅
PySide2.QtQuick.QSGAbstractRenderer.
nodeChanged
(
node
,
state
)
¶
node
–
QSGNode
state
–
DirtyState
PySide2.QtQuick.QSGAbstractRenderer.
projectionMatrix
(
)
¶
QMatrix4x4
Returns the projection matrix
PySide2.QtQuick.QSGAbstractRenderer.
projectionMatrixWithNativeNDC
(
)
¶
QMatrix4x4
PySide2.QtQuick.QSGAbstractRenderer.
renderScene
(
[
fboId=0
]
)
¶
fboId
–
uint
Render the scene to the specified
fboId
若
fboId
isn’t specified, the scene graph will be rendered to the default framebuffer. You will have to call
swapBuffers()
yourself afterward.
The framebuffer specified by
fboId
will be bound automatically.
另请参阅
swapBuffers()
handle()
PySide2.QtQuick.QSGAbstractRenderer.
sceneGraphChanged
(
)
¶
PySide2.QtQuick.QSGAbstractRenderer.
setClearColor
(
color
)
¶
color
–
QColor
使用
color
to clear the framebuffer when
clearMode()
is set to
ClearColorBuffer
.
PySide2.QtQuick.QSGAbstractRenderer.
setClearMode
(
mode
)
¶
mode
–
ClearMode
Defines which attachment of the framebuffer should be cleared before each scene render with the
mode
标志。
PySide2.QtQuick.QSGAbstractRenderer.
setDeviceRect
(
rect
)
¶
rect
–
QRect
PySide2.QtQuick.QSGAbstractRenderer.
setDeviceRect
(
size
)
¶
size
–
QSize
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrix
(
matrix
)
¶
matrix
–
QMatrix4x4
使用
matrix
to project the
QSGNode
coordinates onto surface pixels.
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrixToRect
(
rect
)
¶
rect
–
QRectF
Convenience method that calls
setProjectionMatrix()
with an orthographic matrix generated from
rect
.
注意
This function assumes that the graphics API uses Y up in its normalized device coordinate system.
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrixToRect
(
rect
,
flags
)
¶
rect
–
QRectF
flags
–
MatrixTransformFlags
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).
PySide2.QtQuick.QSGAbstractRenderer.
setProjectionMatrixWithNativeNDC
(
matrix
)
¶
matrix
–
QMatrix4x4
PySide2.QtQuick.QSGAbstractRenderer.
setViewportRect
(
rect
)
¶
rect
–
QRect
PySide2.QtQuick.QSGAbstractRenderer.
setViewportRect
(
size
)
¶
size
–
QSize
PySide2.QtQuick.QSGAbstractRenderer.
viewportRect
(
)
¶
QRect
Returns the rect of the viewport to render.
另请参阅