in what situation and what are the benefits of using layers when drawing an UI object?
I see at the end of the jgraphics.h file there are five functions defined:
I understand that in situation when you want the same drawing tiled or repeated over and over layers are the way to go, but what does JGraphics do under the hood? Is it all transformed in a surface and then only the actual pixels of the surface are copied over and over ? I can see this being more efficient… But would layers be useful in situation other than tiling or repeating ? (i.e. for instance for drawing a button when you can have a "Button On" and a "Button Off" layer and alternate between the two? In this case I don’t see any performance gains, but are there other gains I cannot see?
This question arose from looking at the source code of the ICST objects which make frequent use of layers.
As far as I am concerned I always just create the old plain graphic context and then do all the drawing in there, but I was wondering if maybe the layer strategy is a better one.
Thanks for any comment, clarification, advice.
The reason for layers in the ambimonitor external is that it prevents having to redraw static parts of the surface every time a redraw occurs — so it is much more efficient.
C74 RSS Feed | © Copyright Cycling '74