Results 1 to 5 of 5

Thread: Confusion with OpenGL desktop and applications

  1. #1
    Join Date
    Jul 2016
    Posts
    57
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Confusion with OpenGL desktop and applications

    I decided to run some OpenGL example, and compiler gave me error:
    :-1: error: This example requires Qt to be configured with -opengl desktop

    Then from here http://doc.qt.io/qt-5/configure-options.html I see that by default when you install QtCreator on Windows it is configured to use some ANGLE which runs OpenGL using the DirectX.

    So I'll have to build Qt from sources myself with -opengl and ANGLE disabled correct?

    If yes, then another page confuses me: http://doc.qt.io/qt-5/qtopengl-index.html why they write
    Warning: This module should not be used anymore for new code. Please use the corresponding OpenGL classes in Qt GUI.
    So to use a native OpenGL I need to build its desktop to utilize OpenGL, but then to build OpenGL stuff...its not recommended? or am I missing something?


    Added after 8 minutes:


    And as an additional question, since I have installed binary Qt 5.7, for example, if I build now any OpenGL application, does it mean that the application use DirectX9 then instead of using native OpenGL?

    If yes...then how can I using my currently installed Qt 5.7 on Windows build the application which uses native OpenGL?
    Last edited by r2com; 27th July 2016 at 17:10.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,316
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Confusion with OpenGL desktop and applications

    This article from the Qt documentation might explain things. You do not have to reconfigure and rebuild Qt to use native OpenGL; there are run-time switches that let Qt choose, or to force a choice on it.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Confusion with OpenGL desktop and applications

    Quote Originally Posted by r2com View Post
    So to use a native OpenGL I need to build its desktop to utilize OpenGL, but then to build OpenGL stuff...its not recommended? or am I missing something?
    No, that note simply says you should not be using anything from the QOpenGL module but use the OpenGL classes of the QtGui module instead.
    E.g. QOpenGLContext, or, with widgets QOpenGLWidget.

    Quote Originally Posted by r2com View Post
    And as an additional question, since I have installed binary Qt 5.7, for example, if I build now any OpenGL application, does it mean that the application use DirectX9 then instead of using native OpenGL?
    By default it is runtime detected.
    If the system has proper OpenGL libraries then those are being used.
    If it only has the obsolete OpenGL 1.0 libraries provided by Microsoft, it will use ANGLE.

    Cheers,
    _

  4. #4
    Join Date
    Jul 2016
    Posts
    57
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Confusion with OpenGL desktop and applications

    Well I did read that page already, it says
    If you installed additional OpenGL drivers from your hardware vendor, then you may want to consider using this version of OpenGL instead of ANGLE. To use OpenGL, pass the command line options -opengl desktop to the configure script.
    And then it shows command:
    configure -opengl desktop
    But where do I enter the above command? Isn't it supposed to be entered only when you start compiling Qt 5.7?


    Added after 18 minutes:


    Well, I checked with OpenGL Extensions Viewer I currently have OpenGL 4.0 on my laptop.



    Added after 17 minutes:


    d_stranz, I just checked, the configure -opengl desktop command is only used during compile time of Qt...

    So if you saying that I do not need to recompile Qt 5.7, then how can I make the OpenGl Boxes Example to run without that error?


    Added after 1 14 minutes:


    Quote Originally Posted by anda_skoa View Post
    By default it is runtime detected.
    If the system has proper OpenGL libraries then those are being used.
    If it only has the obsolete OpenGL 1.0 libraries provided by Microsoft, it will use ANGLE.
    _
    anda_skoa, Are you sure that it is really runtime detected?

    it just seems from different threads all over and also this thread https://forum.qt.io/topic/22651/open...rking-for-me/3 that in order to compile OpenGL application I must use Qt built with -opengl desktop setting?

    And also, again, why can't I run the Boxes example then and it tells me specifically "This example requires Qt to be configured with -opengl desktop" if it is runtime detected?
    Last edited by r2com; 27th July 2016 at 19:59.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Confusion with OpenGL desktop and applications

    Hmm, maybe it only does that for the QtQuick scene graph then.
    I am referring to https://blog.qt.io/blog/2014/11/27/q...ing-in-qt-5-4/

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 30th September 2015, 12:28
  2. Replies: 4
    Last Post: 27th January 2013, 17:00
  3. How to send SMS from a desktop qt Applications?
    By newtowindows in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2009, 19:05
  4. QRegExp Confusion
    By redneon in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 11:33
  5. Replies: 5
    Last Post: 31st January 2009, 07:36

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
  •  
Qt is a trademark of The Qt Company.