Results 1 to 4 of 4

Thread: < problem> supported OpenGL version by Qt

  1. #1
    Join Date
    Jan 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default < problem> supported OpenGL version by Qt

    Неllo. I have the problem. I cannot get supported OpenGL version by Qt QtOpenGL module on the Windows XP. This must be 1.1 by WGL.

    Qt Code:
    1. #include <QtGui>
    2. #include <QIODevice>
    3.  
    4. void getOGLVersion();
    5.  
    6. int main(int argc, char** argv)
    7. {
    8. QApplication app(argc, argv);
    9.  
    10. getOGLVersion();
    11.  
    12. //...
    13.  
    14. return app.exec();
    15. }
    16.  
    17. void getOGLVersion()
    18. {
    19. int i=(int)QGLFormat::openGLVersionFlags();
    20.  
    21. QFile f("info.txt");
    22. f.open(QIODevice::WriteOnly);
    23. QTextStream out(&f);
    24. out << hex << i;
    25. f.close();
    26. }
    To copy to clipboard, switch view to plain text mode 

    I must get constant table number in OpenGLVersionFlag, but this constant does not exist in table. I get: "3f" on my platform. I need help...

    For example, I have for OpenSuse 11.2 and other old computer: "1f". This value does not exist also in table of enum OpenGLVersionFlag. Why? Where is the error or?
    Last edited by public; 24th January 2011 at 17:44.

  2. #2
    Join Date
    Jan 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: < problem> supported OpenGL version by Qt

    ?...?...?...

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: < problem> supported OpenGL version by Qt

    Why are you casting the flags to int? What do you expect to get? 0x3f indicates you have OpenGL 2.0 present. 0x1f is the same minus 0x20 which means OpenGL 1.5 is present.

    Qt Code:
    1. OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
    2. if(flags & QGLFormat::OpenGL_Version_1_5) qDebug() << "1.5 or higher";
    3. if(flags & QGLFormat::OpenGL_Version_2_0) qDebug() << "2.0 or higher";
    4. // etc.
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:

    public (24th January 2011)

  5. #4
    Join Date
    Jan 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: < problem> supported OpenGL version by Qt

    I have understood. It is sum 0x01+0x02+0x04+0x08+0x10+0x20=0x3f
    Thank you!

Similar Threads

  1. graphicsview & opengl version 1.4 problem
    By dkoryagin in forum Qt Programming
    Replies: 3
    Last Post: 15th September 2010, 08:20
  2. Is QtSoap Plugin supported with Qt4.6 or higher version ?
    By abk883 in forum Installation and Deployment
    Replies: 2
    Last Post: 29th March 2010, 07:22
  3. OpenGL version
    By uj in forum Qt Programming
    Replies: 5
    Last Post: 28th January 2010, 16:01
  4. Qt and PostgreSQL : version not supported
    By xinevil in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2008, 14:00
  5. Does OpenGL be supported in opensource of Qt-4.1.2?
    By showhand in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2006, 11:46

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.