Specifies a viewport rectangle. 更多...
| 頭: |
#include <rhi/qrhi.h>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
|
| qmake: |
QT += gui-private
|
| Since: | Qt 6.6 |
| QRhiViewport () | |
| QRhiViewport (float x , float y , float w , float h , float minDepth = 0.0f, float maxDepth = 1.0f) | |
| float | maxDepth () const |
| float | minDepth () const |
| void | setMaxDepth (float maxDepth ) |
| void | setMinDepth (float minDepth ) |
| void | setViewport (float x , float y , float w , float h ) |
| std::array<float, 4> | viewport () const |
| size_t | qHash (const QRhiViewport & key , size_t seed = 0) |
| bool | operator!= (const QRhiViewport & a , const QRhiViewport & b ) |
| bool | operator== (const QRhiViewport & a , const QRhiViewport & b ) |
Used with QRhiCommandBuffer::setViewport ().
QRhi assumes OpenGL-style viewport coordinates, meaning x and y are bottom-left. Negative width or height are not allowed.
Typical usage is like the following:
const QSize outputSizeInPixels = swapchain->currentPixelSize(); const QRhiViewport viewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()); cb->beginPass(swapchain->currentFrameRenderTarget(), Qt::black, { 1.0f, 0 }); cb->setGraphicsPipeline(ps); cb->setViewport(viewport); // ...
注意: This is a RHI API with limited compatibility guarantees, see QRhi 瞭解細節。
另請參閱 QRhiCommandBuffer::setViewport (), QRhi::clipSpaceCorrMatrix (),和 QRhiScissor .
[constexpr noexcept]
QRhiViewport::
QRhiViewport
()
Constructs a viewport description with an empty rectangle and a depth range of 0.0f - 1.0f.
另請參閱 QRhi::clipSpaceCorrMatrix ().
Constructs a viewport description with the rectangle specified by x , y , w , h and the depth range minDepth and maxDepth .
注意: x and y are assumed to be the bottom-left position. w and h should not be negative, the viewport will be ignored by QRhiCommandBuffer::setViewport () otherwise.
另請參閱 QRhi::clipSpaceCorrMatrix ().
Returns the maxDepth value of the depth range of the viewport.
另請參閱 setMaxDepth ().
Returns the minDepth value of the depth range of the viewport.
另請參閱 setMinDepth ().
設置 maxDepth of the depth range of the viewport. By default this is set to 1.0f.
另請參閱 maxDepth ().
設置 minDepth of the depth range of the viewport. By default this is set to 0.0f.
另請參閱 minDepth ().
Sets the viewport's position and size to x , y , w ,和 h .
注意: Viewports are specified in a coordinate system that has its origin in the bottom-left.
另請參閱 viewport ().
Returns the viewport x, y, width, and height.
另請參閱 setViewport ().
[noexcept]
size_t
qHash
(const
QRhiViewport
&
key
,
size_t
seed
= 0)
返迴哈希值為 key ,使用 seed 做計算種子。
[noexcept]
bool
operator!=
(const
QRhiViewport
&
a
, const
QRhiViewport
&
b
)
返迴
false
if the values in the two
QRhiViewport
對象
a
and
b
相等;否則返迴
true
.
[noexcept]
bool
operator==
(const
QRhiViewport
&
a
, const
QRhiViewport
&
b
)
返迴
true
if the values in the two
QRhiViewport
對象
a
and
b
相等。