Undo System Usage

Undo System Usage

Undo System Usage

Undo System Usage

The following example shows how to make use of the undo and redo system. It organizes the construction of the SilverScreen castle drawing into sections, then allows the user to undo and redo its construction. Note that SilverScreen commands, for instance begin polygon, record the necessary undo/redo state information automatically when the undo system is initialized and the commands are nested within an undo_begin/undo_end pair. Note too that you may group multiple commands together into a single logical unit by carefully nesting the undo_begin and undo_end pairs.