이 페이지에서

QRhiViewport Class

뷰포트 사각형을 지정합니다. 더 보기...

헤더: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
다음부터: Qt 6.6부터

공개 함수

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
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)

상세 설명

QRhiCommandBuffer::setViewport()와 함께 사용됩니다.

QRhi OpenGL 스타일의 뷰포트 좌표를 가정하며, x와 y는 왼쪽 하단을 기준으로 합니다. 음수의 너비나 높이는 허용되지 않습니다.

일반적인 사용법은 다음과 같습니다:

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);
// ...

참고: 이 함수는 호환성이 제한적으로 보장되는 RHI API입니다. 자세한 내용은 QRhi 을 참조하십시오.

QRhiCommandBuffer::setViewport(), QRhi::clipSpaceCorrMatrix() 및 QRhiScissor도 참조하십시오 .

멤버 함수 문서

[constexpr noexcept default] QRhiViewport::QRhiViewport()

빈 사각형과 0.0f ~ 1.0f의 깊이 범위를 갖는 뷰포트 설명을 생성합니다.

QRhi::clipSpaceCorrMatrix()도 참조하십시오 .

QRhiViewport::QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f)

x, y, w, h 로 지정된 사각형과 minDepth, maxDepth 로 지정된 깊이 범위를 사용하여 뷰포트 설명을 생성합니다.

참고: x 및 y 은 왼쪽 하단 위치를 기준으로 합니다. w 및 h 은 음수가 되어서는 안 되며, 그렇지 않을 경우 QRhiCommandBuffer::setViewport()에 의해 뷰포트가 무시됩니다.

QRhi::clipSpaceCorrMatrix()도 참조하십시오 .

float QRhiViewport::maxDepth() const

뷰포트의 깊이 범위에 대한 maxDepth 값을 반환합니다.

setMaxDepth()도 참조하십시오 .

float QRhiViewport::minDepth() const

뷰포트의 깊이 범위에 대한 minDepth 값을 반환합니다.

setMinDepth()도 참조하십시오 .

void QRhiViewport::setMaxDepth(float maxDepth)

뷰포트의 깊이 범위 maxDepth 를 설정합니다. 기본적으로 이 값은 1.0f로 설정됩니다.

maxDepth()도 참조하십시오 .

void QRhiViewport::setMinDepth(float minDepth)

뷰포트의 깊이 범위( minDepth )를 설정합니다. 기본적으로 이 값은 0.0f로 설정되어 있습니다.

minDepth()도 참조하십시오 .

void QRhiViewport::setViewport(float x, float y, float w, float h)

뷰포트의 위치와 크기를 x, y, w, h 로 설정합니다.

참고: 뷰포트는 좌하단을 원점으로 하는 좌표계에서 지정됩니다.

viewport()도 참조하십시오 .

std::array<float, 4> QRhiViewport::viewport() const

뷰포트의 x, y, 너비 및 높이를 반환합니다.

setViewport()도 참조하십시오 .

관련 비회원

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

seed 를 계산의 시드로 사용하여 key 에 대한 해시 값을 반환합니다.

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

두 개의 ` QRhiViewport ` 객체 a 와 ` b `의 값이 같으면 ` false `를 반환하고, 그렇지 않으면 ` true`를 반환합니다.

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

두 개의 ` QRhiViewport ` 객체 a 와 b 의 값이 같을 경우 ` true `를 반환합니다.

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