Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QRhiScissor Class Reference

\inmodule QtGui More...

#include <qrhi.h>

+ Collaboration diagram for QRhiScissor:

Public Member Functions

 QRhiScissor ()=default
 Constructs an empty scissor.
 
 QRhiScissor (int x, int y, int w, int h)
 Constructs a scissor with the rectangle specified by x, y, w, and h.
 
std::array< int, 4 > scissor () const
 
void setScissor (int x, int y, int w, int h)
 Sets the scissor position and size to x, y, w, h.
 

Friends

bool operator== (const QRhiScissor &a, const QRhiScissor &b) noexcept
 
bool operator!= (const QRhiScissor &a, const QRhiScissor &b) noexcept
 
size_t qHash (const QRhiScissor &v, size_t seed=0) noexcept
 

Detailed Description

\inmodule QtGui

Since
6.6

Specifies a scissor rectangle.

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.

Note
This is a RHI API with limited compatibility guarantees, see \l QRhi for details.
See also
QRhiCommandBuffer::setScissor(), QRhiViewport

Definition at line 137 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiScissor() [1/2]

QRhiScissor::QRhiScissor ( )
default

Constructs an empty scissor.

◆ QRhiScissor() [2/2]

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

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

Note
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.

Definition at line 1403 of file qrhi.cpp.

Member Function Documentation

◆ scissor()

std::array< int, 4 > QRhiScissor::scissor ( ) const
inline
Returns
the scissor position and size.

Definition at line 143 of file qrhi.h.

Referenced by QRhiD3D11::setScissor(), QRhiGles2::setScissor(), QRhiMetal::setScissor(), and QRhiVulkan::setScissor().

+ Here is the caller graph for this function:

◆ setScissor()

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

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

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

Definition at line 144 of file qrhi.h.

Friends And Related Symbol Documentation

◆ operator!=

bool QRhiScissor::operator!= ( const QRhiScissor & a,
const QRhiScissor & b )
friend
Returns
false if the values in the two QRhiScissor objects a and b are equal; otherwise returns true.

Definition at line 156 of file qrhi.h.

◆ operator==

bool QRhiScissor::operator== ( const QRhiScissor & a,
const QRhiScissor & b )
friend
Returns
true if the values in the two QRhiScissor objects a and b are equal.

Definition at line 151 of file qrhi.h.

◆ qHash

size_t QRhiScissor::qHash ( const QRhiScissor & v,
size_t seed = 0 )
friend
Returns
the hash value for v, using seed to seed the calculation.

Definition at line 161 of file qrhi.h.


The documentation for this class was generated from the following files: