QRhiViewport Class
Especifica un rectángulo de vista. Más...
| Cabecera: | #include <rhi/qrhi.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
| qmake: | QT += gui-private |
| Desde: | Qt 6.6 |
Funciones Públicas
| 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 |
No miembros relacionados
| 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) |
Descripción detallada
Usado con QRhiCommandBuffer::setViewport().
QRhi asume coordenadas de vista estilo OpenGL, lo que significa que x e y están en la parte inferior izquierda. No se permiten anchuras o alturas negativas.
El uso típico es como el siguiente:
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); // ...
Nota: Se trata de una API RHI con garantías de compatibilidad limitadas, véase QRhi para más detalles.
Véase también QRhiCommandBuffer::setViewport(), QRhi::clipSpaceCorrMatrix(), y QRhiScissor.
Documentación de las funciones miembro
[constexpr noexcept] QRhiViewport::QRhiViewport()
Construye una descripción de vista con un rectángulo vacío y un rango de profundidad de 0.0f - 1.0f.
Véase también QRhi::clipSpaceCorrMatrix().
QRhiViewport::QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f)
Construye una descripción de vista con el rectángulo especificado por x, y, w, h y el rango de profundidad minDepth y maxDepth.
Nota: Se asume quex y y son la posición inferior izquierda. w y h no deben ser negativos, de lo contrario la ventana gráfica será ignorada por QRhiCommandBuffer::setViewport().
Véase también QRhi::clipSpaceCorrMatrix().
float QRhiViewport::maxDepth() const
Devuelve el valor maxDepth del rango de profundidad de la ventana gráfica.
Véase también setMaxDepth().
float QRhiViewport::minDepth() const
Devuelve el valor minDepth del rango de profundidad de la ventana gráfica.
Véase también setMinDepth().
void QRhiViewport::setMaxDepth(float maxDepth)
Establece el maxDepth del rango de profundidad de la ventana gráfica. Por defecto se establece en 1.0f.
Véase también maxDepth().
void QRhiViewport::setMinDepth(float minDepth)
Establece el minDepth del rango de profundidad de la ventana gráfica. Por defecto se establece en 0.0f.
Véase también minDepth().
void QRhiViewport::setViewport(float x, float y, float w, float h)
Establece la posición y el tamaño de la ventana gráfica en x, y, w, y h.
Nota: Las ventanas gráficas se especifican en un sistema de coordenadas que tiene su origen en la parte inferior izquierda.
Véase también viewport().
std::array<float, 4> QRhiViewport::viewport() const
Devuelve la vista x, y, anchura y altura.
Véase también setViewport().
No miembros relacionados
[noexcept] size_t qHash(const QRhiViewport &key, size_t seed = 0)
Devuelve el valor hash para key, utilizando seed para sembrar el cálculo.
[noexcept] bool operator!=(const QRhiViewport &a, const QRhiViewport &b)
Devuelve false si los valores de los dos objetos QRhiViewport a y b son iguales; en caso contrario devuelve true.
[noexcept] bool operator==(const QRhiViewport &a, const QRhiViewport &b)
Devuelve true si los valores de los dos objetos QRhiViewport a y b son iguales.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.