\inmodule QtGui
More...
#include <qrhi.h>
|
| QRhiViewport ()=default |
| Constructs a viewport description with an empty rectangle and a depth range of 0.0f - 1.0f.
|
|
| QRhiViewport (float x, float y, float w, float h, float minDepth=0.0f, float maxDepth=1.0f) |
| Constructs a viewport description with the rectangle specified by x, y, w, h and the depth range minDepth and maxDepth.
|
|
std::array< float, 4 > | viewport () const |
|
void | setViewport (float x, float y, float w, float h) |
| Sets the viewport's position and size to x, y, w, and h.
|
|
float | minDepth () const |
|
void | setMinDepth (float minDepth) |
| Sets the minDepth of the depth range of the viewport.
|
|
float | maxDepth () const |
|
void | setMaxDepth (float maxDepth) |
| Sets the maxDepth of the depth range of the viewport.
|
|
\inmodule QtGui
- Since
- 6.6
Specifies a viewport rectangle.
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();
cb->beginPass(swapchain->currentFrameRenderTarget(),
Qt::black, { 1.0f, 0 });
cb->setGraphicsPipeline(ps);
std::array< float, 4 > viewport() const
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
- Note
- This is a RHI API with limited compatibility guarantees, see \l QRhi for details.
- See also
- QRhiCommandBuffer::setViewport(), QRhi::clipSpaceCorrMatrix(), QRhiScissor
Definition at line 84 of file qrhi.h.
◆ QRhiViewport() [1/2]
QRhiViewport::QRhiViewport |
( |
| ) |
|
|
default |
◆ QRhiViewport() [2/2]
QRhiViewport::QRhiViewport |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
float |
minDepth = 0.0f , |
|
|
float |
maxDepth = 1.0f |
|
) |
| |
Constructs a viewport description with the rectangle specified by x, y, w, h and the depth range minDepth and maxDepth.
- Note
- 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.
- See also
- QRhi::clipSpaceCorrMatrix()
Definition at line 1239 of file qrhi.cpp.
◆ maxDepth()
float QRhiViewport::maxDepth |
( |
| ) |
const |
|
inline |
- Returns
- the maxDepth value of the depth range of the viewport.
Definition at line 98 of file qrhi.h.
◆ minDepth()
float QRhiViewport::minDepth |
( |
| ) |
const |
|
inline |
- Returns
- the minDepth value of the depth range of the viewport.
Definition at line 95 of file qrhi.h.
◆ setMaxDepth()
void QRhiViewport::setMaxDepth |
( |
float |
maxDepth | ) |
|
|
inline |
Sets the maxDepth of the depth range of the viewport.
By default this is set to 1.0f.
Definition at line 99 of file qrhi.h.
◆ setMinDepth()
void QRhiViewport::setMinDepth |
( |
float |
minDepth | ) |
|
|
inline |
Sets the minDepth of the depth range of the viewport.
By default this is set to 0.0f.
Definition at line 96 of file qrhi.h.
◆ setViewport()
void QRhiViewport::setViewport |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h |
|
) |
| |
|
inline |
Sets the viewport's position and size to x, y, w, and h.
- Note
- Viewports are specified in a coordinate system that has its origin in the bottom-left.
Definition at line 91 of file qrhi.h.
◆ viewport()
std::array< float, 4 > QRhiViewport::viewport |
( |
| ) |
const |
|
inline |
- Returns
- the viewport x, y, width, and height.
Definition at line 90 of file qrhi.h.
◆ operator!=
- Returns
false
if the values in the two QRhiViewport objects a and b are equal; otherwise returns true
.
Definition at line 113 of file qrhi.h.
◆ operator==
- Returns
true
if the values in the two QRhiViewport objects a and b are equal.
Definition at line 106 of file qrhi.h.
◆ qHash
size_t QRhiViewport::qHash |
( |
const QRhiViewport & |
v, |
|
|
size_t |
seed = 0 |
|
) |
| |
|
friend |
- Returns
- the hash value for v, using seed to seed the calculation.
Definition at line 118 of file qrhi.h.
The documentation for this class was generated from the following files: