<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- hellovulkancubes.qdoc --> <title>Hello Vulkan Cubes Example | Qt GUI 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="qtgui-index.html">Qt GUI</a></td><td >Hello Vulkan Cubes Example</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="#running-the-example">Running the Example</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Hello Vulkan Cubes Example</h1> <span class="subtitle"></span> <!-- $$$hellovulkancubes-brief --> <p>Shows the basics of using <a href="qvulkanwindow.html">QVulkanWindow</a>.</p> <!-- @@@hellovulkancubes --> <!-- $$$hellovulkancubes-description --> <div class="descr"> <a name="details"></a> <p>The <i>Hello Vulkan Cubes Example</i> shows more advanced usage of <a href="qvulkanwindow.html">QVulkanWindow</a>.</p> <p class="centerAlign"><img src="images/hellovulkancubes.png" alt="" /></p><p>In this example there is a mesh loaded from a file and two different materials and corresponding graphics pipelines. The rounded cubes are drawn using instancing and feature a Phong lighting model with a single directional light.</p> <p>Unlike hellovulkantexture and hellovulkantriangle, the uniform buffer handling takes an alternative approach here: dynamic uniform buffers are used instead of multiple descriptor sets.</p> <p>The example requires QtConcurrent since it demonstrates simple usage of QtConcurrent::run(), <a href="../qtcore/qfuture.html">QFuture</a>, and <a href="../qtcore/qfuturewatcher.html">QFutureWatcher</a> in combination of <a href="qvulkanwindow.html">QVulkanWindow</a>. Mesh and shader data loading, the potentially expensive graphics pipeline construction, and the building of the frame command buffer are all done in separate worker threads.</p> <p>The scene is embedded into a widget-based user interface. The <a href="qvulkanwindow.html">QVulkanWindow</a> subclass handles mouse and keyboard input as well since it provides a first-person style camera in order to allow moving around in the scene.</p> <a name="running-the-example"></a> <h2 id="running-the-example">Running the Example</h2> <p>To run the example from <a href="http://doc.qt.io/qtcreator/index.html">Qt Creator</a>, open the <b>Welcome</b> mode and select the example from <b>Examples</b>. For more information, visit <a href="http://doc.qt.io/qtcreator/creator-build-example-application.html">Building and Running an Example</a>.</p> <p>Files:</p> <ul> <li><a href="qtgui-hellovulkancubes-camera-cpp.html">hellovulkancubes/camera.cpp</a></li> <li><a href="qtgui-hellovulkancubes-camera-h.html">hellovulkancubes/camera.h</a></li> <li><a href="qtgui-hellovulkancubes-hellovulkancubes-pro.html">hellovulkancubes/hellovulkancubes.pro</a></li> <li><a href="qtgui-hellovulkancubes-hellovulkancubes-qrc.html">hellovulkancubes/hellovulkancubes.qrc</a></li> <li><a href="qtgui-hellovulkancubes-main-cpp.html">hellovulkancubes/main.cpp</a></li> <li><a href="qtgui-hellovulkancubes-mainwindow-cpp.html">hellovulkancubes/mainwindow.cpp</a></li> <li><a href="qtgui-hellovulkancubes-mainwindow-h.html">hellovulkancubes/mainwindow.h</a></li> <li><a href="qtgui-hellovulkancubes-mesh-cpp.html">hellovulkancubes/mesh.cpp</a></li> <li><a href="qtgui-hellovulkancubes-mesh-h.html">hellovulkancubes/mesh.h</a></li> <li><a href="qtgui-hellovulkancubes-renderer-cpp.html">hellovulkancubes/renderer.cpp</a></li> <li><a href="qtgui-hellovulkancubes-renderer-h.html">hellovulkancubes/renderer.h</a></li> <li><a href="qtgui-hellovulkancubes-shader-cpp.html">hellovulkancubes/shader.cpp</a></li> <li><a href="qtgui-hellovulkancubes-shader-h.html">hellovulkancubes/shader.h</a></li> <li><a href="qtgui-hellovulkancubes-vulkanwindow-cpp.html">hellovulkancubes/vulkanwindow.cpp</a></li> <li><a href="qtgui-hellovulkancubes-vulkanwindow-h.html">hellovulkancubes/vulkanwindow.h</a></li> </ul> </div> <!-- @@@hellovulkancubes --> </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>