BMAP* name = "filename";

BMAP* name = "filename#(x)#(y)#(width)#(height)";

BMAP* name = "#(width)x(height)x(bits)";

Defines a bitmap pointer with the given name. The pointer is set to an image file (see file formats for valid image files), to a rectangular part of an image file, or to a black bitmap with a given width, height, and color depth. Empty bitmaps can then set to a certain color by bmap_fill. Bitmaps are mostly used for 2D elements or for render targets.


filename Name of an image file (without path).
#(x)#(y)#(width)#(height) A7.7 Defines a rectangular cutout of the image, at position x,y with the given width and height in pixels. This way small buttons or icons can be put together in a single image. The image must be in PCX, BMP, or TGA format.
#(width)x(height)x(bits)  LC  A '#' character followed by the bitmap width, height and color depth separated by 'x' characters. For the color depth, the number of bits per pixel can be given. Valid values are 8, 12, 14, 16, 24, 32, 64, or 128. Color depth 32 creates a 32 bit alpha channel image. A7.1 Color depth 12 creates a 16 bit floating point texture, and color depth 14 creates a 32 bit floating point texture.

The BMAP struct is defined in include\atypes.h. Use bmap_create() for creating a bmap object at runtime.


BMAP* bTest = "test.pcx"; // define a bitmap from the image test.pcx
BMAP* bBlack = "#200x100x32"; // define a 200x100 pixel bitmap of 32 bits per pixel BMAP* bButton = "buttons.pcx#128#20#32#32"; // defines a 32x32 cutout from a larger image.

See also:

FONT, file formats, bmap_fill, bmap_create

► latest version online