ggiBufAttach, ggiBufDetach : Enable the LibGGIBuf API on a LibGGI visual
#include <ggi/buf.h> int ggiBufAttach(ggi_visual_t vis, ggiGA_resource_list *reqlist); int ggiBufDetach(ggi_visual_t vis);
ggiBufAttach extends the visual vis such that the LibGGIBuf API may be used on the visual handle. This function must be called before using other LibGGIBuf 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 to ggiBltAttach in order to use the simple-form ggiBufCreate* functions.
ggiBufDetach cleans up all state associated with using the LibGGIBuf API on the visual vis. The visual is stripped of any active buffers. Note, however, that the buffers are not themselves currently guaranteed to be destroyed and may still exist as objects, consuming resources. Behavior of these objects is at this point undefined. They should be destroyed before calling ggiBufDetach.
Both functions return 0 for OK, otherwise an error code.
Activate LibBuf such that the ggiBufCreate* functions work:
ggiGA_resource_list reslist; reslist = NULL; ggiBufInit(); ggiBufAttach(vis, &reslist); /* Do some libbuf stuff */ ggiBufDetach(vis); ggiBufExit();