{"id":10328,"date":"2019-11-13T11:18:03","date_gmt":"2019-11-13T11:18:03","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=10328"},"modified":"2022-02-17T19:54:57","modified_gmt":"2022-02-17T19:54:57","slug":"qt-opengl","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=10328","title":{"rendered":"Qt OpenGL"},"content":{"rendered":"<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>Qt6 Docs<\/h1>\n<p><a href=\"https:\/\/doc.qt.io\/qt-6\/qtopengl-index.html\">Qt OpenGL<\/a><br \/>\n<a href=\"https:\/\/doc.qt.io\/qt-6\/qopenglwidget.html\">QOpenGLWidget Class<\/a><\/p>\n<h3>update() vs. updateGL()<\/h3>\n<blockquote><p>If you need to trigger a repaint from places other than <code>paintGL()<\/code> (a typical example is when using timers to animate scenes), you should call the widget&#8217;s <code>update()<\/code> function to schedule an update.<\/p><\/blockquote>\n<p><code>QOpenGLWidget::update()<\/code> method<br \/>\nvs.<br \/>\n<code>QGLWidget::updateGL()<\/code> slot<\/p>\n<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>CMake<\/h1>\n<h3>Find OpenGL<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/9460242\/how-to-compile-glut-opengl-project-with-cmake-and-kdevelop-in-linux\">How to compile GLUT + OpenGL project with CMake and Kdevelop in linux<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/c\/Program Files (x86)\/Windows Kits\/10\/Lib\/10.0.19041.0\/um\/x64\r\nGlU32.Lib\r\nOpenGL32.Lib\r\n<\/pre>\n<h3>Incorrect<\/h3>\n<pre class=\"brush: plain; title: CMakeLists.txt; notranslate\" title=\"CMakeLists.txt\">\r\nfind_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets OpenGL OpenGLWidgets REQUIRED)\r\ntarget_link_libraries(QtOpenGLExample1 PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::OpenGLWidgets)\r\n<\/pre>\n<pre class=\"brush: plain; title: Result; notranslate\" title=\"Result\">\r\ncmd.exe \/C &quot;cd . &amp;&amp; C:\\Qt\\Tools\\CMake_64\\bin\\cmake.exe -E vs_link_exe --intdir=CMakeFiles\\QtOpenGLExample1.dir --rc=C:\\PROGRA~2\\WI3CF2~1\\10\\bin\\100190~1.0\\x64\\rc.exe --mt=C:\\PROGRA~2\\WI3CF2~1\\10\\bin\\100190~1.0\\x64\\mt.exe --manifests  -- C:\\PROGRA~2\\MICROS~2\\2019\\ENTERP~1\\VC\\Tools\\MSVC\\1429~1.301\\bin\\Hostx64\\x64\\link.exe \/nologo CMakeFiles\\QtOpenGLExample1.dir\\QtOpenGLExample1_autogen\\mocs_compilation.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\main.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\mywidget.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\renderer.cpp.obj  \/out:QtOpenGLExample1.exe \/implib:QtOpenGLExample1.lib \/pdb:QtOpenGLExample1.pdb \/version:0.0 \/machine:x64 \/debug \/INCREMENTAL \/subsystem:console  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLWidgetsd.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Widgetsd.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLd.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Guid.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Cored.lib  mpr.lib  userenv.lib  d3d11.lib  dxgi.lib  dxguid.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib &amp;&amp; cd .&quot;\r\n\r\nLINK Pass 1: command &quot;C:\\PROGRA~2\\MICROS~2\\2019\\ENTERP~1\\VC\\Tools\\MSVC\\1429~1.301\\bin\\Hostx64\\x64\\link.exe \/nologo CMakeFiles\\QtOpenGLExample1.dir\\QtOpenGLExample1_autogen\\mocs_compilation.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\main.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\mywidget.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\renderer.cpp.obj \/out:QtOpenGLExample1.exe \/implib:QtOpenGLExample1.lib \/pdb:QtOpenGLExample1.pdb \/version:0.0 \/machine:x64 \/debug \/INCREMENTAL \/subsystem:console C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLWidgetsd.lib C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Widgetsd.lib C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLd.lib C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Guid.lib C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Cored.lib mpr.lib userenv.lib d3d11.lib dxgi.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib \/MANIFEST \/MANIFESTFILE:CMakeFiles\\QtOpenGLExample1.dir\/intermediate.manifest CMakeFiles\\QtOpenGLExample1.dir\/manifest.res&quot; failed (exit code 1120) with the following output:\r\n\r\nrenderer.cpp.obj : error LNK2019: unresolved external symbol __imp_glBegin &#x5B;...]\r\n<\/pre>\n<h3>Correct<\/h3>\n<pre class=\"brush: plain; title: CMakeLists.txt; notranslate\" title=\"CMakeLists.txt\">\r\nfind_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets OpenGLWidgets REQUIRED)\r\nfind_package(OpenGL REQUIRED)\r\n\r\ntarget_link_libraries(\r\n\tQtOpenGLExample1\r\n\tPRIVATE\r\n\t\tQt${QT_VERSION_MAJOR}::Widgets\r\n\t\tQt${QT_VERSION_MAJOR}::OpenGLWidgets\r\n\t\t${OPENGL_LIBRARIES}\r\n)\r\n<\/pre>\n<pre class=\"brush: plain; title: Result; notranslate\" title=\"Result\">\r\ncmd.exe \/C &quot;cd . &amp;&amp; C:\\Qt\\Tools\\CMake_64\\bin\\cmake.exe -E vs_link_exe --intdir=CMakeFiles\\QtOpenGLExample1.dir --rc=C:\\PROGRA~2\\WI3CF2~1\\10\\bin\\100190~1.0\\x64\\rc.exe --mt=C:\\PROGRA~2\\WI3CF2~1\\10\\bin\\100190~1.0\\x64\\mt.exe --manifests  -- C:\\PROGRA~2\\MICROS~2\\2019\\ENTERP~1\\VC\\Tools\\MSVC\\1429~1.301\\bin\\Hostx64\\x64\\link.exe \/nologo CMakeFiles\\QtOpenGLExample1.dir\\QtOpenGLExample1_autogen\\mocs_compilation.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\main.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\mywidget.cpp.obj CMakeFiles\\QtOpenGLExample1.dir\\renderer.cpp.obj  \/out:QtOpenGLExample1.exe \/implib:QtOpenGLExample1.lib \/pdb:QtOpenGLExample1.pdb \/version:0.0 \/machine:x64 \/debug \/INCREMENTAL \/subsystem:console  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLWidgetsd.lib  opengl32.lib  glu32.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Widgetsd.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6OpenGLd.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Guid.lib  C:\\Qt\\6.2.1\\msvc2019_64\\lib\\Qt6Cored.lib  mpr.lib  userenv.lib  d3d11.lib  dxgi.lib  dxguid.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib &amp;&amp; cd .&quot;\r\n<\/pre>\n<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>Tutorials<\/h1>\n<h3>KDAB<\/h3>\n<p><a href=\"https:\/\/www.kdab.com\/opengl-in-qt-5-1-part-1\/\">OpenGL in Qt 5.1 \u2013 Part 1<\/a><br \/>\n<a href=\"https:\/\/www.kdab.com\/opengl-in-qt-5-1-part-2\/\">OpenGL in Qt 5.1 \u2013 Part 2<\/a><br \/>\n<a href=\"https:\/\/www.kdab.com\/opengl-in-qt-5-1-part-3\/\">OpenGL in Qt 5.1 \u2013 Part 3<\/a><br \/>\n<a href=\"https:\/\/www.kdab.com\/opengl-in-qt-5-1-part-4\/\">OpenGL in Qt 5.1 \u2013 Part 4<\/a><br \/>\n<a href=\"https:\/\/www.kdab.com\/goodbye-q_foreach\/\">Goodbye, Q_FOREACH<\/a>, A porting guide to C++11 ranged for-loops<\/p>\n<h3>Qt Blog<\/h4>\n<p><a href=\"https:\/\/www.qt.io\/blog\/2009\/01\/23\/iterating-efficiently\">Iterating efficiently<\/a><\/p>\n<h3>Universit\u00e4t Marburg &#8211; Prof. Dr. Thorsten Thorm\u00e4hlen<\/h3>\n<p><a href=\"https:\/\/www.uni-marburg.de\/de\/fb12\/arbeitsgruppen\/grafikmultimedia\/lehre\/mmk\">Multimediale Signalverarbeitung (SS 2021)<\/a><br \/>\n<a href=\"https:\/\/www.uni-marburg.de\/de\/fb12\/arbeitsgruppen\/grafikmultimedia\/lehre\/grafik\">Grafikprogrammierung (WS 2020\/2021)<\/a><br \/>\n<a href=\"https:\/\/www.uni-marburg.de\/de\/fb12\/arbeitsgruppen\/grafikmultimedia\/lehre\/ti\">Technische Informatik (WS 2020\/2021)<\/a><\/p>\n<p><a href=\"https:\/\/www.mathematik.uni-marburg.de\/~thormae\/lectures\/mmk\/mmk_6_1_ger_web.html\">Multimediale Signalverarbeitung &#8211; Bildverarbeitung: Filter<\/a><br \/>\n<a href=\"https:\/\/www.mathematik.uni-marburg.de\/~thormae\/lectures\/graphics1\/graphics_6_1_ger_web.html\">Grafikprogrammierung &#8211; Kameras: Perspektivische Projektion<\/a><br \/>\n<a href=\"https:\/\/www.mathematik.uni-marburg.de\/~thormae\/lectures\/graphics2\/graphics_3_1_ger_web.html#1\">Bildsynthese &#8211; Vulkan Ray Tracing Pipeline<\/a><br \/>\n<a href=\"https:\/\/www.mathematik.uni-marburg.de\/~thormae\/lectures\/graphics1\/code_v2\/LookAtLocalTrans\/qt\/LookAtLocalTrans.cpp\">LookAtLocalTrans.cpp<\/a><\/p>\n<h3>Dr. Andreas Nicolai<\/h3>\n<p><a href=\"https:\/\/tu-dresden.de\/bu\/architektur\/ibk\/das-institut\/beschaeftigte\/andreas-nicolai\">TU Dresden Dr. Andreas Nicolai<\/a><br \/>\n<a href=\"https:\/\/ghorwin.github.io\/OpenGLWithQt-Tutorial\/\">OpenGL + Qt Tutorial<\/a><br \/>\n<a href=\"https:\/\/github.com\/ghorwin\/OpenGLWithQt-Tutorial\">github.com\/ghorwin\/OpenGLWithQt-Tutorial<\/a><\/p>\n<h3>Trent Reed<\/h3>\n<p>2015<br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-0-creating-a-window\/\">Qt5 OpenGL Part 0: Creating a Window<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-1-basic-rendering\/\">Qt5 OpenGL Part 1: Basic Rendering<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-2-3d-rendering\/\">Qt5 OpenGL Part 2: 3D Rendering<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-3a-efficient-input-managers\/\">Qt5 OpenGL Part 3a : Efficient Input Managers<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-3b-camera-control\/\">Qt5 OpenGL Part 3b: Camera Control<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-4-error-checking\/\">Qt5 OpenGL Part 4: Error Checking<\/a><br \/>\n<a href=\"https:\/\/www.trentreed.net\/blog\/qt5-opengl-part-5-debug-logging\/\">Qt5 OpenGL Part 5: Debug Logging<\/a><\/p>\n<h3>FatalErrors<\/h3>\n<p><a href=\"https:\/\/www.fatalerrors.org\/a\/qt-based-opengl-tutorial-learning-15-geometric-shaders.html\">QT based OpenGL tutorial learning 15 &#8211; Geometric shaders<\/a><br \/>\n<a href=\"https:\/\/www.fatalerrors.org\/a\/opengl-l21-geometry-shader.html\">OpenGl L21 geometry shader<\/a><br \/>\n<a href=\"https:\/\/www.fatalerrors.org\/a\/opengl-l11-multi-light-source.html\">OpenGl L11 multi light source<\/a><br \/>\n<a href=\"https:\/\/www.fatalerrors.org\/a\/opengl-learning-record-6-advanced-lighting-lighting-texture-projection.html\">OpenGL learning record 6: advanced lighting (lighting texture &#038; projection<\/a><br \/>\n<a href=\"https:\/\/www.fatalerrors.org\/a\/opengl-with-qtwidgets-material-lightmap.html\">OpenGL with QtWidgets: Material, Lightmap<\/a><br \/>\n<a href=\"https:\/\/www.fatalerrors.org\/a\/0dlz1jk.html\">QT based OpenGL tutorial learning 17 &#8211; Implementation of Catmull ROM spline based on geometric shaders<\/a><\/p>\n<h3>Asia<\/h3>\n<p><a href=\"https:\/\/chowdera.com\/2021\/01\/20210103171711766d.html\">QT based OpenGL tutorial learning 4 &#8211; Camera 2<\/a><br \/>\n<a href=\"https:\/\/chowdera.com\/2020\/12\/20201231110750279I.html\">QT based OpenGL tutorial learning 1 &#8211; Supplement<\/a><br \/>\n<a href=\"https:\/\/www.jianshu.com\/p\/bccc565b5248\">Hello Triangle<\/a><br \/>\n<a href=\"https:\/\/github.com\/chengxuyuanwangye\/LearnOpengl_QT\">github.com\/chengxuyuanwangye\/LearnOpengl_QT<\/a><\/p>\n<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>Qt<\/h1>\n<p><a href=\"https:\/\/doc.qt.io\/qt-5\/examples-widgets-opengl.html\">Qt5 OpenGL Examples from the Qt OpenGL module<\/a><br \/>\n<a href=\"https:\/\/doc.qt.io\/qt-6\/examples-widgets-opengl.html\">Qt6 OpenGL Examples from the Qt OpenGL module<\/a><\/p>\n<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>Wikipedia<\/h1>\n<p><a href=\"https:\/\/de.wikipedia.org\/wiki\/Kategorie:Bildsynthese\">Kategorie:Bildsynthese<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Culling\">Culling<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Framebuffer_Object\">Framebuffer Object (FBO)<\/a><\/p>\n<p><!-- ----------------------------------------------------------------------------- --><\/p>\n<hr\/>\n<h1>Khronos<\/h1>\n<p><a href=\"https:\/\/www.khronos.org\/opengl\/wiki\/Framebuffer_Object\">Framebuffer Object<\/a><br \/>\n<a href=\"https:\/\/www.khronos.org\/opengl\/wiki\/OpenGL_Loading_Library\">OpenGL Loading Library<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Qt6 Docs Qt OpenGL QOpenGLWidget Class update() vs. updateGL() If you need to trigger a repaint from places other than paintGL() (a typical example is when using timers to animate scenes), you should call the widget&#8217;s update() function to schedule an update. QOpenGLWidget::update() method vs. QGLWidget::updateGL() slot CMake Find OpenGL How to compile GLUT + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10328","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10328"}],"version-history":[{"count":10,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10328\/revisions"}],"predecessor-version":[{"id":13018,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10328\/revisions\/13018"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}