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: 
NewManLiving
Visitor

Re: invalidating bitmaps/sprites

That's true. It's usually the next call. Everything you describe in your Netflix prototype can be performed with roScreen. Sprites can be hidden by setting the z order to < 0. They can even be reused by simply changing their region (SetRegion) to a new bitmap region. Using a compositor introduces a bit more complexity for implementing a video player as it always clears the screen with your call to drawall. But a full screen videoplayer can be easily implemented by setting the color value in setdrawto to transparent. A smaller video player can be carved out of a region of the window itself ( create a region using roScreen) and clear that area sandwiched between drawall and swap buffers. Panels can be created and sprited over an entire transparent window Using their own transparent region within their bitmap to expose the videoplayer. While other accessory components can take advantage of the panel bitmap real estate and create their own regions with which to draw themselves Saving resources and memory. regardless the player can only be exposed by drawing or clearing a transparent area over it with the proper alpha settings. There are some anomalies with firmware 7 that I noticed when it comes to clearing or drawing transparently to the window itself. It appears to change the alpha enable setting of the window. I don't know if this applies to having a compositor or not. In any event depending on the setting of the window you generally will set it false to clear the transparent video region before your call to any roScreen drawing or clearing function and then set it back before you call swapbuffers otherwise any other alpha blending you have in accessory components will not be rendered properly after the swapbuffers returns

As far a texturemanager vs rourltransfer the advantage is in what you need it for. Rourltransfer is good for downloading once or infrequently a complete set of textures. If you need to manage memory because you have many bitmaps then you essentially have to create a system to manage loading And unloading. This is where the texturemanager outperforms. It is already designed to request, cancel and load bitmaps. And it does it very well. It also has the added advantage of an LRU which is pretty good so subsequent reuse of unloaded bitmaps will appear faster
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos

Re: invalidating bitmaps/sprites

That's some very useful information. I am going to ditch the image canvas entirely, and also switch to using the texturemanager for bitmaps.

There are some anomalies with firmware 7 that I noticed when it comes to clearing or drawing transparently to the window itself. It appears to change the alpha enable setting of the window


The compositor seems to set the alpha enable of the entire screen to false if you clear it with a non-transparent color ie &hffffffff

:mrgreen:
0 Kudos
NewManLiving
Visitor

Re: invalidating bitmaps/sprites

I write 2d extensively and always have a few alpha blends somewhere on the screen so I always create my window with alpha enabled since I'm constantly needing it to be enabled. Clearing with a non-transparent does not change the setting for me only when I specifically create a region on the roScreen itself or use roScreen drawrect with transparency does the setting get changed. Like I said direct calls to roScreen are always sandwiched in between compositor.drawall and swapbuffers. I also found in the past that this worked somewhat different on devices with or without open gl. You generally had to Disable, draw then re-enable to insure everything rendered correctly with the next swapbuffers
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.