Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. What are those string "name" properties set to various objects in Qt Canvas3D code?

What are those string "name" properties set to various objects in Qt Canvas3D code?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
javascriptopenglcanvas3d
6 Posts 2 Posters 2.5k 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
    Stefan Monov76
    wrote on 4 Oct 2016, 16:18 last edited by
    #1

    See for example the second code snippet in this Qt example.

    It does this:

    rttFramebuffer.name = "OffscreenRenderTarget";
    

    I haven't seen this in C++ OpenGL code, which means it's probably either a Canvas3D thing or a WebGL thing inherited by Canvas3D. A quick google search, however, reveals nothing on this.

    Could anyone explain why it's done and what it does?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 6 Oct 2016, 11:28 last edited by
      #2

      Not sure if it helps you in investigation, but that method calls glGenFramebuffers() from OpenGL: https://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml so I guess names are set on results of calling it.

      (Z(:^

      S 1 Reply Last reply 6 Oct 2016, 12:10
      0
      • S sierdzio
        6 Oct 2016, 11:28

        Not sure if it helps you in investigation, but that method calls glGenFramebuffers() from OpenGL: https://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml so I guess names are set on results of calling it.

        S Offline
        S Offline
        Stefan Monov76
        wrote on 6 Oct 2016, 12:10 last edited by
        #3

        @sierdzio : Which method is calling glGenFramebuffers? The example code is calling glCreateFramebuffer.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 6 Oct 2016, 12:27 last edited by
          #4

          Follow the code and Qt docs :-)

          rttFramebuffer = gl.createFramebuffer();
          

          createFramebuffer() in Qt docs:

          Returns a created Canvas3DFrameBuffer object that is initialized with a framebuffer object name as if by calling glGenFramebuffers().

          (Z(:^

          S 1 Reply Last reply 7 Oct 2016, 10:30
          0
          • S sierdzio
            6 Oct 2016, 12:27

            Follow the code and Qt docs :-)

            rttFramebuffer = gl.createFramebuffer();
            

            createFramebuffer() in Qt docs:

            Returns a created Canvas3DFrameBuffer object that is initialized with a framebuffer object name as if by calling glGenFramebuffers().

            S Offline
            S Offline
            Stefan Monov76
            wrote on 7 Oct 2016, 10:30 last edited by
            #5

            @sierdzio :

            so I guess names are set on results of calling it.

            Well, sure, that's what the code is doing. Calling gl.createFramebuffer() and setting the name property on its return value. That much is obvious, I believe. I just don't know what the purpose of setting it is.

            S 1 Reply Last reply 8 Oct 2016, 08:28
            0
            • S Stefan Monov76
              7 Oct 2016, 10:30

              @sierdzio :

              so I guess names are set on results of calling it.

              Well, sure, that's what the code is doing. Calling gl.createFramebuffer() and setting the name property on its return value. That much is obvious, I believe. I just don't know what the purpose of setting it is.

              S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 8 Oct 2016, 08:28 last edited by
              #6

              @Stefan-Monov76 said in What are those string "name" properties set to various objects in Qt Canvas3D code?:

              I just don't know what the purpose of setting it is.

              Me neither, sorry. The only thing that I gather from the docs is that all Canvas3D objects have name parameter, much like QObject/ QML QtObject, so perhaps it can be used to search objects by name. It's only a guess, though.

              (Z(:^

              1 Reply Last reply
              0

              6/6

              8 Oct 2016, 08:28

              • Login

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