Results 1 to 7 of 7

Thread: Starting OpenGL with Qt

  1. #1
    Join Date
    Jan 2016
    Posts
    76
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Starting OpenGL with Qt

    I need to start learning OpenGL now and the book I read (C++-GUI-Programming-with-Qt-4-2nd Edition) covers it in chapter 20 while I'm now reading chapter 5!

    1- What are the benefits of learning OpenGL "with" Qt?
    2- What should I read to be familiar with Qt OpenGl? Preferably a step-by-step book/tut.
    Docs haven't helped me so far except for seeing a function of a given class. So if there is a good tut apart from docs, I will be very happy to have that.

    3- What's your opinion about this tut? Would you agree if I continue reading the book and starting it at the same time.

    Overall, what would your suggestions be for a C++/Qt programmer that likes to start OpenGL?

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Starting OpenGL with Qt

    1- What are the benefits of learning OpenGL "with" Qt?
    If you aren't doing any 3D graphics, then there isn't much point to learning OpenGL. If you are, then you'll probably need to learn it unless you can use one of the 3D scene graph modeling libraries like Coin3D, Ogre3D, or now Qt3D.

    2- What should I read to be familiar with Qt OpenGl? Preferably a step-by-step book/tut.
    The Qt tutorials are a place to start, but they are so simple and basic that they are mostly meaningless as a way to really learn OpenGL. I have found the tutorials on the NeHe website to be useful. Remember that Qt's visible support for OpenGL is mostly just to provide some container classes to allow OpenGL wondows to be hosted in a Qt application. Qt Quick / QML is supposed to be implemented largely in OpenGL under the hood.

    3- What's your opinion about this tut?
    Seems pretty good. Focus on learning the "Core" OpenGL with shaders, etc. and forget the immediate mode methods.

    Overall, what would your suggestions be for a C++/Qt programmer that likes to start OpenGL?
    First, find a book based on Qt 5. Qt 4's OpenGL support is basically obsolete in that it focuses primarily on the immediate mode style. Qt 5 introduced new high level classes for OpenGL support, and you should be using Qt5 with them in any new code you write.

    For pure OpenGL learning, the "OpenGL Programming Guide" (aka the "red book"), "OpenGL Development Cookbook", "OpenGL Shading Language", and "OpenGL 4.0 Shading Language Cookbook" books are worth having. Don't get any book that doesn't cover at least OpenGL 3.3 or later.
    <=== 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. The following user says thank you to d_stranz for this useful post:

    franky (25th September 2017)

  4. #3
    Join Date
    Jan 2016
    Posts
    76
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Starting OpenGL with Qt

    Thank you for the answer.

    Does Qt cover all what OpenGl has? If it covers all, so using a Qt book explaining OpenGl sounds better because it will be more relevant for my work too.

    On the other word, do you think it's better I read a book on pure OpenGl or one that uses Qt for teaching OpenGl?

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Starting OpenGL with Qt

    Does Qt cover all what OpenGl has?
    The QOpenGL... classes cover a large part of OpenGL, but really they are just a very thin wrapper around the core OpenGL functions. See QAbstractOpenGLFunctions. You still need to learn OpenGL itself to be able to use them. If you read a book on OpenGL and learn it that way, understanding and using the Qt wrapper will be easy because there is nearly a 1 - 1 match between the names of methods in OpenGL and the Qt wrapper.

    One other book I forgot to mention is the "OpenGL Super Bible", a good companion to the "red book". Be sure to get the latest versions of any book you buy. OpenGL has changed a lot in the last 10 years and you don't want to be teaching yourself from an obsolete book.
    <=== 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.

  6. The following user says thank you to d_stranz for this useful post:

    franky (27th September 2017)

  7. #5
    Join Date
    Jan 2016
    Posts
    76
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Starting OpenGL with Qt

    Thank you very much for your guidance.

    I also found other books useful for learning.
    http://openglbook.com/the-book.html
    https://learnopengl.com/

    As the decision point, which of those four books would you recommend me if I only have time for one of them now, please?

  8. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Starting OpenGL with Qt

    The "learnopengl" book looks like a good place to start before you buy anything.

    I think you pretty much have to buy the red book at some point (OpenGL Programming Guide). I have a very old copy of the OpenGL Superbible (2007), but I ordered the latest edition this week. When I receive it I will let you know if it is worth having.

    Otherwise, there are a lot of excellent online resources, as you are discovering.
    <=== 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.

  9. The following user says thank you to d_stranz for this useful post:

    franky (27th September 2017)

  10. #7
    Join Date
    Jan 2016
    Posts
    76
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Starting OpenGL with Qt

    Thanks so much.
    I could find the red book 9th edition and I'm reading it now. It seems great it starts from OpenGL 4.5 and it's my choice for learning OpenGL.
    Last edited by franky; 27th September 2017 at 17:31.

Similar Threads

  1. Replies: 2
    Last Post: 5th July 2017, 13:28
  2. Starting with C, need some help
    By zetaXX in forum General Programming
    Replies: 2
    Last Post: 25th May 2013, 20:47
  3. Starting all over
    By KillGabio in forum Newbie
    Replies: 4
    Last Post: 17th January 2013, 14:34
  4. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 00:45
  5. Starting with QML
    By MTK358 in forum Newbie
    Replies: 5
    Last Post: 3rd October 2010, 13: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.