FreeBSD Manual Pages
RG_FEATURE(3) Library Functions Manual RG_FEATURE(3) NAME RG_Feature -- Agar-RG feature framework SYNOPSIS #include <agar/core.h> #include <agar/gui.h> #include <agar/map/rg.h> DESCRIPTION The RG_Feature element performs some operation on the surface of a RG_Tile(3). For example, a `Blur' filter may be implemented as a RG_Feature. The interface is defined by the RG_FeatureOps structure: typedef struct rg_feature_ops { const char *type; /* Feature name */ AG_Size len; /* Size of structure */ const char *desc; /* Feature description */ int flags; #define RG_FEATURE_AUTOREDRAW 0x01 /* Automatic redraw on edit */ void (*init)(void *self, RG_Tileset *set, int flags); int (*load)(void *self, AG_DataSource *ds); void (*save)(void *self, AG_DataSource *ds); void (*destroy)(void *self); void (*apply)(void *self, RG_Tile *tile, int x, int y); void (*menu)(void *self, AG_MenuItem *menu); AG_Toolbar *(*toolbar)(void *self, RG_Tileview *view); AG_Window *(*edit)(void *self, RG_Tileview *view); } The init(), load(), save(), destroy() and edit() operations are analo- gous to the AG_Object(3) operations of the same name. init() must in- voke RG_FeatureInit(). The menu() and toolbar() operations, where not NULL, generate and re- turn AG_Menu(3) items and an AG_Toolbar(3), respectively, for the GUI. The apply() operation performs the actual modification on the tile. The x and y arguments are specific to the instance of this feature and may be ignored. INTERFACE void RG_FeatureInit(void *feature, RG_Tileset *ts, int flags, const RG_FeatureOps *featureOps) void RG_FeatureAddPixmap(RG_Feature *feature, RG_Pixmap *pixmap) void RG_FeatureAddSketch(RG_Feature *feature, RG_Sketch *sketch) void RG_FeatureDelPixmap(RG_Feature *feature, RG_Pixmap *pixmap) void RG_FeatureDelSketch(RG_Feature *feature, RG_Sketch *sketch) The RG_FeatureInit() function initializes a derivate of the RG_Feature structure, described by the ops structure (see "DESCRIPTION" section). The following flags are defined: RG_FEATURE_AUTOREDRAW Periodically redraw target tile when feature is undergoing edition. Features occasionally need to reference other resources in the current RG_Tileset. The RG_FeatureAddPixmap() and RG_FeatureAddSketch() func- tions add a reference to a pixmap or sketch, respectively. RG_FeatureDelPixmap() and RG_FeatureDelSketch() remove the given refer- ence. SEE ALSO RG(3), RG_Anim(3), RG_Pixmap(3), RG_Sketch(3), RG_Texture(3), RG_Tile(3), RG_Tileview(3) Agar 1.7 December 21, 2022 RG_FEATURE(3)
NAME | SYNOPSIS | DESCRIPTION | INTERFACE | SEE ALSO
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=RG_Feature&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>
