<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qrenderstateset.cpp --> <title>QRenderStateSet Class | Qt 3D 5.11</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qt3d-index.html">Qt 3D</a></td><td ><a href="qt3d-cpp.html">C++ Classes</a></td><td >QRenderStateSet</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QRenderStateSet Class</h1> <span class="small-subtitle">(<a href="qt3drender-qrenderstateset.html">Qt3DRender::QRenderStateSet</a>)<br/></span> <!-- $$$QRenderStateSet-brief --> <p>The <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> <a href="qt3drender-qframegraphnode.html">FrameGraph</a> node offers a way of specifying a set of <a href="qt3drender-qrenderstate.html">QRenderState</a> objects to be applied during the execution of a framegraph branch. <a href="#details">More...</a></p> <!-- @@@QRenderStateSet --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QRenderStateSet></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += 3drender</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.5</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qt3d-render-renderstateset.html">RenderStateSet</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qt3drender-qframegraphnode.html">Qt3DRender::QFrameGraphNode</a></td></tr></table></div><ul> <li><a href="qt3drender-qrenderstateset-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qrenderstateset.html#QRenderStateSet">QRenderStateSet</a></b>(Qt3DCore::QNode *<i>parent</i> = nullptr)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qrenderstateset.html#addRenderState">addRenderState</a></b>(Qt3DRender::QRenderState *<i>state</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qrenderstateset.html#removeRenderState">removeRenderState</a></b>(Qt3DRender::QRenderState *<i>state</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVector<Qt3DRender::QRenderState *> </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qrenderstateset.html#renderStates">renderStates</a></b>() const</td></tr> </table></div> <ul> <li class="fn">1 public function inherited from <a href="qt3drender-qframegraphnode.html#public-functions">Qt3DRender::QFrameGraphNode</a></li> <li class="fn">13 public functions inherited from <a href="qt3dcore-qnode.html#public-functions">Qt3DCore::QNode</a></li> <li class="fn">34 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li> </ul> <a name="protected-functions"></a> <h2 id="protected-functions">Protected Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qrenderstateset.html#QRenderStateSet-1">QRenderStateSet</a></b>(Qt3DRender::QRenderStateSetPrivate &<i>dd</i>, Qt3DCore::QNode *<i>parent</i> = nullptr)</td></tr> </table></div> <ul> <li class="fn">1 protected function inherited from <a href="qt3drender-qframegraphnode.html#protected-functions">Qt3DRender::QFrameGraphNode</a></li> <li class="fn">2 protected functions inherited from <a href="qt3dcore-qnode.html#protected-functions">Qt3DCore::QNode</a></li> <li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">3 properties inherited from <a href="qt3dcore-qnode.html#properties">Qt3DCore::QNode</a></li> <li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li> <li class="fn">3 public slots inherited from <a href="qt3dcore-qnode.html#public-slots">Qt3DCore::QNode</a></li> <li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li> <li class="fn">4 signals inherited from <a href="qt3dcore-qnode.html#signals">Qt3DCore::QNode</a></li> <li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li> <li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li> <li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li> <li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li> </ul> <a name="details"></a> <!-- $$$QRenderStateSet-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> <a href="qt3drender-qframegraphnode.html">FrameGraph</a> node offers a way of specifying a set of <a href="qt3drender-qrenderstate.html">QRenderState</a> objects to be applied during the execution of a framegraph branch.</p> <p>States set on a <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> are set globally, contrary to the per-material states that can be set on a <a href="qt3drender-qrenderpass.html">QRenderPass</a>. By default, an empty <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> will result in all render states being disabled when executed. Adding a <a href="qt3drender-qrenderstate.html">QRenderState</a> state explicitly enables that render state at runtime.</p> <p>The <a href="qml-qt3d-render-renderstateset.html">RenderStateSet</a> is enabled when added to the active frame graph:</p> <pre class="cpp"> <span class="comment">// using namespace Qt3DRender;</span> <span class="type">Qt3DCore</span><span class="operator">::</span><span class="type">QEntity</span> <span class="operator">*</span>rootEntity <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Qt3DCore</span><span class="operator">::</span><span class="type">QEntity</span>(); <span class="type"><a href="qt3drender-qrendersettings.html">QRenderSettings</a></span> <span class="operator">*</span>renderSettings <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qrendersettings.html">QRenderSettings</a></span>(); <span class="type"><a href="qt3drender-qviewport.html">QViewport</a></span> <span class="operator">*</span>viewport <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qviewport.html">QViewport</a></span>(); <span class="type"><a href="qt3drender-qcameraselector.html">QCameraSelector</a></span> <span class="operator">*</span>cameraSelector <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qcameraselector.html">QCameraSelector</a></span>(viewport); <span class="type"><a href="qt3drender-qclearbuffers.html">QClearBuffers</a></span> <span class="operator">*</span>clearBuffers <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qclearbuffers.html">QClearBuffers</a></span>(cameraSelector); clearBuffers<span class="operator">-</span><span class="operator">></span>setBuffers(<span class="type"><a href="qt3drender-qclearbuffers.html">QClearBuffers</a></span><span class="operator">::</span>ColorDepthBuffer); <span class="type"><a href="qt3drender-qrenderstateset.html#QRenderStateSet">QRenderStateSet</a></span> <span class="operator">*</span>renderStateSet <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qrenderstateset.html#QRenderStateSet">QRenderStateSet</a></span>(cameraSelector); <span class="type"><a href="qt3drender-qcullface.html">QCullFace</a></span> <span class="operator">*</span>cullFace <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qt3drender-qcullface.html">QCullFace</a></span>(renderStateSet); cullFace<span class="operator">-</span><span class="operator">></span>setMode(<span class="type"><a href="qt3drender-qcullface.html">QCullFace</a></span><span class="operator">::</span>Front); renderStateSet<span class="operator">-</span><span class="operator">></span>addRenderState(cullFace); renderSettings<span class="operator">-</span><span class="operator">></span>setActiveFrameGraph(viewport); rootEntity<span class="operator">-</span><span class="operator">></span>addComponent(renderSettings); </pre> </div> <p><b>See also </b><a href="qt3drender-qrenderstate.html">QRenderState</a> and <a href="qt3drender-qrenderpass.html">QRenderPass</a>.</p> <!-- @@@QRenderStateSet --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QRenderStateSet[overload1]$$$QRenderStateSetQt3DCore::QNode* --> <h3 class="fn" id="QRenderStateSet"><a name="QRenderStateSet"></a>QRenderStateSet::<span class="name">QRenderStateSet</span>(<span class="type">Qt3DCore::QNode</span> *<i>parent</i> = nullptr)</h3> <p>Default constructs an instance of QRenderStateSet.</p><!-- @@@QRenderStateSet --> <!-- $$$QRenderStateSet$$$QRenderStateSetQt3DRender::QRenderStateSetPrivate&Qt3DCore::QNode* --> <h3 class="fn" id="QRenderStateSet-1"><a name="QRenderStateSet-1"></a><code>[protected] </code>QRenderStateSet::<span class="name">QRenderStateSet</span>(<span class="type">Qt3DRender::QRenderStateSetPrivate</span> &<i>dd</i>, <span class="type">Qt3DCore::QNode</span> *<i>parent</i> = nullptr)</h3> <p>Default constructs an instance of QRenderStateSet.</p><!-- @@@QRenderStateSet --> <!-- $$$addRenderState[overload1]$$$addRenderStateQt3DRender::QRenderState* --> <h3 class="fn" id="addRenderState"><a name="addRenderState"></a><span class="type">void</span> QRenderStateSet::<span class="name">addRenderState</span>(<span class="type">Qt3DRender::QRenderState</span> *<i>state</i>)</h3> <p>Adds a new <a href="qt3drender-qrenderstate.html">QRenderState</a> <i>state</i> to the <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> instance.</p> <p><b>Note: </b>Not setting any <a href="qt3drender-qrenderstate.html">QRenderState</a> state on a <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> instance implies all the render states will be disabled at render time.</p><!-- @@@addRenderState --> <!-- $$$removeRenderState[overload1]$$$removeRenderStateQt3DRender::QRenderState* --> <h3 class="fn" id="removeRenderState"><a name="removeRenderState"></a><span class="type">void</span> QRenderStateSet::<span class="name">removeRenderState</span>(<span class="type">Qt3DRender::QRenderState</span> *<i>state</i>)</h3> <p>Removes the <a href="qt3drender-qrenderstate.html">QRenderState</a> <i>state</i> from the <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> instance.</p> <!-- @@@removeRenderState --> <!-- $$$renderStates[overload1]$$$renderStates --> <h3 class="fn" id="renderStates"><a name="renderStates"></a><span class="type"><a href="../qtcore/qvector.html">QVector</a></span><<span class="type">Qt3DRender::QRenderState</span> *> QRenderStateSet::<span class="name">renderStates</span>() const</h3> <p>Returns the list of <a href="qt3drender-qrenderstate.html">QRenderState</a> objects that compose the <a href="qt3drender-qrenderstateset.html">QRenderStateSet</a> instance.</p> <!-- @@@renderStates --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> 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. </p> </div> </body> </html>