summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-05-20 11:53:59 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2016-05-26 05:49:23 +0000
commitae1de9d941e2b73be0f2023f9cb18ca2d3424666 (patch)
tree12c0159aa5fc2f871ed57a17f81c3d7494daaf59 /src
parenta9026a33678b6843036a45c84157d81876a43750 (diff)
Adding QDoc to QPolygonOffset
Adding documentation to aid in the explanation of how to use QPolygonOffset and its general relation to OpenGL Change-Id: I7898993bd70afed05eae9b29c69c5b2fe368d2f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/renderstates/qpolygonoffset.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/render/renderstates/qpolygonoffset.cpp b/src/render/renderstates/qpolygonoffset.cpp
index b71e803fd..d9703ab4b 100644
--- a/src/render/renderstates/qpolygonoffset.cpp
+++ b/src/render/renderstates/qpolygonoffset.cpp
@@ -37,6 +37,14 @@
**
****************************************************************************/
+/*!
+ * \class QPolygonOffset
+ * \brief The QPolygonOffset class sets the scale and steps to calculate depth
+ * values for polygon offsets.
+ * \since 5.7
+ * \ingroup renderstates
+ *
+ */
#include "qpolygonoffset.h"
#include "qpolygonoffset_p.h"
#include <Qt3DRender/private/qrenderstatecreatedchange_p.h>
@@ -45,6 +53,10 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
+/*!
+ * The constructor creates a new QPolygonOffset::QPolygonOffset instance
+ * with the specified \a parent
+ */
QPolygonOffset::QPolygonOffset(QNode *parent)
: QRenderState(*new QPolygonOffsetPrivate, parent)
{
@@ -55,12 +67,20 @@ QPolygonOffset::~QPolygonOffset()
{
}
+/*!
+ * \return the current scale factor.
+ */
float QPolygonOffset::scaleFactor() const
{
Q_D(const QPolygonOffset);
return d->m_scaleFactor;
}
+/*!
+ * Sets the scale factor used to create a variable depth offset for
+ * each polygon, to \a scaleFactor. Default value is 0.
+ * \param scaleFactor
+ */
void QPolygonOffset::setScaleFactor(float scaleFactor)
{
Q_D(QPolygonOffset);
@@ -70,12 +90,19 @@ void QPolygonOffset::setScaleFactor(float scaleFactor)
}
}
+/*!
+ * \return the current depth steps.
+ */
float QPolygonOffset::depthSteps() const
{
Q_D(const QPolygonOffset);
return d->m_depthSteps;
}
+/*!
+ * Sets the units that create constant depth offsets, to depthSteps.
+ * \param depthSteps
+ */
void QPolygonOffset::setDepthSteps(float depthSteps)
{
Q_D(QPolygonOffset);