QRhiScissor Class

Specifies a scissor rectangle. 更多...

頭: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
Since: Qt 6.6

公共函數

QRhiScissor ()
QRhiScissor (int x , int y , int w , int h )
std::array<int, 4> scissor () const
void setScissor (int x , int y , int w , int h )
size_t qHash (const QRhiScissor & key , size_t seed = 0)
bool operator!= (const QRhiScissor & a , const QRhiScissor & b )
bool operator== (const QRhiScissor & a , const QRhiScissor & b )

詳細描述

Used with QRhiCommandBuffer::setScissor (). Setting a scissor rectangle is only possible with a QRhiGraphicsPipeline that has QRhiGraphicsPipeline::UsesScissor set.

QRhi assumes OpenGL-style scissor coordinates, meaning x and y are bottom-left. Negative width or height are not allowed. However, apart from that, the flexible OpenGL semantics apply: negative x and y, partially out of bounds rectangles, etc. will be handled gracefully, clamping as appropriate. Therefore, any rendering logic targeting OpenGL can feed scissor rectangles into QRhiScissor as-is, without any adaptation.

注意: This is a RHI API with limited compatibility guarantees, see QRhi 瞭解細節。

另請參閱 QRhiCommandBuffer::setScissor () 和 QRhiViewport .

成員函數文檔編製

[constexpr noexcept] QRhiScissor:: QRhiScissor ()

Constructs an empty scissor.

QRhiScissor:: QRhiScissor ( int x , int y , int w , int h )

Constructs a scissor with the rectangle specified by x , y , w ,和 h .

注意: x and y are assumed to be the bottom-left position. Negative w or h are not allowed, such scissor rectangles will be ignored by QRhiCommandBuffer . Other than that, the flexible OpenGL semantics apply: negative x and y, partially out of bounds rectangles, etc. will be handled gracefully, clamping as appropriate.

std::array < int , 4 > QRhiScissor:: scissor () const

Returns the scissor position and size.

另請參閱 setScissor ().

void QRhiScissor:: setScissor ( int x , int y , int w , int h )

Sets the scissor position and size to x , y , w , h .

注意: The position is always expected to be specified in a coordinate system that has its origin in the bottom-left corner, like OpenGL.

另請參閱 scissor ().

相關非成員

[noexcept] size_t qHash (const QRhiScissor & key , size_t seed = 0)

返迴哈希值為 key ,使用 seed 做計算種子。

[noexcept] bool operator!= (const QRhiScissor & a , const QRhiScissor & b )

返迴 false if the values in the two QRhiScissor 對象 a and b 相等;否則返迴 true .

[noexcept] bool operator== (const QRhiScissor & a , const QRhiScissor & b )

返迴 true if the values in the two QRhiScissor 對象 a and b 相等。