本页内容

QRhiDepthStencilClearValue 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

公共函数

QRhiDepthStencilClearValue()
QRhiDepthStencilClearValue(float d, quint32 s)
float depthClearValue() const
void setDepthClearValue(float d)
void setStencilClearValue(quint32 s)
quint32 stencilClearValue() const
size_t qHash(const QRhiDepthStencilClearValue &key, size_t seed = 0)
bool operator!=(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b)
bool operator==(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b)

详细说明

注意:这是一个 RHI API,兼容性保证有限,详情请参见QRhi 。

成员函数文档

[constexpr noexcept default] QRhiDepthStencilClearValue::QRhiDepthStencilClearValue()

构建一个深度/模板清除值,其中深度清除值为 1.0f,模板清除值为 0.

QRhiDepthStencilClearValue::QRhiDepthStencilClearValue(float d, quint32 s)

根据深度清除值d 和模板清除值s ,构建一个深度/模板清除值。

float QRhiDepthStencilClearValue::depthClearValue() const

返回深度清除值。在大多数情况下,该值为 1.0f。

另请参阅 setDepthClearValue()。

void QRhiDepthStencilClearValue::setDepthClearValue(float d)

将深度清除值设置为d 。

另请参阅 depthClearValue()。

void QRhiDepthStencilClearValue::setStencilClearValue(quint32 s)

将模板清除值设置为s 。

另请参阅 stencilClearValue()。

quint32 QRhiDepthStencilClearValue::stencilClearValue() const

返回模板清除值。在大多数情况下,该值为 0。

另请参阅 setStencilClearValue()。

相关的非成员函数

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

返回key 的哈希值,并使用seed 作为计算的种子。

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

如果两个QRhiDepthStencilClearValue 对象a 和b 中的值相等,则返回false ;否则返回true 。

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

如果两个QRhiDepthStencilClearValue 对象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.