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. Why I can't use original OpenGLES functions directly?
QtWS25 Last Chance

Why I can't use original OpenGLES functions directly?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 2.1k Views
  • 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.
  • S Offline
    S Offline
    sasmaster
    wrote on last edited by
    #1

    I generally understand the rationale behind QOpenGLFunctions and QOpenGLExtraFunctions objects,but in reality those make it pretty hard to work with external OpenGL code base.From what I understood one should include those headers ,or extend QOpenGLWidget with one of them to get access to GL functions.The second option is preferable if one doesn't want to write code like this:

    func.glClearColor(1,1,1,1);
    

    But it doesn't really help me if I put into Qt a code base with many classes that internally call pure GL methods,because in this case I must either extend all those classes with QOpenGLFunctions ,or rewrite them to be called as members of that class.Both are unacceptable if the code base is a lib ,which maybe used also outside Qt SDK.So what do I do? in this case? How I call the GLES functions directly and independently of QOpenGLFunctions? I tried to include GLES2 and GLES3 headers directly in the app but it brings alot of header conflicts and unresolved external symbols errors,which leads me to think that Qt (ANGLE) by default doesn't use those headers declaration.IS it true?When then do you expose them? So,I am quite disappointed by the fact that latest Qt forces us to use QOpenGLFunctions wrappers and allows no easy way to just use pure GL methods.

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

      Hi,

      Do you mean like in the Cube OpenGL ES 2.0 example ?

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you mean like in the Cube OpenGL ES 2.0 example ?

        S Offline
        S Offline
        sasmaster
        wrote on last edited by
        #3

        @SGaist Yeah,I don't want to use Qt's GL wrappers.So indeed I started with that sample to see how they do it.So it sucks.I can't use gl methods directly.Moreover,in some blog post Qt guy says it is completely ok to use GLES3 headers directly,but it just doesn't work.
        So what do I do in this case?
        Should I build the Qt with no GL at all and add ANGLE manually?

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

          That blog post ?

          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
          1
          • S Offline
            S Offline
            sasmaster
            wrote on last edited by
            #5

            That's exactly the blog post I am referring to.So what he says is not correct for the latest Qt version.Including GLES headers directly causes headers collisions and linker errors.

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

              The only time the direct inclusion is mentioned is at the end and concerns only Android.

              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
              • S Offline
                S Offline
                sasmaster
                wrote on last edited by
                #7

                "While nothing stops the developer from using these APIs directly (that is, #include <GLES3/gl3.h>, call the functions directly, and be done with it), the cross-platform development story used to be less than ideal, leading to compile and run-time checks scattered across the application"
                At the header of the blogpost.So you say it relates to mobile dev only?

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

                  Go down to the "Summary" and "Bonus problem: the headers" part of the post which is likely what you are interested about.

                  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