Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

Async

I have a roScreen with a bunch of images flying around. I would like to download new images and replace the current ones on an individual basis with a staggered timer.
AsyncGettoFile works fine to download the images without disrupting the motion, but creating the new bitmaps causes the motion to pause for several frames. Anyway to create the bitmaps in the "background" as it were?
Thanks.
Kinetics Screensavers
0 Kudos
5 REPLIES 5
TheEndless
Channel Surfer

Re: Async

Check out the roTextureManager: http://sdkdocs.roku.com/display/sdkdoc/roTextureManager
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: Async

Will do, Thanks Endless.
Kinetics Screensavers
0 Kudos
squirreltown
Roku Guru

Re: Async

Am now using the texturemanager. I'm still getting a few frames pause when the bitmap is created. Before using the texmanager it was maybe 10 frames (60fps). Now its say 6 frames. To be sure I'm doing everything, i want to SetAsync on the request but have tried every way i can think of as to how & where. The docs say Async is the default, so i shouldn't have to do this but i want to make sure before asking why its not creating the bitmap asynchronously like it is supposed to. Can some one point out how and where SetAsync(async as Boolean) as Integer fits in the code below, thank you.

                   texmgr.UnloadBitmap("tmp:/z"+photolist[0].GetName())
requestbm0 = CreateObject("roTextureRequest" , "tmp:/z"+photolist[10].GetName())
texmgr.RequestTexture(requestbm0)
msg=wait(0, texport)
if type(msg)="roTextureRequestEvent" then
if msg.GetState() = 3
bm0 = msg.GetBitmap()
end if
end if
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: Async

Your code is blocking until you get an roTextureRequestEvent with a state of 3, so even though the request is asynchronous, your code is waiting for it to finish, which defeats the purpose.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: Async

As usual you are correct. Got rid of the wait and no hiccups!
Thanks again
Kinetics Screensavers
0 Kudos