next up previous contents
Next: objects. Up: Display objects Previous: Device-Specific Rendering.

Drawing Tokens.

DispCmd objects are used by Displayable objects to construct a list of drawing commands (tokens) in a format which can be processed by a DisplayDevice. When rendering an image, a DisplayDevice does not work directory with a Displayable; instead, the DisplayDevice is given a simple byte array into which drawing commands have been assembled. Each Displayable contains one or more of these drawing lists; they are stored by the Scene and processed by the render routine of a DisplayDevice. The DispCmd objects act to put the data into these drawing lists in the proper format for the operation specified. Each DispCmd object appends its data to the current end of a provided drawing list in this format and order:

  1. Integer code specifying the drawing operation (codes are defined in the file DispCmds.h).
  2. Integer stating the size of the command, in bytes (not including the code or this size count).
  3. Data necessary for the drawing command (i.e., XYZ positions of the endpoints of a line or a cylinder).
Why are things done this way? There are a few reasons:
next up previous contents
Next: objects. Up: Display objects Previous: Device-Specific Rendering.

Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999