Agar

<-- Back to AG_Intro.3

SYNOPSIS

#include <agar/core.h>
#include <agar/gui.h>
#include <agar/map/rg.h>

DESCRIPTION

The Agar-RG library implements a feature-based pixel graphic format. The central class of the library is RG_Tileset, which acts as a container for graphics resources:
TilesGraphic surfaces (static or possibly animated) generated from a set of instructions (or features). See RG_Tile(3).
TexturesReferences to tiles with additional information related to texturing. See RG_Texture(3).
PixmapsTransparent graphic surfaces used internally. Pixmaps can be shared by multiple tiles. See RG_Pixmap(3).
SketchesVector drawings used internally. See RG_Sketch(3).

RG provides tiles and textures with unique integer IDs such that items can be added or removed on the fly without invalidating existing external references. To take advantage of this feature, code should reference tiles using the tiletbl member of the RG structure.

INHERITANCE HIERARCHY

AG_Object(3)-> RG_Tileset

INITIALIZATION


RG_Tileset * RG_TilesetNew (void *parent, const char *name, Uint flags)


The RG_TilesetNew() function allocates and initializes a new RG object and attaches it to parent if not NULL. There are currently no flags defined.

ACCESSING RESOURCES


RG_Tile* RGTILE (RG_Tileset *tileset, Uint32 tileID)

int RG_LookupTile (RG_Tileset *tileset, Uint32 tileID, RG_Tile **rTile)

RG_Tile * RG_TilesetFindTile (RG_Tileset *tileset, const char *name)

RG_Sketch * RG_TilesetFindSketch (RG_Tileset *tileset, const char *name)

RG_Pixmap * RG_TilesetFindPixmap (RG_Tileset *tileset, const char *name)

RG_Tile * RG_TilesetResvTile (RG_Tileset *tileset, const char *tileset_name, const char *name)

RG_Pixmap * RG_TilesetResvPixmap (RG_Tileset *tileset, const char *tileset_name, const char *name)


The RGTILE() macro returns a tile by name.

RG_LookupTile() searches for a tile by name. If one is found, it is returned into rTile.

RG_TilesetFindTile(), RG_TilesetFindSketch() and RG_TilesetFindPixmap() search for the given resource using the user-provided name string, returning a pointer to the element on success and NULL on failure. The RG_TilesetResv*() variants use the VFS path name for the RG object itself.

SEE ALSO

RG_Feature(3), RG_Pixmap(3), RG_Sketch(3), RG_Texture(3), RG_Tile(3), RG_Tileview(3)

HISTORY

The RG library first appeared in Agar 1.3.0.
Csoft.net ElectronTubeStore