diff options
Diffstat (limited to 'src/render/renderstates/qalphatest.cpp')
-rw-r--r-- | src/render/renderstates/qalphatest.cpp | 98 |
1 files changed, 74 insertions, 24 deletions
diff --git a/src/render/renderstates/qalphatest.cpp b/src/render/renderstates/qalphatest.cpp index 2341c1039..81227d499 100644 --- a/src/render/renderstates/qalphatest.cpp +++ b/src/render/renderstates/qalphatest.cpp @@ -38,17 +38,6 @@ ** ****************************************************************************/ -/*! - * \class QAlphaTest - * \brief The QAlphaTest class is an OpenGL helper. - * \since 5.7 - * \ingroup renderstates - * - * As the OpenGL documentation explains; The alpha test discards a fragment - * conditional on the outcome of a comparison between the incoming fragment's - * alpha value and a constant value. - */ - #include "qalphatest.h" #include "qalphatest_p.h" #include <Qt3DRender/private/qrenderstatecreatedchange_p.h> @@ -57,6 +46,80 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + \class Qt3DRender::QAlphaTest + \brief The QAlphaTest class specify alpha reference test + \since 5.7 + \inmodule Qt3DRender + \ingroup renderstates + + As the OpenGL documentation explains; The alpha test discards a fragment + conditional on the outcome of a comparison between the incoming fragment's + alpha value and a constant reference value. + */ + +/*! + \qmltype AlphaTest + \brief The AlphaTest class specify alpha reference test + \since 5.7 + \inqmlmodule Qt3D.Render + \inherits RenderState + \instantiates Qt3DRender::QAlphaTest + \ingroup renderstates + + As the OpenGL documentation explains; The alpha test discards a fragment + conditional on the outcome of a comparison between the incoming fragment's + alpha value and a constant reference value. + */ + +/*! + \enum Qt3DRender::QAlphaTest::AlphaFunction + + Enumeration for the alpha function values + \value Never Never pass alpha test + \value Always Always pass alpha test + \value Less Pass alpha test if fragment alpha is less than reference value + \value LessOrEqual Pass alpha test if fragment alpha is less than or equal to reference value + \value Equal Pass alpha test if fragment alpha is equal to reference value + \value GreaterOrEqual Pass alpha test if fragment alpha is greater than or equal to reference value + \value Greater Pass alpha test if fragment alpha is greater than reference value + \value NotEqual Pass alpha test if fragment alpha is not equal to reference value +*/ + +/*! + \qmlproperty enumeration AlphaTest::alphaFunction + Holds the alpha function used by the alpha test. Default is AlphaTest.Never. + \list + \li AlphaTest.Never + \li AlphaTest.Always + \li AlphaTest.Less + \li AlphaTest.LessOrEqual + \li AlphaTest.Equal + \li AlphaTest.GreaterOrEqual + \li AlphaTest.Greater + \li AlphaTest.NotEqual + \endlist + \sa Qt3DRender::QAlphaTest::AlphaFunction +*/ + +/*! + \qmlproperty real AlphaTest::referenceValue + Holds the reference value used by the alpha test. Default is 0.0. + When set, the value is clamped between 0 and 1. +*/ + +/*! + \property QAlphaTest::alphaFunction + Holds the alpha function used by the alpha test. Default is Never. +*/ + +/*! + \property QAlphaTest::referenceValue + Holds the reference value used by the alpha test. Default is 0.0. + When set, the value is clamped between 0 and 1. +*/ + + QAlphaTest::QAlphaTest(QNode *parent) : QRenderState(*new QAlphaTestPrivate, parent) { @@ -67,19 +130,12 @@ QAlphaTest::~QAlphaTest() { } -/*! - * \return the current alpha test function. - */ QAlphaTest::AlphaFunction QAlphaTest::alphaFunction() const { Q_D(const QAlphaTest); return d->m_alphaFunction; } -/*! - * Sets the alpha test function to \a alphaFunction. - * \param alphaFunction - */ void QAlphaTest::setAlphaFunction(QAlphaTest::AlphaFunction alphaFunction) { Q_D(QAlphaTest); @@ -89,18 +145,12 @@ void QAlphaTest::setAlphaFunction(QAlphaTest::AlphaFunction alphaFunction) } } -/*! - * \return a float value between 0 and 1. - */ float QAlphaTest::referenceValue() const { Q_D(const QAlphaTest); return d->m_referenceValue; } -/*! - * Sets the reference value which is clamped between 0 and 1 to \a referenceValue. - */ void QAlphaTest::setReferenceValue(float referenceValue) { Q_D(QAlphaTest); |