[Qt5-feedback] Creating an OpenGL Context Window

Keith Gardner kgardner at zebraimaging.com
Thu May 12 17:43:47 CEST 2011


If OpenGL is going to be used to draw all widgets, what will happen to the QtOpenGL5.dll.  Will this binary go away and the functionality be integrated into the QtGui4.dll?

Keith

-----Original Message-----
From: gunnar.sletta at nokia.com [mailto:gunnar.sletta at nokia.com] 
Sent: Thursday, May 12, 2011 9:48 AM
To: Keith Gardner
Cc: qt5-feedback at qt.nokia.com
Subject: Re: [Qt5-feedback] Creating an OpenGL Context Window


On May 12, 2011, at 3:45 PM, ext Keith Gardner wrote:

> I have a few questions about writing an OpenGL app.
>  
> 1.       I was wondering how Qt will handle creating an QGLWidget context window on top of a main window which is also an OpenGL context?

It will be a separate window handle, stacking over the Qt root window in the native windowing system. They will live "separate lives" you might say. Alternative option is to integrate via an FBO, in which case you get integrated with QML transitions, clipping and opacity and all the nice stuff.

> 2.       How will the application be able to differentiate between which context to perform the draw calls?

The QGLWidget has a paintGL call. That will be called when the user-context is current and when Qt needs to draw its surface, it will make its context current and draw that. Scene graph has a rendering thread, so in practice the user GL widget would stay current in the GUI thread while scene graph would stay current in the rendering thread. 

I don't see this changing in any way. There are specific times when each context gets to draw.

> 3.       Also, how will Qt perform 2D painting on top of a QGLWidget in Qt5?

Same as in Qt4. If you open a QPainter on a QGLWidget it will render using OpenGL.

-
Gunnar



More information about the Qt5-feedback mailing list