gabek
Visitor

Starting a roScreen from a SceneGraph component

I've been trying to dig into accomplishing this, but all signs point to "not possible", but that would be ridiculous if it were true.

A common scenario would be to have menu components and then launch into a roScreen, but creating an instance of one within a SceneGraph render thread returns back "invalid".

Currently, this puts me in a scenario where I can't update my application piece by piece but instead would need to rewrite the entire thing at once.  And rewriting my roScreen in SceneGraph would not be a small task.  I'd love if somebody could prove me wrong!
Tags (1)
0 Kudos
3 REPLIES 3
belltown
Roku Guru

Re: Starting a roScreen from a SceneGraph component

Assuming this is possible: Instead of creating an roScreen from within a Scene Graph Render thread, try creating it from the Main thread.

If your menu is implemented in the Scene Graph Render thread, you could set a field on the Global node, which would be observed by the Main thread, to trigger the creation of the roScreen.

I'm not sure if it would work, but that would sound like your best option. You can do several things from the Main thread that you can't do from a Render (or Task) thread.
Tags (1)
0 Kudos
NB_
Roku Guru

Re: Starting a roScreen from a SceneGraph component

"gabek" wrote:
A common scenario would be to have menu components and then launch into a roScreen, but creating an instance of one within a SceneGraph render thread returns back "invalid".

Creating a roScreen from inside a RSG render thread? <shiver/> perish the thought!
The two are immiscible, in the sense they cannot function at the same time - if roScreen is created, roSgScreen gets suspended and vice versa. To this i am glad to hear that trying to create roScreen from the render thread returned invalid - i don't want to contemplate what suspending a thread because of it creating roScreen would look like but feels like cutting branch one is sitting on.
Do it from the main thread - when done with roScreen and closing it, RSG should get resumed.
Tags (1)
0 Kudos
gabek
Visitor

Re: Starting a roScreen from a SceneGraph component

Thanks for pointing me in the right direction!  I had originally tried spawning roScreen from a Task, and while it did display, it didn't, as you mentioned "function".  So that makes complete sense.

Thanks, all!
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!