There are several structures and types defined by Allegro which are used in many functions (like the BITMAP structure). This section of the manual describes their useful content from a user point of view when they don't fit very well any of the existing manual sections, and redirects you to the appropiate section when it's already described there. Note that unless stated otherwise, the contents shown here are just for read only purposes, there might be other internal flags, but you shouldn't depend on them being available in past/future versions of Allegro.
See also: Fixed point math routines.
There is some other stuff in the structure as well, but it is liable to change and you shouldn't use anything except the above. The w and h fields can be used to obtain the size of an existing bitmap:int w, h; - size of the bitmap in pixels int clip; - non-zero if clipping is turned on int cl, cr, ct, cb; - clip rectangle left, right, top, and bottom unsigned char *line[]; - pointers to the start of each line
The clipping rectangle is inclusive on the left and top (0 allows drawing to position 0) but exclusive on the right and bottom (10 allows drawing to position 9, but not to 10). Note this is not the same format as you pass to set_clip(), which takes inclusive coordinates for all four corners. All the values of this structure should be regarded as read-only, with the exception of the line field, whose access is described in depth in the "Direct access to video memory" section of the manual. If you want to modify the clipping region, please refrain from changing this structure, use set_clip() instead.bmp = load_bitmap("file.bmp", pal); allegro_message("Bitmap size: (%dx%d)\n", bmp->w, bmp->h);
See also: create_bitmap, set_clip, bitmap_color_depth, RLE_SPRITE, COMPILED_SPRITE, Direct access to video memory.
RLE sprites store the image in a simple run-length encoded format, where repeated zero pixels are replaced by a single length count, and strings of non-zero pixels are preceded by a counter giving the length of the solid run. Read chapter "RLE sprites" for a description of the restrictions and how to obtain/use this structure.int w, h; - width and height in pixels int color_depth; - color depth of the image
See also: get_rle_sprite, BITMAP, COMPILED_SPRITE, RLE sprites.
Compiled sprites are stored as actual machine code instructions that draw a specific image onto a bitmap, using mov instructions with immediate data values. Read chapter "Compiled sprites" for a description of the restrictions and how to obtain/use this structure.short planar; - set if it's a planar (mode-X) sprite short color_depth; - color depth of the image short w, h; - size of the sprite
See also: get_compiled_sprite, BITMAP, RLE_SPRITE, Compiled sprites.
Read chapter "Joystick routines" for a description on how to obtain/use this structure.int flags; - status flags for this joystick int num_sticks; - how many stick inputs? int num_buttons; - how many buttons? JOYSTICK_STICK_INFO stick[n]; - stick state information JOYSTICK_BUTTON_INFO button[n]; - button state information
See also: joy, Joystick routines.
Read chapter "Joystick routines" for a description on how to obtain/use this structure.int b; - boolean on/off flag char *name; - description of this button
See also: joy, Joystick routines.
Read chapter "Joystick routines" for a description on how to obtain/use this structure.int flags; - status flags for this input int num_axis; - how many axis do we have? JOYSTICK_AXIS_INFO axis[n]; - axis state information char *name; - description of this input
See also: joy, Joystick routines.
Read chapter "Joystick routines" for a description on how to obtain/use this structure.int pos; - analogue axis position int d1, d2; - digital axis position char *name; - description of this axis
See also: joy, Joystick routines.
Structure returned by get_gfx_mode_list, which contains an array of GFX_MODE structures.int num_modes; GFX_MODE *mode;
See also: GFX_MODE, get_gfx_mode_list.
Structure contained in GFX_MODE_LIST.int width, height, bpp;
See also: GFX_MODE_LIST, get_gfx_mode_list.
See also: RGB, Palette routines.
Palette entry. Read chapter "Palette routines" for a description on how to obtain/use this structure.unsigned char r, g, b;
See also: Palette routines, PALETTE.
A vertex structure used by polygon3d and other polygon rendering functions. Read the description of polygon3d for a description on how to obtain/use this structure.fixed x, y, z; - position fixed u, v; - texture map coordinates int c; - color
See also: V3D_f, polygon3d, Fixed point trig.
Like V3D but using float values instead of fixed ones.float x, y, z; - position float u, v; - texture map coordinates int c; - color
See also: V3D, polygon3d, Fixed point trig.
Read chapter "Transparency and patterned drawing", section "256 color transparency" for a description on how to obtain/use this structure.unsigned char data[PAL_SIZE][PAL_SIZE];
See also: 256 color transparency, color_map.
Read chapter "Converting between color formats" for a description on how to obtain/use this structure.unsigned char data[32][32][32];
See also: Converting between color formats, create_rgb_table.
Read the description of al_findfirst for a description on how to obtain/use this structure.int attrib; - actual attributes of the file found time_t time; - modification time of file long size; - size of file char name[512]; - name of file
See also: al_findfirst.
Read chapter "Datafile routines", section "Using datafiles" for a description on how to obtain/use this structure.void *dat; - pointer to the actual data int type; - type of the data long size; - size of the data in bytes void *prop; - list of object properties
See also: load_datafile, Using datafiles.
Fixed point matrix structure. Read chapter "3D math routines" for a description on how to obtain/use this structure.fixed v[3][3]; - 3x3 scaling and rotation component fixed t[3]; - x/y/z translation component
See also: MATRIX_f, 3D math routines.
Floating point matrix structure. Read chapter "3D math routines" for a description on how to obtain/use this structure.float v[3][3]; - 3x3 scaling and rotation component float t[3]; - x/y/z translation component
See also: MATRIX, 3D math routines.
Read chapter "Quaternion math routines" for a description on how to obtain/use this structure.float w, x, y, z;
See also: Quaternion math routines.
This is the structure which contains a GUI object. Read chapter "GUI routines" for a description on how to obtain/use this structure.int (*proc)(int, DIALOG *, int); - dialog procedure (message handler) int x, y, w, h; - position and size of the object int fg, bg; - foreground and background colors int key; - ASCII keyboard shortcut int flags; - flags about the status of the object int d1, d2; - whatever you want to use them for void *dp, *dp2, *dp3; - pointers to more object-specific data
See also: do_dialog, GUI routines.
Structure used to hold an entry of a menu. Read chapter "GUI routines", section "GUI menus" for a description on how to obtain/use this structure.char *text; - the text to display for the menu item int (*proc)(); - called when the menu item is clicked struct MENU *child; - nested child menu int flags; - disabled or checked state void *dp; - pointer to any data you need
See also: do_menu, GUI menus.
See also: init_dialog, update_dialog, shutdown_dialog, GUI routines.
See also: init_menu, update_menu, shutdown_menu, GUI menus.
See also: font.
See also: Zbuffered rendering, BITMAP.
A sample structure, which holds sound data, used by the digital sample routines.int bits; - 8 or 16 int stereo; - sample type flag int freq; - sample frequency int priority; - 0-255 */ unsigned long len; - length (in samples) unsigned long loop_start; - loop start position unsigned long loop_end; - loop finish position
See also: load_sample, Digital sample routines.
See also: load_midi, Music routines (MIDI).
See also: play_audio_stream, Audio stream routines.
A packfile structure, similar to a stdio.h FILE structure. Read chapter "Packfile functions" for a description on how to obtain/use this structure.int hndl; - DOS file handle int flags; - PACKFILE_FLAG_* constants char *filename; - name of the file
See also: pack_fopen, Packfile functions.