What are those string "name" properties set to various objects in Qt Canvas3D code?
-
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?
-
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.
-
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().
-
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. -
@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.