"NewManLiving" wrote:
A compositor that is setdraw to the screen initially clears the screen with the background color.
Try a transparent background color. I haven't tried it recently, but I was originally drawing the Aquarium Screensaver background to the screen, before using the compositor on top of it, but I later changed the background bitmap to be a sprite. The behavior may have changed since then.
"NewManLiving" wrote:
if you begin to create bitmaps directly onto the screen (over the compositor) and you start to accumulate them, then you may run into a further problem with the compositor possibly clearing the screen instead of only the background of the sprite. This may be due
to the algorithm used to determine the intersection of regions or rectangles. I know when I programmed video memory in C++ if the intersection of regions or rectangles exceeded a certain percentage of the display then I would just clear the entire screen. This was common practice. I cant say this is the case, but I did have problems.
I'm not really sure what you mean by all of that, but my point was really only that you don't have to use the compositor exclusively. It's not all or nothing.
"NewManLiving" wrote:
As far as the compositor being too complex , I must disagree.
I find that it makes managing the memory a lot more tedious. I also found that calling Draw() instead of DrawAll() rarely works as expected, which defeats one of the major intended benefits (i.e., only having to draw regions of the screen that have changed). Draw() is also slower than DrawAll(), which baffles me, and must be a bug.
"NewManLiving" wrote:
As far as your statement concerning "many if not most 2d implementations" i'm not quite clear what you mean by this: the compositor is part of the 2d API for a very good reason.
This probably boils down to how I've implemented my base framework, which also allows me to draw the whole screen with a single line of code. Unless you're working with strictly bitmaps, and a fair number of them, in most cases, the compositor doesn't add a lot of benefit (for me). If the compositor supported text sprites, simple shape sprites, and scaling, I might be inclined to use it more often, but as it stands now, the only way to accomplish any of those is to create a completely separate bitmap in-memory before making it a sprite, and drawing text to an in-memory bitmap not only requires even more graphics memory, it also results in less than stellar results (bad anti-aliasing). Likewise, if I want to fade out a portion of the screen, the only way to do that is to create a bitmap the size I want to fade, and add it as a sprite to the compositor, instead of simply calling DrawRect() on the screen itself. If I want to partially fade the whole screen to emphasize a single sprite (like the fish info display in the Aquarium Screensaver), that's a whole lot of unnecessary graphics memory usage.
"NewManLiving" wrote:
Unfortunately, I get the impression that many people cannot figure out why.
Honestly, I think it was primarily added for game development, which I don't do. That being said, I have used it on a number of occasions. I just find it easier to draw directly to the screen in most cases.
"NewManLiving" wrote:
Lastly, our friend here was already using the compositor as I stated earlier, so naturally I answered his question in light of what he was already using
Which is a fair point, but he/she never mentioned using the compositor in this thread, so I'm not sure where you got that information. He/she mentioned a sprite, but that's a pretty standard term for an onscreen graphical element. Even still, it still goes back to my main point that, just because you're using the compositor doesn't mean that you have to use it for everything on screen.
Either way, I don't think you can actually grab a region from roScreen for drawing elsewhere on the screen or a bitmap. I haven't tried it recently, but the last time I tried that, it just returned a blank region. I'd be curious to know if it works now (I guess I could try it, but I'm far too lazy for that).
And finally, with all of that being said, I've run into some performance issues recently on the slower platforms that I'm hopeful may be resolved (or at least mitigated) by using the compositor, so I've been considering re-visiting it. When I get around to doing that, my tune may vary well change...
😉
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)