Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Loading OpenGL extensions in Qt5
Forum Updated to NodeBB v4.3 + New Features

Loading OpenGL extensions in Qt5

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 8.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ArchW
    wrote on 5 Jun 2014, 06:40 last edited by
    #1

    Hi,

    I've looked at loading extensions in Qt 5 from http://www.kdab.com/opengl-in-qt-5-1-part-1/ and following the Mr. Harmer' example, I'm trying to load the QOpenGLExtension_ARB_instanced_arrays extension, but when I build, I get:

    @error: undefined reference to QOpenGLExtension_ARB_instanced_arrays::QOpenGLExtension_ARB_instanced_arrays()' error: undefined reference to QOpenGLExtension_ARB_instanced_arrays::initializeOpenGLFunctions()'@

    I've made sure I have the extension through m_context->hasExtension(..) etc. Searching for the helper class here: http://code.woboq.org/qt5/qtbase/src/openglextensions/qopenglextensions.h.html, I don't see why it becomes undefined, as it's all there..

    Can any of you that's been using extensions in Qt5 tell me what I'm doing wrong?

    @ assert(m_context.hasExtension(QByteArrayLiteral("GL_ARB_instanced_arrays")));
    QOpenGLExtension_ARB_instanced_arrays* m_instanceFuncs = new QOpenGLExtension_ARB_instanced_arrays();
    m_instanceFuncs->initializeOpenGLFunctions();
    qDebug("extension loaded");@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ArchW
      wrote on 6 Jun 2014, 05:41 last edited by
      #2

      Hi again,

      I've yet had any success regarding this. I've tried copying over the qopenglextensions.h to my own project and I've tried building the project on both a Linux system and a Windows 7 system (both systems use Qt5.3).

      It's frustrating because I need access to GL_ARB_shader_image_load_store or GL_ARB_shader_storage_buffer_object and I feel helpless at the moment.

      If the steps I've taken is typically enough to load extensions, I'd be very happy if someone else could confirm it so that I know there's something weird on my end here.

      1 Reply Last reply
      0
      • C Online
        C Online
        Chris Kawa
        Lifetime Qt Champion
        wrote on 6 Jun 2014, 15:42 last edited by
        #3

        OpenGL and extensions live in a separate module. Be sure to add it in your .pro file and re-run qmake.
        @
        QT += opengl openglextensions
        @

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ArchW
          wrote on 6 Jun 2014, 16:09 last edited by
          #4

          And now it's working as it should...

          Thanks!

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TheRealNox
            wrote on 24 Jun 2014, 02:48 last edited by
            #5

            Hi guys,
            Thank you very much for that clarification!
            Is there any way to add this module to Visual? Can't find that module using Qt Visual Addin 1.2.3.
            And what include do you guys use:
            @#include <QOpenGLExtensions>@
            or
            @#include <QtGui/QOpenGLExtensions>@
            or
            @#include <QtOpenGLExtensions>@
            or
            @#include <qopenglextensions.h>@

            In advance, many thanks!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ArchW
              wrote on 24 Jun 2014, 07:30 last edited by
              #6

              HI,

              I haven't used any recent version of the Visual Studio addin so I cannot make a comment for that.

              Try :
              #include <QtOpenGLExtensions/QOpenGLExtensions>

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TheRealNox
                wrote on 30 Jun 2014, 23:01 last edited by
                #7

                Sorry for the late reply, I was busy as hell!
                So just find how to add that using visual 2013.

                So as said by ArchW, you have to include @<QtOpenGLExtensions/QOpenGLExtensions>@ but not only, you will have to had the proper library to your project settings and you also have to add the Qt Preprocessor as the Qt visual addin do not know about that lib (modules if you prefer). And be carefull with the debug/no-debug version!

                Hope this will help.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sreich
                  wrote on 31 Jul 2014, 05:17 last edited by
                  #8

                  note that the includes that you use doesn't matter. if you look at qt sources, the non-.h, captialized ones are literally just text files with a single line that does #include "./somethign.h". so its just style.

                  Software Developer for KDE

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 31 Jul 2014, 23:18 last edited by
                    #9

                    Hi,

                    The recommended Qt way to include is

                    @#include <QOpenGLExtensions>@

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved