ggiOvlAttach

Name

ggiOvlAttach, ggiOvlDetach -- Enable the LibOvl API on a LibGGI visual

Synopsis

#include <ggi/ovl.h>

int ggiOvlAttach(ggi_visual_t vis ggiGA_resource_list *reslist);

int ggiOvlDetach(ggi_visual_t vis);

Description

ggiOvlAttach extends a visual such that the LibOvl API may be used on the visual handle. This function must be called before using other LibOvl functions on the visual handle. The parameter reslist is a pointer to a LibGAlloc resource list kept by the application, and such an object must exist and be passed here in order to use the simple-form ggiOvlCreate* functions.

ggiOvlDetach cleans up all state associated with using the LibOvl API on this visual. The visual is stripped of any active LibOvl objects. Note, however, that the objects themselves are not currently guaranteed to be destroyed and may still exist, consuming resources. Behavior of these objects is at this point undefined. They should be destroyed before calling ggiOvlDetach.

Return value

Both functions return 0 for OK, otherwise an error code.

Examples

Example 1. Activate LibOvl such that the ggiOvlCreate* functions work


ggiGA_resource_list reslist;

reslist = NULL;
ggiOvlInit();
ggiOvlAttach(vis, &reslist);

/* Do some libovl stuff */

ggiOvlDetach(vis);
ggiOvlExit();