News from the graphics stack: Improvements to the core OpenGL enablers

agocs's picture

Laszlo Agocs
Laszlo Agocs
The Qt Company
Europe Date: 
Tuesday, October 7, 2014 -
12:30pm to 1:30pm
Europe Room: 
C1
Europe Track: 
North America Date: 
Tuesday, November 4, 2014 -
1:45pm to 2:45pm
North America Room: 
IRVINE/ANAHEIM
North America Track: 
Europe Presentation PDF: 
North America Presentation PDF: 

Presenter Bio: 

Laszlo is a senior software engineer at The Qt Company in Oslo, Norway. After years of UI framework development on various Nokia mobile platforms and a brief time of developing mobile GPUs at ARM, he is now working full time on Qt. His focus is on graphics, platform adaptation, windowing system integration and input device handling, in particular on embedded devices running Embedded Linux or Android. However, in a true cross-platform Qt spirit, he is not afraid of other systems either, and is often helping out with OpenGL support on Windows too. He is a major contributor to QtGui, QtQuick and the platform plugins. Laszlo holds a Bachelor's degree from the Jyvaskyla University of Applied Sciences and a Master's from the University of Debrecen.

Abstract: 

As of today, the majority of OpenGL-based Qt applications that do not utilize Qt Quick are still using QGLWidget. While Qt 5.0 has started to offer more powerful and flexible solutions, these are often seen as cumbersome and limited, since interoperation with traditional, widget-based user interfaces is restricted. The same applies to Qt Quick applications: while QQuickWindow and QQuickView allow rendering a scene in a standalone native window, mixing the content with legacy widgets can be difficult and may involve unexpected issues. Finally, Qt 5's QtOpenGL module (the QGL classes) are inherently filled with issues and broken features since this component originates from the times of early Qt 4.x with a focus on OpenGL 1.x. The lack of a modern replacement for QGLWidget has made it impossible to properly deprecate this module so far. To overcome these limitations, QQuickWidget, QOpenGLWidget and QOpenGLWindow have been introduced. We will take a look at these exciting new classes and discuss which one is the most appropriate in various situations.

Even though these APIs are an enormous help in getting OpenGL content and Qt Quick scenes shown inside regular windows, those who were looking for a way to integrate Quick content with an external rendering engine (be it Qt-based or something else), found often that there is no easy solution for doing this in a hardware accelerated manner. This is changing with Qt 5.4, where the previously internal QQuickRenderControl is becoming a public API. This in effect allows redirecting the output of QQuickWindow into an OpenGL framebuffer object. The resulting texture can then be used in arbitrary ways. Together with the ability to adopt existing native rendering contexts, another new feature in Qt 5.4, this opens the door to use Qt Quick scenes in virtually any external rendering or game engine in new, creative and unforeseen ways. We will take a quick look at the new APIs and some examples.