Forum Discussion
RokuJoel
9 years agoBinge Watcher
"The Docs Guy " wrote:
It would probably be good for me to revise and clarify the section of documentation that got the guy all “hot and bothered”, since it already needs some clarification anyway.
By “BrightScript”, I meant “BrightScript within an XML component file <script> element CDATA section”, not the “main BrightScript thread”.
You can’t do much with the “main BrightScript thread” except kick off the Scene Graph render thread, that starts in an EXTENDED “Scene” component XML file.
Wishful thinking, thinking based on previous Roku programming models, whatever, it’s the first trap programmers fall into with Scene Graph. One of the first things I wrote about Scene Graph is some totally nonsensical paragraph about being able to create and add any number of “Scenes” in BrightScript using createObject(). (It may still be in there, another thing to fix.)
and
"Lead Roku Scenegraph Engineer" wrote:
You can actually create nodes in the main Brightscript thread. The problem is that it’s generally much slower to do things that way because of all the synchronization that has to be done with the scene graph render thread.
It’s much faster to create nodes in the scripts inside an XML component that extends “Scene” (or in other XML components), since those scripts run in the render thread and avoid synchronization penalties.
Hope that helps
- Joel
Related Content
- 10 months ago
- 2 years ago
- 11 months ago