Go to the first, previous, next, last section, table of contents.

Display Update

Usually the interface's display is controlled by the player, but when run_game is executing, it will frequently change the state of an object in a way that needs to be reflected in the display immediately. Examples include units leaving or entering a cell, sides losing or winning, and so forth. The interface must define a set of callbacks that will be invoked by the kernel.

Each of these routines has a flag indicating whether the change may be buffered or not. To ensure that buffered data is actually onscreen, the kernel may call flush_display_buffers(), which the interface must define.

These may or may not be called on reasonable sides, so the interface should always check first that side actually exists and has an active display. [If side has a "remote" display, then interface has to forward?? No, because remote copy of game is synchronized and does own update_xxx calls more-or-less simultaneously]

Note that this is as much as the kernel interests itself in displays. Map, list, etc drawing and redrawing are under the direct control of the interface code.

Unix-hosted versions must provide void close_displays() for signal handlers to call.


Go to the first, previous, next, last section, table of contents.