\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
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 QtGuiPrivate \inheaderfile rhi/qrhi.h
- 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
QRhiViewport()=default
Constructs a viewport description with an empty rectangle and a depth range of 0.0f - 1....
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 85 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 1369 of file qrhi.cpp.
◆ maxDepth()
float QRhiViewport::maxDepth |
( |
| ) |
const |
|
inline |
- Returns
- the maxDepth value of the depth range of the viewport.
Definition at line 99 of file qrhi.h.
◆ minDepth()
float QRhiViewport::minDepth |
( |
| ) |
const |
|
inline |
- Returns
- the minDepth value of the depth range of the viewport.
Definition at line 96 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 100 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 97 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 92 of file qrhi.h.
◆ viewport()
std::array< float, 4 > QRhiViewport::viewport |
( |
| ) |
const |
|
inline |
- Returns
- the viewport x, y, width, and height.
Definition at line 91 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 114 of file qrhi.h.
◆ operator==
- Returns
true
if the values in the two QRhiViewport objects a and b are equal.
Definition at line 107 of file qrhi.h.
◆ qHash
The documentation for this class was generated from the following files: