Qt OpenGL


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’s update() function to schedule an update.

QOpenGLWidget::update() method
vs.
QGLWidget::updateGL() slot


CMake

Find OpenGL

How to compile GLUT + OpenGL project with CMake and Kdevelop in linux

/c/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/um/x64
GlU32.Lib
OpenGL32.Lib

Incorrect

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets OpenGL OpenGLWidgets REQUIRED)
target_link_libraries(QtOpenGLExample1 PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
cmd.exe /C "cd . && 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 && cd ."

LINK Pass 1: command "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" failed (exit code 1120) with the following output:

renderer.cpp.obj : error LNK2019: unresolved external symbol __imp_glBegin [...]

Correct

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets OpenGLWidgets REQUIRED)
find_package(OpenGL REQUIRED)

target_link_libraries(
	QtOpenGLExample1
	PRIVATE
		Qt${QT_VERSION_MAJOR}::Widgets
		Qt${QT_VERSION_MAJOR}::OpenGLWidgets
		${OPENGL_LIBRARIES}
)
cmd.exe /C "cd . && 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 && cd ."


Tutorials

KDAB

OpenGL in Qt 5.1 – Part 1
OpenGL in Qt 5.1 – Part 2
OpenGL in Qt 5.1 – Part 3
OpenGL in Qt 5.1 – Part 4
Goodbye, Q_FOREACH, A porting guide to C++11 ranged for-loops

Qt Blog

Iterating efficiently

Universität Marburg – Prof. Dr. Thorsten Thormählen

Multimediale Signalverarbeitung (SS 2021)
Grafikprogrammierung (WS 2020/2021)
Technische Informatik (WS 2020/2021)

Multimediale Signalverarbeitung – Bildverarbeitung: Filter
Grafikprogrammierung – Kameras: Perspektivische Projektion
Bildsynthese – Vulkan Ray Tracing Pipeline
LookAtLocalTrans.cpp

Dr. Andreas Nicolai

TU Dresden Dr. Andreas Nicolai
OpenGL + Qt Tutorial
github.com/ghorwin/OpenGLWithQt-Tutorial

Trent Reed

2015
Qt5 OpenGL Part 0: Creating a Window
Qt5 OpenGL Part 1: Basic Rendering
Qt5 OpenGL Part 2: 3D Rendering
Qt5 OpenGL Part 3a : Efficient Input Managers
Qt5 OpenGL Part 3b: Camera Control
Qt5 OpenGL Part 4: Error Checking
Qt5 OpenGL Part 5: Debug Logging

FatalErrors

QT based OpenGL tutorial learning 15 – Geometric shaders
OpenGl L21 geometry shader
OpenGl L11 multi light source
OpenGL learning record 6: advanced lighting (lighting texture & projection
OpenGL with QtWidgets: Material, Lightmap
QT based OpenGL tutorial learning 17 – Implementation of Catmull ROM spline based on geometric shaders

Asia

QT based OpenGL tutorial learning 4 – Camera 2
QT based OpenGL tutorial learning 1 – Supplement
Hello Triangle
github.com/chengxuyuanwangye/LearnOpengl_QT


Qt

Qt5 OpenGL Examples from the Qt OpenGL module
Qt6 OpenGL Examples from the Qt OpenGL module


Wikipedia

Kategorie:Bildsynthese
Culling
Framebuffer Object (FBO)


Khronos

Framebuffer Object
OpenGL Loading Library

Leave a Reply

Your email address will not be published. Required fields are marked *