Qml Gridview implement in OpenGL
-
Hi everyone :
My project is using the Qt5.11 GridView, SwipeView to create some User interface base on QML, but the GridView is not very smooth as I want, right now I try to use the OpenGL, I'm new in OpenGL, I search some resources,
https://stackoverflow.com/questions/6493099/qt-rendering-using-opengl
but seems the QDeclarativeView is not defined in my qt5.11, and then in .pro
I add += declarative also got a "unknown module" error message,Is there a better way to use it ?
thank you
-
@jackson7281
this is Qt4/QML1 code.
basically QML is already using OpenGL backend if the libs are available on your system and not explicitly configured differently. -
@raven-worx
hi raven, thank you for your help.
so you mean there is no need to add OpenGL to project, the QML is already using OpenGL ?
My embedded system is raspberry pi 3B, OpenGL have been enabled by the raspi-config, but I'm not sure it's also working in my QML project -
@jackson7281
yes, basically. The whole QML2 render backend was designed for OpenGL initially, this recently changed and was extended.
Nevertheless you may want to read the following and check if your is application already using HW accerleration.
https://www.qt.io/blog/2017/01/18/opengl-implementation-qt-quick-app-using-todayWhat backend are you using btw? EGLFS, X11?
-
@raven-worx
Sorry, I searched some info about the EGLFS, X11. But I think i don't know which back-end I'm using.
After set the QSG_INFO, the debug console display the following logqt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.scenegraph.general: texture atlas dimensions: 2048x1024
qt.scenegraph.general: R/G/B/A Buffers: 8 8 8 0
qt.scenegraph.general: Depth Buffer: 24
qt.scenegraph.general: Stencil Buffer: 8
qt.scenegraph.general: Samples: 0
qt.scenegraph.general: GL_VENDOR: Broadcom
qt.scenegraph.general: GL_RENDERER: VC4 V3D 2.1
qt.scenegraph.general: GL_VERSION: OpenGL ES 2.0 Mesa 19.1.0-devel
qt.scenegraph.general: GL_EXTENSIONS: GL_MESA_tile_raster_order GL_OES_depth_texture GL_OES_packed_depth_stencil
I can see the the GL_VENDOR, GL_VERSION, GL_RENDERER
Does that means the QML has run the OpenGL correctly ? -
@jackson7281 said in Qml Gridview implement in OpenGL:
Does that means the QML has run the OpenGL correctly ?
qt.scenegraph.general: GL_VERSION: OpenGL ES 2.0 Mesa 19.1.0-devel
yes. the current platform can be inspected during runtime with QGuiApplication::platformName()
-
@raven-worx
Thank you for your help, now I can move forward my project.