[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

When working directly with graphics, the interface is based on View and
ViewPort structures, rather than on Intuition's Screen structure.  As
previously mentioned, new information must be associated with the ViewPort
to specify the new Release 2 modes, and also with the View to specify what
virtual monitor the whole View will be displayed on.  There is also a lot
of information to associate with a ViewPort regarding enhanced genlock

This association of this new data with the View is made through a display
database system which has been added to the Release 2 graphics library.
All correctly written programs that allocate a ColorMap structure for a
ViewPort use the GetColorMap() function to do it.  Hence, in Release 2 the
ColorMap structure is used as the general purpose black box extension of
the ViewPort data.

To set or obtain the data in the extended structures, Release 2 provides a
new function named VideoControl() which takes a ColorMap as an argument.
This allows the setting and getting of the new extended display data.
This mechanism is used to associate a DisplayInfo handle (not a ModeID)
with a ViewPort.  A DisplayInfo handle is an abstract link to the display
database area associated with a particular ModeID.  This handle is passed
to the graphics database functions when getting or setting information
about the mode. Using VideoControl(), a program can enable, disable, or
obtain the state of a ViewPort's ColorMap, mode, genlock and other
features.  The function uses a tag based interface and returns NULL if no
error occurred.

    error = BOOL VideoControl( struct ColorMap *cm, struct TagItem *tag );

The first argument is a pointer to a ColorMap structure as returned by the
GetColorMap() function.  The second argument is a pointer to an array of
video control tag items, used to indicate whether information is being
given or requested as well as to pass (or receive the information).  The
tags you can use with VideoControl() include the following:

VTAG_ATTACH_CM_GET (or _SET) is used to obtain the ColorMap structure from
the indicated ViewPort or attach a given ColorMap to it.

VTAG_VIEWPORTEXTRA_GET (or _SET) is used to obtain the ViewPortExtra
structure from the indicated ColorMap structure or attach a given
ViewPortExtra to it.  A ViewPortExtra structure is an extension of the
ViewPort structure and should be allocated and freed with GfxNew() and
GfxFree() and associated with the ViewPort with VideoControl().

VTAG_NORMAL_DISP_GET (or _SET) is used to obtain or set the DisplayInfo
structure for the standard or "normal" mode.

See <graphics/videocontrol.h> for a list of all the available tags.  See
the section on genlocking for information on using VideoControl() to
interact with the Amiga's genlock capabilities.  Note that the graphics
library will modify the tag list passed to VideoControl().

[Back to Amiga Developer Docs]