PDA

View Full Version : Qt and OpenGL 3.x



Wasabi
6th April 2011, 16:01
I want to use Qt along with OpenGL 3.x, however, before starting, I've done some looking and can't find any information regarding compatibility. As well, all the OpenGL tutorials I've found have been in previous versions.

Is Qt 4.7.2 OpenGL 3.x compatible? Can I simply implement QGLWidget::paintGL() with VBOs, VIOs and whatnots? I'm asking because I've actually already started making the OpenGL 3.x program (without Qt) but then suddenly realized that Qt might not be compatible, so would just like to know before I continue.

JohannesMunk
6th April 2011, 18:14
Qt's OpenGL implementation is a thin wrapper. There never was anything stopping anyone to use native features that were not "supported" by Qt. I used shader code on an QGLWidget before QGLShader came around.

Supported in this instance, implies only that there is a convenience class available for some feature. Not that you can finally start using it with Qt.

That was true with OpenGl 2.0 features, and I'm positive that it stayed that way for OpenGL 3.0.

But what is holding you back to just answer your question yourself and just try it? As you want to use a QGLWidget later it's not even wasted code.

Johannes

Wasabi
6th April 2011, 23:46
Oh, I actually already have a Qt framework, but it was built for the 2D version of the program with a different library, so I'd only have to (or, well, I hope I will only have to) change a few things to make it work with OpenGL. What I don't have done is the OpenGL part. So before I continued developing it in 3.x, I wanted to make sure it work on Qt.

But now that I know, many thanks.

Wasabi
11th May 2011, 18:54
Sorry to bring this back after a month, but I've been away from my code all this time. Now that I'm back, I hunkered down to read some of the Qt docs on this subject and stumbled upon QGL::setPreferredPaintEngine, which states:


The engineType parameter specifies which of the GL engines to use. Only QPaintEngine::OpenGL and QPaintEngine::OpenGL2 are valid parameters to this function. All other values are ignored.

How does this relate to my wish to use OpenGL 3.x?

Wasabi
12th May 2011, 19:41
Any help please?