Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. GL_PRIMITIVE_RESTART_FIXED_INDEX not works on Android's OpenGL ES
Forum Updated to NodeBB v4.3 + New Features

GL_PRIMITIVE_RESTART_FIXED_INDEX not works on Android's OpenGL ES

Scheduled Pinned Locked Moved Solved Mobile and Embedded
8 Posts 2 Posters 942 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.
  • PowerNowP Offline
    PowerNowP Offline
    PowerNow
    wrote on last edited by PowerNow
    #1

    Hi, I want to render multiple objects based on Qt 5.12/Qml/OpenGL ES 3.1+ via GL_TRIANGLE_STRIP and splitted by 'Primitive Restart'. I tested it on Win10 and everything works fine. The problem now is that

    m_func->glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
    

    is only accepted from usual OpenGL. The reason is that Qt's glEnable() supports only OpenGL ES 2.0 and GL_PRIMITIVE_RESTART_FIXED_INDEX is only up from OpenGL ES 3.x.

    So does maybe someone know how to

    1. use consequently in Qt OpenGL ES 3.x and not extraFunctions()?
    2. use 'Primitive Restart' with Qt?

    Thanks in advance...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please take a look at the OpenGL ES 3 example to see how to enable a different version of OpenGL.

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

      PowerNowP 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Please take a look at the OpenGL ES 3 example to see how to enable a different version of OpenGL.

        PowerNowP Offline
        PowerNowP Offline
        PowerNow
        wrote on last edited by PowerNow
        #3

        @SGaist Thxs, but as I mentioned in point 1. I already use

        m_func = QOpenGLContext::currentContext()->extraFunctions();
        

        The problem is that GL_PRIMITIVE_RESTART_FIXED_INDEX is unknown using with

        m_func->glEnable(...);
        

        for OpenGL ES. glEnable() is from QOpenGLFunctions and QOpenGLExtraFunctions is only inherited from it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I am not sure I am following you as QOpenGLExtraFunctions already support OpenGL ES 3.

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

          PowerNowP 1 Reply Last reply
          0
          • SGaistS SGaist

            I am not sure I am following you as QOpenGLExtraFunctions already support OpenGL ES 3.

            PowerNowP Offline
            PowerNowP Offline
            PowerNow
            wrote on last edited by
            #5

            @SGaist Yes QOpenGLExtraFunctions supports OpenGL ES 3, but the function glEnable() contains to QOpenGLFunctions and this supports only OpenGL ES 2.

            "The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API"
            

            And GL_PRIMITIVE_RESTART_FIXED_INDEX was only introduced with OpenGL ES 3.x.

            So my question is how can I use in Qt with OpenGL ES GL_PRIMITIVE_RESTART_FIXED_INDEX to render multiple objects using only one draw command glDrawElements()?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @PowerNow said in GL_PRIMITIVE_RESTART_FIXED_INDEX not works on Android's OpenGL ES:

              GL_PRIMITIVE_RESTART_FIXED_INDEX

              While the primitive name itself seems to not be defined, what you can do is:

              #ifndef GL_PRIMITIVE_RESTART_FIXED_INDEX
              #define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
              #endif
              

              Note that this is taken from within Qt's source code.

              Does that work ?

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

              PowerNowP 1 Reply Last reply
              1
              • SGaistS SGaist

                @PowerNow said in GL_PRIMITIVE_RESTART_FIXED_INDEX not works on Android's OpenGL ES:

                GL_PRIMITIVE_RESTART_FIXED_INDEX

                While the primitive name itself seems to not be defined, what you can do is:

                #ifndef GL_PRIMITIVE_RESTART_FIXED_INDEX
                #define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
                #endif
                

                Note that this is taken from within Qt's source code.

                Does that work ?

                PowerNowP Offline
                PowerNowP Offline
                PowerNow
                wrote on last edited by PowerNow
                #7

                @SGaist Yeah, this works, thxs! But also if GL_PRIMITIVE_RESTART_FIXED_INDEX is defined how can it work with glEnable() from QOpenGLFunctions? Should be there not an overwritten member function glEnable() of QOpenGLExtraFunctions?

                https://bugreports.qt.io/browse/QTBUG-83034

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Because you requested the adequate context version.

                  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