gabek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017
03:40 PM
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!
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!
3 REPLIES 3
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017
04:50 PM
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.
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.
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2017
10:00 AM
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.
gabek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
03:30 PM
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!
Thanks, all!