Class architecture

A 2D graphic is cached by passing it to the TCachedGraphic constructor any time before you draw it and when you can afford the overhead. As shown in Figure 128, TCachedGraphic descends from MGraphic and takes an MGraphic as a parameter. This architecture means that any instance that derives from MGraphic can be cached, and that the cached graphic can be passed to any function that takes an MGraphic as a parameter. Because TCachedGraphic derives from MGraphic, it inherits the MGraphic functions described in Chapter 3, some of which have been overridden in TCachedGraphic to better accommodate caching; that is, the cache is regenerated whenever the TCachedGraphic instance is transformed or the attribute bundle is changed.

NOTE If the TCachedGraphic is frequently transformed or changes to the attribute bundle are made often, then it is really not a good candidate for caching.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker