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?
Forum Updated to NodeBB v4.3 + New Features

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.6k Views 2 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.
  • Stefan Monov76S Offline
    Stefan Monov76S Offline
    Stefan Monov76
    wrote on 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
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on 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(:^

      Stefan Monov76S 1 Reply Last reply
      0
      • sierdzioS sierdzio

        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.

        Stefan Monov76S Offline
        Stefan Monov76S Offline
        Stefan Monov76
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on 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(:^

          Stefan Monov76S 1 Reply Last reply
          0
          • sierdzioS sierdzio

            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().

            Stefan Monov76S Offline
            Stefan Monov76S Offline
            Stefan Monov76
            wrote on 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.

            sierdzioS 1 Reply Last reply
            0
            • Stefan Monov76S Stefan Monov76

              @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.

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on 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

              • Login

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