Tank resource properties

Name

ggiGA_tank_props : Tank resource properties

Synopsis

#include <ggi/ga_prop.h>

struct ggiGA_tank_props {

      union {
              ggi_coord area;
              uint32_t linear;
      } buf_snap;

      /* A vague description of the buffer pixel format */
      ggi_graphtype gt;

      /* Pointer to a *shared* detailed description of the pixel format */
      ggi_directbuffer *db;

      /* Pointers to access buffer data.
         These are surrogates to the pointers in the shared *db */
      void *read, *write;
};

Description

A tank resource represents data to be moved by a motor. The tank properties describe the layout this data is stored with. They are accessible under the union member sub.tank. The common properties member size refers to the size of the data stored in the tank; the units are usually pixels, but it depends on the type of the resource. The qty field requests several of the same sized objects, or, if set to 'GGI_AUTO' (zero), will grab as many of the resources as will fit.

Buffer Layout

A standard ggi_graphtype(3) for the tank data is provided for in the gt member. Also, a pointer to a standard ggi_directbuffer(3) structure is provided for in the db member (this db structure is often shared between many resources, and so should not be freed.) Separate pointers to access the data in the tank for read and write access are provided. These are to be used instead of the read and write pointers in the directbuffer structure.

Buffer Snap

Within the buffer space allocated for a tank, there may be a snap grid (as described above for motors) or linear alignment restriction on operations performed on the data, such that those operations can only address data starting at certain locations in the buffer. The buf_snap member provides an embelishment of the db member's alignment restrictions, and may be addressed as a vector (sub.tank.buf_snap.area.x, sub.tank.buf_snap.area.y), or as a linear quantity (sub.tank.buf_snap.linear).

See Also