Results 1 to 4 of 4

Thread: QT 4.6 and openGL 2+

  1. #1
    Join Date
    Jul 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT 4.6 and openGL 2+

    Hi,
    I have no problem getting openGL to work as such, but I cannot use commands such as glGenBuffers (not defined) and it seems to be realted to the openGL version used by QT.
    I have tried to probe my context by doing this (after sub classing QWidget):
    if(QGLFormat::OpenGL_Version_3_0&&dviewer.context( )->format().openGLVersionFlags())
    qDebug() << "looks ok..." << dviewer.context()->format().openGLVersionFlags();
    That gives
    looks ok... 4223

    Which makes me think I should be ok with an openGL3 context. (glGenbuffers is version 1.5+).

    I am using Fedora 13 and glxinfo says
    glxinfo | grep version
    server glx version string: 1.4
    client glx version string: 1.4
    GLX version: 1.4
    OpenGL version string: 3.2.0 NVIDIA 195.36.31
    OpenGL shading language version string: 1.50 NVIDIA via Cg compiler


    For building I use cmake, but I hope that should not make a difference.


    What should I be checking - I think the problem is with the headers, but how do I go about directing QT to certain GL headers? I noticed my system gl.h is openGL 1.1 but I am not sure about how I change this and why that is since the driver seems to be running 3.2 (as per glxinfo).

    Thanks for any suggestions!

    Soren

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QT 4.6 and openGL 2+

    If the flags return 4223, opengl 3 is not supported on your system.

    (dviewer.context()->format().openGLVersionFlags() & QGLFormat::OpenGL_Version_3_0) == QGLFormat::OpenGL_Version_3_0
    will return false.

  3. #3
    Join Date
    Jul 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT 4.6 and openGL 2+

    Thanks,
    Yes I think that expression was a bit biased by my desire to have GL3 there...
    I think I got it working with glew now, but still confused as QT 4.6 should support GL 3.0 and I believe my driver support that too.

    Soren

  4. #4
    Join Date
    Jul 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT 4.6 and openGL 2+

    Just to follow up in case others are stuck with the same issues. Got it working with the glew library. Included GL/glew.h before QGLWidget.h and then added GLEW to my linker library list. Glew then says I have openGL 3 available so it appears glew is able to provide the right headers.

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. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 09:37
  4. Qt OpenGL ES
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2009, 11:21
  5. Qt and OpenGL
    By ToddAtWSU in forum Qt Programming
    Replies: 8
    Last Post: 15th June 2006, 21:37

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.