Results 1 to 5 of 5

Thread: Qt and OpenGL 3.x

  1. #1
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt and OpenGL 3.x

    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.

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt and OpenGL 3.x

    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

  3. The following user says thank you to JohannesMunk for this useful post:

    Wasabi (6th April 2011)

  4. #3
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and OpenGL 3.x

    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.

  5. #4
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and OpenGL 3.x

    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?

  6. #5
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and OpenGL 3.x

    Any help please?

Similar Threads

  1. Replies: 0
    Last Post: 6th December 2009, 00:41
  2. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 10:10
  3. OpenGL with Qt
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 2
    Last Post: 10th August 2009, 20:02
  4. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 09:37
  5. Qt in opengl
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2007, 16:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.