Unit Allegro5

Description

Wrapper of the Allegro 5 core library.

This unit defines core functions, procedures and data types, that aren't in add-ons.

Overview

Classes, Interfaces, Objects and Records

Name Description
Record ALLEGRO_TIMEOUT Represents a timeout value.
Record ALLEGRO_COLOR An ALLEGRO_COLOR structure describes a color in a device independant way.
Record ALLEGRO_FILE_INTERFACE A structure containing function pointers to handle a type of "file", real or virtual.
Record ALLEGRO_LOCKED_REGION Users who wish to manually edit or read from a bitmap are required to lock it first.
Record ALLEGRO_EVENT_SOURCE An event source is any object which can generate events.
Record ALLEGRO_ANY_EVENT Contains the common information about events.
Record ALLEGRO_DISPLAY_EVENT Contains display events information.
Record ALLEGRO_JOYSTICK_EVENT Contains the joystick events information.
Record ALLEGRO_KEYBOARD_EVENT Contains the keyboard events information.
Record ALLEGRO_MOUSE_EVENT Contains the mouse events information.
Record ALLEGRO_TIMER_EVENT Contains the timer events information.
Record ALLEGRO_TOUCH_EVENT Contains the touch input events information.
Record ALLEGRO_USER_EVENT  
Record ALLEGRO_EVENT An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
Record ALLEGRO_DISPLAY_MODE  
Record ALLEGRO_JOYSTICK_STATE  
Record ALLEGRO_KEYBOARD_STATE Holds a "snapshot" of keyboard.
Record ALLEGRO_MOUSE_STATE Stores mouse state.
Record ALLEGRO_MEMORY_INTERFACE Used to define the memory management functions.
Record ALLEGRO_MONITOR_INFO  
Record ALLEGRO_TRANSFORM  
Record ALLEGRO_STATE Opaque type which is passed to al_store_state/al_restore_state.

Functions and Procedures

FUNCTION al_get_allegro_version: AL_UINT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_run_main (argc: AL_INT; argv: AL_POINTER; user_main: ALLEGRO_USER_MAIN): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION AL_ID (CONST str: SHORTSTRING): AL_INT;
FUNCTION al_get_time: AL_DOUBLE; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_rest (seconds: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_init_timeout (OUT timeout: ALLEGRO_TIMEOUT; seconds: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_map_rgb (r, g, b: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_map_rgba (r, g, b, a: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_map_rgb_f (r, g, b: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_map_rgba_f (r, g, b, a: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_premul_rgba (r, g, b: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_premul_rgba_f (r, g, b: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unmap_rgb (color: ALLEGRO_COLOR; OUT r, g, b: AL_UCHAR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unmap_rgba (color: ALLEGRO_COLOR; OUT r, g, b, a: AL_UCHAR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unmap_rgb_f (color: ALLEGRO_COLOR; OUT r, g, b: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unmap_rgba_f (color: ALLEGRO_COLOR; OUT r, g, b, a: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel_size (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel_format_bits (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel_block_size (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel_block_width (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel_block_height (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_bitmap_format (format: ALLEGRO_PIXEL_FORMAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_bitmap_flags (flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_bitmap_format: ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_bitmap_flags: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_add_new_bitmap_flag (flag: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_width (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_height (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_format (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_flags (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_bitmap (w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_put_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_put_blended_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_pixel (bitmap: ALLEGRO_BITMAPptr; x, y: AL_INT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_convert_mask_to_alpha (bitmap: ALLEGRO_BITMAPptr; mask_color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_clipping_rectangle (x, y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_reset_clipping_rectangle; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_clipping_rectangle (OUT x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_sub_bitmap (parent: ALLEGRO_BITMAPptr; x, y, w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_sub_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_parent_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_x (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_bitmap_y (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_reparent_bitmap (bitmap, parent: ALLEGRO_BITMAPptr; x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_clone_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_convert_bitmap (bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_convert_memory_bitmap; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_bitmap (bitmap: ALLEGRO_BITMAPptr; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_bitmap_region (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_tinted_scaled_rotated_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh: AL_FLOAT; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_new (CONST s: AL_STR): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_new_from_buffer (CONST s: AL_STRptr; size: AL_SIZE_T): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_ustr_free (us: ALLEGRO_USTRptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_cstr (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_ustr_to_buffer (CONST us: ALLEGRO_USTRptr; buffer: AL_STRptr; size: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_cstr_dup (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_dup (CONST us: ALLEGRO_USTRptr): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_dup_substr (CONST us: ALLEGRO_USTRptr; start_pos, end_pos: AL_INT): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_empty_string: ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ref_cstr (OUT info: ALLEGRO_USTR_INFO; CONST s: AL_STR): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ref_buffer (OUT info: ALLEGRO_USTR_INFO; CONST s: AL_STRptr; size: AL_SIZE_T): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ref_ustr (OUT info: ALLEGRO_USTR_INFO; CONST us: ALLEGRO_USTRptr; star_pos, end_pos: AL_INT): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_size (CONST us: ALLEGRO_USTRptr): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_length (CONST us: ALLEGRO_USTRptr): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_offset (CONST us: ALLEGRO_USTRptr;index: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_next (CONST us: ALLEGRO_USTRptr; VAR aPos: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_prev (CONST us: ALLEGRO_USTRptr; VAR aPos: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_assign (us1: ALLEGRO_USTRptr; CONST us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_assign_cstr (us1: ALLEGRO_USTRptr; CONST s: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_equal (CONST us1, us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_compare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ustr_ncompare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fopen (CONST path, mode: AL_STR): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fopen_interface ( CONST vt: ALLEGRO_FILE_INTERFACEptr; CONST path, mode: AL_STR ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_file_handle ( CONST vt: ALLEGRO_FILE_INTERFACEptr; userdata: AL_POINTER ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fclose (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fread (f: ALLEGRO_FILEptr; ptr: AL_POINTER; size: AL_SIZE_T): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fwrite (f: ALLEGRO_FILEptr; CONST ptr: AL_POINTER; size: AL_SIZE_T): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fflush (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ftell (f: ALLEGRO_FILEptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fseek (f: ALLEGRO_FILEptr; offset: AL_INT64; whence: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_feof (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ferror (f: ALLEGRO_FILEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ferrmsg (f: ALLEGRO_FILEptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_fclearerr (f: ALLEGRO_FILEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fungetc (f: ALLEGRO_FILEptr; c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fsize (f: ALLEGRO_FILEptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fgetc (f: ALLEGRO_FILEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fputc (f: ALLEGRO_FILEptr; c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fread16le (f: ALLEGRO_FILEptr): AL_INT16; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fread16be (f: ALLEGRO_FILEptr): AL_INT16; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fwrite16le (f: ALLEGRO_FILEptr; w: AL_INT16): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fwrite16be (f: ALLEGRO_FILEptr; w: AL_INT16): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fread32le (f: ALLEGRO_FILEptr): AL_INT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fread32be (f: ALLEGRO_FILEptr): AL_INT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fwrite32le (f: ALLEGRO_FILEptr; l: AL_INT32): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fwrite32be (f: ALLEGRO_FILEptr; l: AL_INT32): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fgets (f: ALLEGRO_FILEptr; CONST p: AL_STRptr; max: AL_SIZE_T): AL_STRptr CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fget_ustr (f: ALLEGRO_FILEptr): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fputs (f: ALLEGRO_FILEptr; CONST p: AL_STR): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_fopen_slice ( fp: ALLEGRO_FILEptr; initial_size: AL_SIZE_T; CONST mode: AL_STR ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_file_interface: ALLEGRO_FILE_INTERFACEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_file_interface (CONST file_interface: ALLEGRO_FILE_INTERFACEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_standard_file_interface; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_file_userdata (f: ALLEGRO_FILEptr): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_register_bitmap_loader (CONST ext: AL_STR; loader: ALLEGRO_IIO_LOADER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_register_bitmap_saver (CONST ext: AL_STR; saver: ALLEGRO_IIO_SAVER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_register_bitmap_loader_f (CONST ext: AL_STR; fs_loader: ALLEGRO_IIO_FS_LOADER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_register_bitmap_saver_f (CONST ext: AL_STR; fs_saver: ALLEGRO_IIO_FS_SAVER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_register_bitmap_identifier (CONST ext: AL_STR; identifier: ALLEGRO_IIO_IDENTIFIER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_bitmap (CONST filename: AL_STR): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_bitmap_flags (CONST filename: AL_STR; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_bitmap_f (fp: ALLEGRO_FILEptr; CONST ident: AL_STRptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_bitmap_flags_f ( fp: ALLEGRO_FILEptr; CONST ident: AL_STR; flags: AL_INT ): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_save_bitmap (CONST filename: AL_STR; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_save_bitmap_f ( fp: ALLEGRO_FILEptr; CONST ident: AL_STR; bitmap: ALLEGRO_BITMAPptr ): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_identify_bitmap_f (fp: ALLEGRO_FILEptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_identify_bitmap (CONST filename: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_lock_bitmap (bitmap: ALLEGRO_BITMAPptr; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_lock_bitmap_region (bitmap: ALLEGRO_BITMAPptr; x, y, width, height: AL_INT; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_lock_bitmap_blocked (bitmap: ALLEGRO_BITMAPptr; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_lock_bitmap_region_blocked (bitmap: ALLEGRO_BITMAPptr; x_block, y_block, width_block, height_block, flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unlock_bitmap (bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_bitmap_locked (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_blend_color (color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_blender (OUT op: ALLEGRO_BLEND_OPERATIONS; OUT source, dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_blend_color: ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_separate_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE; alpha_op: ALLEGRO_BLEND_OPERATIONS; alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_separate_blender (OUT op: ALLEGRO_BLEND_OPERATIONS; OUT source, dest: ALLEGRO_BLEND_MODE; OUT alpha_op: ALLEGRO_BLEND_OPERATIONS; OUT alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION ALLEGRO_EVENT_TYPE_IS_USER (t: ALLEGRO_EVENT_TYPE): AL_BOOL; INLINE;
FUNCTION ALLEGRO_GET_EVENT_TYPE (CONST str: SHORTSTRING): AL_INT; INLINE;
PROCEDURE al_init_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_emit_user_event ( source: ALLEGRO_EVENT_SOURCEptr; Event: ALLEGRO_EVENTptr; dtor: ALLEGRO_EVENT_DTOR_PROC ): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unref_user_event (event: ALLEGRO_USER_EVENTptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_event_source_data (source: ALLEGRO_EVENT_SOURCEptr; data: AL_POINTER); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_event_source_data (CONST source: ALLEGRO_EVENT_SOURCEptr): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_event_queue: ALLEGRO_EVENT_QUEUEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_event_source_registered (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_register_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_unregister_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_pause_event_queue (queue: ALLEGRO_EVENT_QUEUEptr; pause: AL_BOOL); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_event_queue_paused (CONST queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_event_queue_empty (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_peek_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_drop_next_event (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_flush_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_wait_for_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_wait_for_event_timed (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; secs: AL_FLOAT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_wait_for_event_until (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; VAR timeout: ALLEGRO_TIMEOUT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_display (w, h: AL_INT): ALLEGRO_DISPLAYptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_display (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_display_flags (flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; value, importance: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_flags (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_display_flag (display: ALLEGRO_DISPLAYptr; flag: AL_INT; onoff: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_display_refresh_rate (refresh_rate: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_display_refresh_rate: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_display_flags: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_window_title (CONST title: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_window_title: AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_width (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_height (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_format (display: ALLEGRO_DISPLAYptr): ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_refresh_rate (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_orientation (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_toggle_display_flag (display: ALLEGRO_DISPLAYptr; flag: AL_INT; onoff: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_current_display: ALLEGRO_DISPLAYptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_target_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_target_backbuffer (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_backbuffer (display: ALLEGRO_DISPLAYptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_target_bitmap: ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_acknowledge_resize (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_resize_display (display: ALLEGRO_DISPLAYptr; width, height: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_flip_display; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_update_display_region (x, y, Width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_compatible_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_wait_for_vsync: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_event_source (display: ALLEGRO_DISPLAYptr): ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_display_icon (display: ALLEGRO_DISPLAYptr; icon: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_display_icons (display: ALLEGRO_DISPLAYptr; num_icons: AL_INT; VAR icons: ARRAY OF ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_display_adapter: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_display_adapter (adapter: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_new_window_position (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_new_window_position (OUT x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_window_position (display: ALLEGRO_DISPLAYptr; x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_window_position (display: ALLEGRO_DISPLAYptr; OUT x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_window_constraints (display: ALLEGRO_DISPLAYptr; min_w, min_h, max_w, max_h: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_window_constraints (display: ALLEGRO_DISPLAYptr; OUT min_w, min_h, max_w, max_h: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_window_title (display: ALLEGRO_DISPLAYptr; const title: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; VAR importance: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_reset_new_display_options; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_display_option (display: ALLEGRO_DISPLAYptr; option: ALLEGRO_DISPLAY_OPTIONS; value: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_option (display: ALLEGRO_DISPLAYptr; option: ALLEGRO_DISPLAY_OPTIONS): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_hold_bitmap_drawing (hold: AL_BOOL); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_bitmap_drawing_held: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_acknowledge_drawing_halt (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_acknowledge_drawing_resume (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_clipboard_text (display: ALLEGRO_DISPLAYptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_clipboard_text (display: ALLEGRO_DISPLAYptr; CONST text: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_clipboard_has_text (display: ALLEGRO_DISPLAYptr): AL_BOOL CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_config: ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_add_config_section (config: ALLEGRO_CONFIGptr; CONST name: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_config_value (config: ALLEGRO_CONFIGptr; CONST section, key, value: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_add_config_comment (config: ALLEGRO_CONFIGptr; CONST section, comment: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_config_value (CONST config: ALLEGRO_CONFIGptr; CONST section, key: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_config_file (CONST filename: AL_STR): ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_load_config_file_f (fp: ALLEGRO_FILEptr): ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_save_config_file (CONST filename: AL_STR; CONST config: ALLEGRO_CONFIGptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_save_config_file_f (fp: ALLEGRO_FILEptr; CONST config: ALLEGRO_CONFIGptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_config (config: ALLEGRO_CONFIGptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_remove_config_section (config: ALLEGRO_CONFIGptr; CONST section: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_remove_config_key (config: ALLEGRO_CONFIGptr; CONST section, key: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_first_config_section (CONST config: ALLEGRO_CONFIGptr; OUT iterator: ALLEGRO_CONFIG_SECTIONptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_next_config_section (VAR iterator: ALLEGRO_CONFIG_SECTIONptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_first_config_entry ( CONST config: ALLEGRO_CONFIGptr; CONST section: AL_STR; OUT iterator: ALLEGRO_CONFIG_ENTRYptr ): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_next_config_entry (VAR iterator: ALLEGRO_CONFIG_ENTRYptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_cpu_count: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_ram_size: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_clear_to_color (color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_clear_depth_buffer (x: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_draw_pixel (x, y: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_errno: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_errno (errnum: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_num_display_modes: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_display_mode (index: AL_INT; OUT mode: ALLEGRO_DISPLAY_MODE): ALLEGRO_DISPLAY_MODEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_install_joystick: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_uninstall_joystick; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_joystick_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_reconfigure_joysticks: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_num_joysticks: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick (joyn: AL_INT): ALLEGRO_JOYSTICKptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_release_joystick (j: ALLEGRO_JOYSTICKptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_active (j: ALLEGRO_JOYSTICKptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_name (j: ALLEGRO_JOYSTICKptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_num_sticks (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_stick_flags (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_stick_name (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_num_axes (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_axis_name (j: ALLEGRO_JOYSTICKptr; stick, axis: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_num_buttons (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_button_name (j: ALLEGRO_JOYSTICKptr; buttonn: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_joystick_state (j: ALLEGRO_JOYSTICKptr; OUT ret_state: ALLEGRO_JOYSTICK_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_joystick_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_keyboard_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_install_keyboard: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_uninstall_keyboard; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_keyboard_leds (leds: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_keycode_to_name (keycode: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_keyboard_state (OUT ret_state: ALLEGRO_KEYBOARD_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_key_down (VAR state: ALLEGRO_KEYBOARD_STATE; keycode: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_keyboard_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_mouse_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_install_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_uninstall_mouse; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_num_buttons: AL_UINT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_num_axes: AL_UINT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_mouse_xy (display: ALLEGRO_DISPLAYptr; x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_mouse_z (z: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_mouse_w (w: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_mouse_axis (axis, value: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_get_mouse_state (OUT ret_state: ALLEGRO_MOUSE_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_mouse_button_down (VAR state: ALLEGRO_MOUSE_STATE; button: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_state_axis (VAR state: ALLEGRO_MOUSE_STATE; axis: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_cursor_position (OUT ret_x, ret_y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_grab_mouse (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_ungrab_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_mouse_wheel_precision (precision: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_wheel_precision: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_mouse_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_memory_interface (VAR iface: ALLEGRO_MEMORY_INTERFACE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_restore_memory_interface; INLINE;
FUNCTION al_malloc (CONST n: AL_SIZE_T): AL_POINTER; INLINE;
PROCEDURE al_free (p: AL_POINTER); INLINE;
FUNCTION al_realloc (p: AL_POINTER; CONST n: AL_SIZE_T): AL_POINTER; INLINE;
FUNCTION al_calloc (CONST c, n: AL_SIZE_T): AL_POINTER; INLINE;
FUNCTION al_malloc_with_context (n: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_free_with_context (ptr: AL_POINTER; line: AL_INT; CONST afile, func: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_realloc_with_context (ptr: AL_POINTER; n: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_calloc_with_context (n, count: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_num_video_adapters: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_monitor_info (adapter: AL_INT; OUT info: ALLEGRO_MONITOR_INFO): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_mouse_cursor (sprite: ALLEGRO_BITMAPptr; xfocus, yfocus: AL_INT): ALLEGRO_MOUSE_CURSORptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_mouse_cursor (cursor: ALLEGRO_MOUSE_CURSORptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor: ALLEGRO_MOUSE_CURSORptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_system_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor_id: ALLEGRO_SYSTEM_MOUSE_CURSOR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_show_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_hide_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_render_state (state: ALLEGRO_RENDER_STATE; value: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_use_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_use_projection_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_copy_transform (OUT dest: ALLEGRO_TRANSFORM; VAR src: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_identity_transform (OUT trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_build_transform (OUT trans: ALLEGRO_TRANSFORM; x, y, sx, sy, theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_build_camera_transform (OUT trans: ALLEGRO_TRANSFORM; position_x, position_y, position_z, look_x, look_y, look_z, up_x, up_y, up_z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_translate_transform (VAR trans: ALLEGRO_TRANSFORM; x, y: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_translate_transform_3d (VAR trans: ALLEGRO_TRANSFORM; x, y, z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_rotate_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_rotate_transform_3d (VAR trans: ALLEGRO_TRANSFORM; x, y, z, theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_scale_transform (VAR trans: ALLEGRO_TRANSFORM; sx, sy: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_scale_transform_3D (VAR trans: ALLEGRO_TRANSFORM; sx, sy, sz: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_transform_coordinates (VAR trans: ALLEGRO_TRANSFORM; OUT x, y: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_transform_coordinates_3d (VAR trans: ALLEGRO_TRANSFORM; OUT x, y, z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_compose_transform (VAR trans, other: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_current_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_current_inverse_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_current_projection_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_invert_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_check_inverse (VAR trans: ALLEGRO_TRANSFORM; tol: AL_FLOAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_orthographic_transform (VAR trans: ALLEGRO_TRANSFORM; left, top, n, right, bottom, f: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_perspective_transform (VAR trans: ALLEGRO_TRANSFORM; left, top, n, right, bottom, f: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_horizontal_shear_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_vertical_shear_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_create_shader (platform: ALLEGRO_SHADER_PLATFORM): ALLEGRO_SHADERptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_attach_shader_source (shader: ALLEGRO_SHADERptr; aType: ALLEGRO_SHADER_TYPE; CONST Source: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_attach_shader_source_file (shader: ALLEGRO_SHADERptr; aType: ALLEGRO_SHADER_TYPE; CONST filename: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_build_shader (shader: ALLEGRO_SHADERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_shader_log (shader: ALLEGRO_SHADERptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_shader_platform (shader: ALLEGRO_SHADERptr): ALLEGRO_SHADER_PLATFORM; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_use_shader (shader: ALLEGRO_SHADERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_shader (shader: ALLEGRO_SHADERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_sampler (CONST name: AL_STR; bitmap: ALLEGRO_BITMAPptr; aUnit: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_matrix (CONST name: AL_STR; VAR matrix: ALLEGRO_TRANSFORM): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_int (CONST name: AL_STR; i: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_float (CONST name: AL_STR; f: AL_FLOAT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_bool (CONST name: AL_STR; b: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_int_vector (CONST name: AL_STR; num_components: AL_INT; i: AL_INTptr; num_elems: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_set_shader_float_vector (CONST name: AL_STR; num_components: AL_INT; f: AL_FLOATptr; num_elems: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_default_shader_source (platform: ALLEGRO_SHADER_PLATFORM; aType: ALLEGRO_SHADER_TYPE): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_init: AL_BOOL;
FUNCTION al_install_system (version: AL_INT; atexit_ptr: AL_POINTER): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_uninstall_system; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_is_system_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_inhibit_screensaver (inhibit: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION ALLEGRO_USECS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;
FUNCTION ALLEGRO_MSECS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;
FUNCTION ALLEGRO_BPS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;
FUNCTION ALLEGRO_BPM_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;
FUNCTION al_create_timer (speed_secs: AL_DOUBLE): ALLEGRO_TIMERptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_destroy_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_start_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_stop_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_resume_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_timer_started (CONST timer: ALLEGRO_TIMERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_timer_speed (CONST timer: ALLEGRO_TIMERptr): AL_DOUBLE; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_timer_speed (timer: ALLEGRO_TIMERptr; speed_secs: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_timer_count (CONST timer: ALLEGRO_TIMERptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_set_timer_count (timer: ALLEGRO_TIMERptr; count: AL_INT64); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_add_timer_count (timer: ALLEGRO_TIMERptr; diff: AL_INT64); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
FUNCTION al_get_timer_event_source (timer: ALLEGRO_TIMERptr): ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_store_state (OUT state: ALLEGRO_STATE; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
PROCEDURE al_restore_state (VAR state: ALLEGRO_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Types

ALLEGRO_USER_MAIN = FUNCTION (argc: AL_INT; argv: AL_POINTER): AL_INT; CDECL;
ALLEGRO_PIXEL_FORMAT = (...);
ALLEGRO_BITMAPptr = AL_POINTER;
ALLEGRO_USTRptr = ˆALLEGRO_USTR;
ALLEGRO_USTR = _al_tagbstring;
ALLEGRO_USTR_INFOptr = ˆALLEGRO_USTR_INFO;
ALLEGRO_USTR_INFO = _al_tagbstring;
ALLEGRO_FILEptr = AL_POINTER;
ALLEGRO_FILE_INTERFACEptr = ˆALLEGRO_FILE_INTERFACE;
ALLEGRO_IIO_LOADER_FUNCTION = FUNCTION (CONST filename: AL_STR; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL;
ALLEGRO_IIO_FS_LOADER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL;
ALLEGRO_IIO_SAVER_FUNCTION = FUNCTION (CONST filename: AL_STR; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL;
ALLEGRO_IIO_FS_SAVER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL;
ALLEGRO_IIO_IDENTIFIER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr): AL_BOOL; CDECL;
ALLEGRO_LOCKED_REGIONptr = ˆALLEGRO_LOCKED_REGION;
ALLEGRO_BLEND_MODE = (...);
ALLEGRO_BLEND_OPERATIONS = (...);
ALLEGRO_EVENT_TYPE = AL_UINT;
ALLEGRO_DISPLAYptr = AL_POINTER;
ALLEGRO_JOYSTICKptr = AL_POINTER;
ALLEGRO_KEYBOARDptr = AL_POINTER;
ALLEGRO_MOUSEptr = AL_POINTER;
ALLEGRO_TIMERptr = AL_POINTER;
ALLEGRO_EVENT_SOURCEptr = ˆALLEGRO_EVENT_SOURCE;
ALLEGRO_USER_EVENT_DESCRIPTORptr = POINTER;
ALLEGRO_USER_EVENTptr = ˆALLEGRO_USER_EVENT;
ALLEGRO_EVENTptr = ˆALLEGRO_EVENT;
ALLEGRO_EVENT_DTOR_PROC = PROCEDURE (evt: ALLEGRO_USER_EVENTptr); CDECL;
ALLEGRO_EVENT_QUEUEptr = AL_POINTER;
ALLEGRO_DISPLAY_OPTIONS = (...);
ALLEGRO_CONFIGptr = AL_POINTER;
ALLEGRO_CONFIG_SECTIONptr = AL_POINTER;
ALLEGRO_CONFIG_ENTRYptr = AL_POINTER;
ALLEGRO_DISPLAY_MODEptr = ˆALLEGRO_DISPLAY_MODE;
ALLEGRO_JOYFLAGS = (...);
ALLEGRO_MONITOR_INFOptr = ˆALLEGRO_MONITOR_INFO;
ALLEGRO_MOUSE_CURSORptr = AL_POINTER;
ALLEGRO_SYSTEM_MOUSE_CURSOR = (...);
ALLEGRO_RENDER_STATE = (...);
ALLEGRO_TRANSFORMptr = ˆALLEGRO_TRANSFORM;
ALLEGRO_SHADERptr = AL_POINTER;
ALLEGRO_SHADER_TYPE = (...);
ALLEGRO_SHADER_PLATFORM = (...);
ALLEGRO_SYSTEMptr = AL_POINTER;

Constants

ALLEGRO_VERSION = 5;
ALLEGRO_SUB_VERSION = 2;
ALLEGRO_WIP_VERSION = 0;
ALLEGRO_RELEASE_NUMBER = 1;
ALLEGRO_VERSION_INT = ( (ALLEGRO_VERSION SHL 24) OR (ALLEGRO_SUB_VERSION SHL 16) OR (ALLEGRO_WIP_VERSION SHL 8) OR ALLEGRO_RELEASE_NUMBER );
ALLEGRO_PI = 3.14159265358979323846;
ALLEGRO_SEEK_SET = 0;
ALLEGRO_SEEK_CUR = 1;
ALLEGRO_SEEK_END = 2;
ALLEGRO_DISPLAY_ORIENTATION_UNKNOWN = 0;
ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES = 1;
ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES = 2;
ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES = 4;
ALLEGRO_DISPLAY_ORIENTATION_PORTRAIT = 5;
ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES = 8;
ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE = 10;
ALLEGRO_DISPLAY_ORIENTATION_ALL = 15;
ALLEGRO_DISPLAY_ORIENTATION_FACE_UP = 16;
ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN = 32;
ALLEGRO_DONTCARE = 0;
ALLEGRO_REQUIRE = 1;
ALLEGRO_SUGGEST = 2;
_ALLEGRO_PRIM_MAX_USER_ATTR = 10;
ALLEGRO_NEW_WINDOW_TITLE_MAX_SIZE = 255;
_AL_MAX_JOYSTICK_AXES = 3;
_AL_MAX_JOYSTICK_STICKS = 16;
_AL_MAX_JOYSTICK_BUTTONS = 32;
ALLEGRO_MOUSE_MAX_EXTRA_AXES = 4;
ALLEGRO_DEFAULT_DISPLAY_ADAPTER = -1;

Description

Functions and Procedures

FUNCTION al_get_allegro_version: AL_UINT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the (compiled) version of the Allegro library, packed into a single integer as groups of 8 bits.

You can use code like this to extract the version number:

  VAR
    Version: AL_INT;
    Major, Minor, Revision, Release: INTEGER;
    VersionStr: STRING;
  BEGIN
    Version := al_get_allegro_version;
    Major    :=  Version SHR 24;
    Minor    := (Version SHR 16) AND 255;
    Revision := (Version SHR  8) AND 255;
    Release  :=  Version         AND 255;
    VersionStr := Format ('%d.%d.%d(%d)', [Major, Minor, Revision, Release])
  END;

The release number is 0 for an unofficial version and 1 or greater for an official release. For example "5.0.2[1]" would be the (first) official 5.0.2 release while "5.0.2[0]" would be a compile of a version from the "5.0.2" branch before the official release.

FUNCTION al_run_main (argc: AL_INT; argv: AL_POINTER; user_main: ALLEGRO_USER_MAIN): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This function is useful in cases where you don't have a main function but want to run Allegro (mostly useful in a wrapper library). Under Windows and Linux this is no problem because you simply can call al_install_system. But some other system (like OSX) don't allow calling al_install_system in the main thread. al_run_main will know what to do in that case.

The passed argc and argv will simply be passed on to user_main and the return value of user_main will be returned.

Note: This is used because the way the C language works. I didn't test if Pascal do need this kind of stuff. Future versions of Allegro.pas would not include this function, so don't use it unless your really need to (and tell me if you really need it to remove this warning from documentation).

FUNCTION AL_ID (CONST str: SHORTSTRING): AL_INT;

This function can be used to create a packed 32 bit integer from 8 bit characters, on both 32 and 64 bit machines. These can be used for various things, like custom datafile objects or system IDs. Example:

VAR
  OSTYPE_LINUX: LONGINT;
BEGIN
  OSTYPE_LINUX := AL_ID('TUX ');
END;

FUNCTION al_get_time: AL_DOUBLE; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the number of seconds since the Allegro library was initialised. The return value is undefined if Allegro is uninitialised. The resolution depends on the used driver, but typically can be in the order of microseconds.

PROCEDURE al_rest (seconds: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Waits for the specified number of seconds.

This tells the system to pause the current thread for the given amount of time. With some operating systems, the accuracy can be in the order of 10ms. That is, even

    al_rest (0.000001)

might pause for something like 10ms. Also see the section on timer events (i.e. al_create_timer) for easier ways to time your program without using up all CPU.

PROCEDURE al_init_timeout (OUT timeout: ALLEGRO_TIMEOUT; seconds: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Set timeout value of some number of seconds after the function call.

For compatibility with all platforms, seconds must be 2,147,483.647 seconds or less.

See also
ALLEGRO_TIMEOUT
Represents a timeout value.
al_wait_for_event_until
FUNCTION al_map_rgb (r, g, b: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.

See also
al_map_rgba
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
al_map_rgba_f
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
al_map_rgb_f
Convert r, g, b (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.
FUNCTION al_map_rgba (r, g, b, a: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.

See also
al_map_rgb
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
al_map_rgba_f
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
al_map_rgb_f
Convert r, g, b (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.
FUNCTION al_map_rgb_f (r, g, b: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Convert r, g, b (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.

See also
al_map_rgba
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
al_map_rgba_f
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
al_map_rgb
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
FUNCTION al_map_rgba_f (r, g, b, a: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.

See also
al_map_rgba
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
al_map_rgba_f
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
al_map_rgb
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
FUNCTION al_premul_rgba (r, g, b: AL_UCHAR): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This is a shortcut for al_map_rgba (r * a / 255, g * a / 255, b * a / 255, a).

By default Allegro uses pre-multiplied alpha for transparent blending of bitmaps and primitives (see al_load_bitmap_flags for a discussion of that feature). This means that if you want to tint a bitmap or primitive to be transparent you need to multiply the color components by the alpha components when you pass them to this function. For example, to draw the bitmap tinted red and half-transparent.

VAR
  c: ALLEGRO_COLOR;
  bmp: ALLEGRO_BITMAPptr;
BEGIN
  c := al_premul_rgba (255, 0, 0, 127);
  al_draw_tinted_bitmap (bmp, c, 0, 0, 0);
END;

See also
al_map_rgba
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
al_premul_rgba_f
This is a shortcut for al_map_rgba (r * a, g * a, b * a, a).
FUNCTION al_premul_rgba_f (r, g, b: AL_FLOAT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This is a shortcut for al_map_rgba (r * a, g * a, b * a, a).

By default Allegro uses pre-multiplied alpha for transparent blending of bitmaps and primitives (see al_load_bitmap_flags for a discussion of that feature). This means that if you want to tint a bitmap or primitive to be transparent you need to multiply the color components by the alpha components when you pass them to this function. For example, to draw the bitmap tinted red and half-transparent.

VAR
  c: ALLEGRO_COLOR;
  bmp: ALLEGRO_BITMAPptr;
BEGIN
  c := al_premul_rgba_f (1, 0, 0, 0.5);
  al_draw_tinted_bitmap (bmp, c, 0, 0, 0);
END;

See also
al_map_rgba_f
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
al_premul_rgba
This is a shortcut for al_map_rgba (r * a / 255, g * a / 255, b * a / 255, a).
PROCEDURE al_unmap_rgb (color: ALLEGRO_COLOR; OUT r, g, b: AL_UCHAR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves components of an ALLEGRO_COLOR, ignoring alpha. Components will range from 0-255.

See also
al_unmap_rgba
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgba_f
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgb_f
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.
PROCEDURE al_unmap_rgba (color: ALLEGRO_COLOR; OUT r, g, b, a: AL_UCHAR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves components of an ALLEGRO_COLOR. Components will range from 0-255.

See also
al_unmap_rgba
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgba_f
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgb_f
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.
PROCEDURE al_unmap_rgb_f (color: ALLEGRO_COLOR; OUT r, g, b: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves components of an ALLEGRO_COLOR, ignoring alpha. Components will range from 0.0f-1.0f.

See also
al_unmap_rgba
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgba_f
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgb_f
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.
PROCEDURE al_unmap_rgba_f (color: ALLEGRO_COLOR; OUT r, g, b, a: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves components of an ALLEGRO_COLOR. Components will range from 0.0f-1.0f.

See also
al_unmap_rgba
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgba_f
Retrieves components of an ALLEGRO_COLOR.
al_unmap_rgb_f
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.
FUNCTION al_get_pixel_size (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return the number of bytes that a pixel of the given format occupies. For blocked pixel formats (e.g. compressed formats), this returns 0.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_pixel_format_bits
Return the number of bits that a pixel of the given format occupies.
FUNCTION al_get_pixel_format_bits (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return the number of bits that a pixel of the given format occupies. For blocked pixel formats (e.g. compressed formats), this returns 0.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_pixel_size
Return the number of bytes that a pixel of the given format occupies.
FUNCTION al_get_pixel_block_size (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return the number of bytes that a block of pixels with this format occupies.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_pixel_block_width
Return the width of the pixel block of this format.
al_get_pixel_block_height
Return the height of the pixel block of this format.
FUNCTION al_get_pixel_block_width (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return the width of the pixel block of this format.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_pixel_block_size
Return the number of bytes that a block of pixels with this format occupies.
al_get_pixel_block_height
Return the height of the pixel block of this format.
FUNCTION al_get_pixel_block_height (format: ALLEGRO_PIXEL_FORMAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return the height of the pixel block of this format.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_pixel_block_width
Return the width of the pixel block of this format.
al_get_pixel_block_size
Return the number of bytes that a block of pixels with this format occupies.
PROCEDURE al_set_new_bitmap_format (format: ALLEGRO_PIXEL_FORMAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the pixel format for newly created bitmaps. The default format is ALLEGRO_PIXEL_FORMAT_ANY and means the display driver will choose the best format.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_get_new_bitmap_format
Returns the format used for newly created bitmaps.
al_get_bitmap_format
Returns the pixel format of a bitmap.
PROCEDURE al_set_new_bitmap_flags (flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the flags to use for newly created bitmaps. Valid flags are:

ALLEGRO_MEMORY_BITMAP

Create a bitmap residing in system memory. Operations on, and with, memory bitmaps will not be hardware accelerated. However, direct pixel access can be relatively quick compared to video bitmaps, which depend on the display driver in use.

Note: Allegro's software rendering routines are currently very unoptimised.

ALLEGRO_VIDEO_BITMAP

Creates a bitmap that resides in the video card memory. These types of bitmaps receive the greatest benefit from hardware acceleration.

Note: Creating a video bitmap will fail if there is no current display or the current display driver cannot create the bitmap. The latter will happen if for example the format or dimensions are not supported.

Note: Bitmaps created with this flag will be converted to memory bitmaps when the last display is destroyed. In most cases it is therefore easier to use the ALLEGRO_CONVERT_BITMAP flag instead.

ALLEGRO_CONVERT_BITMAP

This is the default. It will try to create a video bitmap and if that fails create a memory bitmap. Bitmaps created with this flag when there is no active display will be converted to video bitmaps next time a display is created. They also will remain video bitmaps if the last display is destroyed and then another is created again.

Note: You can combine this flag with ALLEGRO_MEMORY_BITMAP or ALLEGRO_VIDEO_BITMAP to force the initial type (and fail in the latter case if no video bitmap can be created) - but usually neither of those combinations is very useful.

You can use the display option ALLEGRO_AUTO_CONVERT_BITMAPS to control which displays will try to auto-convert bitmaps.

ALLEGRO_NO_PRESERVE_TEXTURE

Normally, every effort is taken to preserve the contents of bitmaps, since some platforms may forget them. This can take extra processing time. If you know it doesn't matter if a bitmap keeps its pixel data, for example when it's a temporary buffer, use this flag to tell Allegro not to attempt to preserve its contents.

ALLEGRO_ALPHA_TEST

This is a driver hint only. It tells the graphics driver to do alpha testing instead of alpha blending on bitmaps created with this flag. Alpha testing is usually faster and preferred if your bitmaps have only one level of alpha (0). This flag is currently not widely implemented (i.e., only for memory bitmaps).

ALLEGRO_MIN_LINEAR

When drawing a scaled down version of the bitmap, use linear filtering. This usually looks better. You can also combine it with the MIPMAP flag for even better quality.

ALLEGRO_MAG_LINEAR

When drawing a magnified version of a bitmap, use linear filtering. This will cause the picture to get blurry instead of creating a big rectangle for each pixel. It depends on how you want things to look like whether you want to use this or not.

ALLEGRO_MIPMAP

This can only be used for bitmaps whose width and height is a power of two. In that case, it will generate mipmaps and use them when drawing scaled down versions. For example if the bitmap is 64x64, then extra bitmaps of sizes 32x32, 16x16, 8x8, 4x4, 2x2 and 1x1 will be created always containing a scaled down version of the original.

See also
al_get_new_bitmap_flags
Returns the flags used for newly created bitmaps.
al_get_bitmap_flags
Returns the flags user to create the bitmap.
FUNCTION al_get_new_bitmap_format: ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the format used for newly created bitmaps.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
FUNCTION al_get_new_bitmap_flags: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the flags used for newly created bitmaps.

See also
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
PROCEDURE al_add_new_bitmap_flag (flag: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

A convenience function which does the same as

  al_set_new_bitmap_flags (al_get_new_bitmap_flags OR flag);

See also
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
al_get_new_bitmap_flags
Returns the flags used for newly created bitmaps.
al_get_bitmap_flags
Returns the flags user to create the bitmap.
FUNCTION al_get_bitmap_width (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the width of a bitmap in pixels.

FUNCTION al_get_bitmap_height (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the height of a bitmap in pixels.

FUNCTION al_get_bitmap_format (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the pixel format of a bitmap.

See also
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
FUNCTION al_get_bitmap_flags (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the flags user to create the bitmap.

See also
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
FUNCTION al_create_bitmap (w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a new bitmap using the bitmap format and flags for the current thread. Blitting between bitmaps of differing formats, or blitting between memory bitmaps and display bitmaps may be slow.

Unless you set the ALLEGRO_MEMORY_BITMAP flag, the bitmap is created for the current display. Blitting to another display may be slow.

If a display bitmap is created, there may be limitations on the allowed dimensions. For example a DirectX or OpenGL backend usually has a maximum allowed texture size - so if bitmap creation fails for very large dimensions, you may want to re-try with a smaller bitmap. Some platforms also dictate a minimum texture size, which is relevant if you plan to use this bitmap with the primitives addon. If you try to create a bitmap smaller than this, this call will not fail but the returned bitmap will be a section of a larger bitmap with the minimum size. This minimum size is 16 by 16.

Some platforms do not directly support display bitmaps whose dimensions are not powers of two. Allegro handles this by creating a larger bitmap that has dimensions that are powers of two and then returning a section of that bitmap with the dimensions you requested. This can be relevant if you plan to use this bitmap with the primitives addon but shouldn't be an issue otherwise.

See also
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
al_clone_bitmap
Create a new bitmap with al_create_bitmap, and copy the pixel data from the old bitmap across.
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_destroy_bitmap
Destroys the given bitmap, freeing all resources used by it.
PROCEDURE al_destroy_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Destroys the given bitmap, freeing all resources used by it. Does nothing if given the null pointer.

PROCEDURE al_put_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Draws a single pixel on the target bitmap. This operation is slow on non-memory bitmaps. Consider locking the bitmap if you are going to use this function multiple times on the same bitmap. This function is not affected by the transformations or the color blenders.

See also
al_get_pixel
Get a pixel's color value from the specified bitmap.
al_put_blended_pixel
Like al_put_pixel, but the pixel color is blended using the current blenders before being drawn.
al_lock_bitmap
Lock an entire bitmap for reading or writing.
PROCEDURE al_put_blended_pixel (x, y: AL_INT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_put_pixel, but the pixel color is blended using the current blenders before being drawn.

FUNCTION al_get_pixel (bitmap: ALLEGRO_BITMAPptr; x, y: AL_INT): ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Get a pixel's color value from the specified bitmap. This operation is slow on non-memory bitmaps. Consider locking the bitmap if you are going to use this function multiple times on the same bitmap.

See also
al_put_pixel
Draws a single pixel on the target bitmap.
al_lock_bitmap
Lock an entire bitmap for reading or writing.
PROCEDURE al_convert_mask_to_alpha (bitmap: ALLEGRO_BITMAPptr; mask_color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Converts the given mask color to an alpha channel in the bitmap. Can be used to convert older 4.2-style bitmaps with magic pink to alpha-ready bitmaps.

PROCEDURE al_set_clipping_rectangle (x, y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the region of the target bitmap or display that pixels get clipped to. The default is to clip pixels to the entire bitmap.

See also
al_get_clipping_rectangle
Gets the clipping rectangle of the target bitmap.
al_reset_clipping_rectangle
Equivalent to calling al_set_clipping_rectangle (0, 0, w, h) where w and h are the width and height of the target bitmap respectively.
PROCEDURE al_reset_clipping_rectangle; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Equivalent to calling al_set_clipping_rectangle (0, 0, w, h) where w and h are the width and height of the target bitmap respectively.

Does nothing if there is no target bitmap.

See also
al_set_clipping_rectangle
Sets the region of the target bitmap or display that pixels get clipped to.
PROCEDURE al_get_clipping_rectangle (OUT x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Gets the clipping rectangle of the target bitmap.

See also
al_set_clipping_rectangle
Sets the region of the target bitmap or display that pixels get clipped to.
FUNCTION al_create_sub_bitmap (parent: ALLEGRO_BITMAPptr; x, y, w, h: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size. A sub-bitmap is a bitmap that shares drawing memory with a pre-existing (parent) bitmap, but possibly with a different size and clipping settings.

The sub-bitmap may originate off or extend past the parent bitmap.

See the discussion in al_get_backbuffer about using sub-bitmaps of the backbuffer.

The parent bitmap's clipping rectangles are ignored.

If a sub-bitmap was not or cannot be created then NULL is returned.

When you are done with using the sub-bitmap you must call al_destroy_bitmap on it to free any resources allocated for it.

Note that destroying parents of sub-bitmaps will not destroy the sub-bitmaps; instead the sub-bitmaps become invalid and should no longer be used for drawing - they still must be destroyed with al_destroy_bitmap however. It does not matter whether you destroy a sub-bitmap before or after its parent otherwise.

See also
al_create_bitmap
Creates a new bitmap using the bitmap format and flags for the current thread.
FUNCTION al_is_sub_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns true if the specified bitmap is a sub-bitmap, false otherwise.

See also
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_get_parent_bitmap
Returns the bitmap this bitmap is a sub-bitmap of.
FUNCTION al_get_parent_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the bitmap this bitmap is a sub-bitmap of. Returns Nil if this bitmap is not a sub-bitmap. This function always returns the real bitmap, and never a sub-bitmap. This might NOT match what was passed to al_create_sub_bitmap. Consider this code, for instance:

VAR
  a, b, c: ALLEGRO_BITMAPptr;
BEGIN
  a := al_create_bitmap (512, 512);
  b := al_create_sub_bitmap (a, 128, 128, 256, 256);
  c := al_create_sub_bitmap (b, 64, 64, 128, 128);
  IF (al_get_parent_bitmap (b)== a) AND (al_get_parent_bitmap(c) = a) THEN
    WriteLn ('b & c are sub-bitmaps of a')
END;

The message will be printed because only a is a real bitmap, and both b and c are its sub-bitmaps.

See also
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_is_sub_bitmap
Returns true if the specified bitmap is a sub-bitmap, false otherwise.
FUNCTION al_get_bitmap_x (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

For a sub-bitmap, return it's x position within the parent.

See also
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_get_parent_bitmap
Returns the bitmap this bitmap is a sub-bitmap of.
al_get_bitmap_y
For a sub-bitmap, return it's y position within the parent.
FUNCTION al_get_bitmap_y (bitmap: ALLEGRO_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

For a sub-bitmap, return it's y position within the parent.

See also
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_get_parent_bitmap
Returns the bitmap this bitmap is a sub-bitmap of.
al_get_bitmap_x
For a sub-bitmap, return it's x position within the parent.
PROCEDURE al_reparent_bitmap (bitmap, parent: ALLEGRO_BITMAPptr; x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

For a sub-bitmap, changes the parent, position and size. This is the same as destroying the bitmap and re-creating it with al_create_sub_bitmap - except the bitmap pointer stays the same. This has many uses, for example an animation player could return a single bitmap which can just be re-parented to different animation frames without having to re-draw the contents. Or a sprite atlas could re-arrange its sprites without having to invalidate all existing bitmaps.

See also
al_create_sub_bitmap
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
al_get_parent_bitmap
Returns the bitmap this bitmap is a sub-bitmap of.
FUNCTION al_clone_bitmap (bitmap: ALLEGRO_BITMAPptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Create a new bitmap with al_create_bitmap, and copy the pixel data from the old bitmap across. If the new bitmap is a memory bitmap, its projection bitmap is reset to be orthographic.

See also
al_create_bitmap
Creates a new bitmap using the bitmap format and flags for the current thread.
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
al_convert_bitmap
Converts the bitmap to the current bitmap flags and format.
PROCEDURE al_convert_bitmap (bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Converts the bitmap to the current bitmap flags and format. The bitmap will be as if it was created new with al_create_bitmap but retain its contents. All of this bitmap's sub-bitmaps are also converted. If the new bitmap type is memory, then the bitmap's projection bitmap is reset to be orthographic.

If this bitmap is a sub-bitmap, then it, its parent and all the sibling sub-bitmaps are also converted.

See also
al_create_bitmap
Creates a new bitmap using the bitmap format and flags for the current thread.
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
al_clone_bitmap
Create a new bitmap with al_create_bitmap, and copy the pixel data from the old bitmap across.
PROCEDURE al_convert_memory_bitmap; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

If you create a bitmap when there is no current display (for example because you have not called al_create_display in the current thread) and are using the ALLEGRO_CONVERT_BITMAP bitmap flag (which is set by default) then the bitmap will be created successfully, but as a memory bitmap. This function converts all such bitmaps to proper video bitmaps belonging to the current display.

Note that video bitmaps get automatically converted back to memory bitmaps when the last display is destroyed.

This operation will preserve all bitmap flags except ALLEGRO_VIDEO_BITMAP and ALLEGRO_MEMORY_BITMAP.

See also
al_convert_bitmap
Converts the bitmap to the current bitmap flags and format.
al_create_bitmap
Creates a new bitmap using the bitmap format and flags for the current thread.
PROCEDURE al_draw_bitmap (bitmap: ALLEGRO_BITMAPptr; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Draws an unscaled, unrotated bitmap at the given position to the current target bitmap. flags can be a combination of:

  • ALLEGRO_FLIP_HORIZONTAL - flip the bitmap about the y-axis

  • ALLEGRO_FLIP_VERTICAL - flip the bitmap about the x-axis

Note: The current target bitmap must be a different bitmap. Drawing a bitmap to itself (or to a sub-bitmap of itself) or drawing a sub-bitmap to its parent (or another sub-bitmap of its parent) are not currently supported. To copy part of a bitmap into the same bitmap simply use a temporary bitmap instead.

Note: The backbuffer (or a sub-bitmap thereof) can not be transformed, blended or tinted. If you need to draw the backbuffer draw it to a temporary bitmap first with no active transformation (except translation). Blending and tinting settings/parameters will be ignored. This does not apply when drawing into a memory bitmap.

Parameters
bitmap
Origin bitmap.
dx
Destination x.
dy
Destination y.
flags
See also
al_set_target_bitmap
This function selects the bitmap to which all subsequent drawing operations in the calling thread will draw to.
al_draw_bitmap_region
Draws a region of the given bitmap to the target bitmap.
al_draw_scaled_bitmap
Draws a scaled version of the given bitmap to the target bitmap.
al_draw_rotated_bitmap
Draws a rotated version of the given bitmap to the target bitmap.
al_draw_scaled_rotated_bitmap
Like al_draw_rotated_bitmap, but can also scale the bitmap.
PROCEDURE al_draw_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Draws a region of the given bitmap to the target bitmap.

Parameters
bitmap
Origin bitmap.
sx
source x
sy
source y
sw
source width (width of region to blit)
sh
source height (height of region to blit)
dx
destination x
dy
destination y
flags
same as for al_draw_bitmap
See also
al_draw_bitmap
Draws an unscaled, unrotated bitmap at the given position to the current target bitmap.
al_draw_scaled_bitmap
Draws a scaled version of the given bitmap to the target bitmap.
al_draw_rotated_bitmap
Draws a rotated version of the given bitmap to the target bitmap.
al_draw_scaled_rotated_bitmap
Like al_draw_rotated_bitmap, but can also scale the bitmap.
PROCEDURE al_draw_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Draws a scaled version of the given bitmap to the target bitmap.

Parameters
bitmap
Origin bitmap.
sx
source x
sy
source y
sw
source width
sh
source height
dx
destination x
dy
destination y
dw
destination width
dh
destination height
flags
same as for al_draw_bitmap
See also
al_draw_bitmap
Draws an unscaled, unrotated bitmap at the given position to the current target bitmap.
al_draw_bitmap_region
Draws a region of the given bitmap to the target bitmap.
al_draw_rotated_bitmap
Draws a rotated version of the given bitmap to the target bitmap.
al_draw_scaled_rotated_bitmap
Like al_draw_rotated_bitmap, but can also scale the bitmap.
PROCEDURE al_draw_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Draws a rotated version of the given bitmap to the target bitmap. Example:

VAR
  w, h: SINGLE;
BEGIN
  w := al_get_bitmap_width (bitmap);
  h := al_get_bitmap_height (bitmap);
  al_draw_rotated_bitmap (bitmap, w / 2, h / 2, x, y, ALLEGRO_PI / 2, 0);

The above code draws the bitmap centered on x/y and rotates it 90° clockwise.

Parameters
bitmap
Origin bitmap.
cx
center x (relative to the left of bitmap)
cy
center y (relative to the top or bitmap)
dx
destination x
dy
destination y
angle
angle in radians by which to rotate clockwise
flags
same as for al_draw_bitmap
See also
al_draw_bitmap
Draws an unscaled, unrotated bitmap at the given position to the current target bitmap.
al_draw_bitmap_region
Draws a region of the given bitmap to the target bitmap.
al_draw_scaled_bitmap
Draws a scaled version of the given bitmap to the target bitmap.
al_draw_scaled_rotated_bitmap
Like al_draw_rotated_bitmap, but can also scale the bitmap.
PROCEDURE al_draw_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_rotated_bitmap, but can also scale the bitmap.

The point at cx/cy in the bitmap will be drawn at dx/dy and the bitmap is rotated and scaled around this point.

Parameters
bitmap
Origin bitmap.
cx
center x (relative to the left of bitmap)
cy
center y (relative to the top or bitmap)
dx
destination x
dy
destination y
xscale
how much to scale on the x-axis (e.g. 2 for twice the size)
yscale
how much to scale on the y-axis
angle
angle in radians by which to rotate clockwise
flags
same as for al_draw_bitmap
See also
al_draw_bitmap
Draws an unscaled, unrotated bitmap at the given position to the current target bitmap.
al_draw_bitmap_region
Draws a region of the given bitmap to the target bitmap.
al_draw_scaled_bitmap
Draws a scaled version of the given bitmap to the target bitmap.
PROCEDURE al_draw_tinted_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_bitmap but multiplies all colors in the bitmap with the given color. For example:

al_draw_tinted_bitmap (bitmap, al_map_rgba_f (0.5, 0.5, 0.5, 0.5), x, y, 0);

The above will draw the bitmap 50% transparently (r/g/b values need to be pre-multiplied with the alpha component with the default blend mode).

al_draw_tinted_bitmap(bitmap, al_map_rgba_f(1, 0, 0, 1), x, y, 0);

The above will only draw the red component of the bitmap.

See al_draw_bitmap for a note on restrictions on which bitmaps can be drawn where.

PROCEDURE al_draw_tinted_bitmap_region (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_bitmap_region but multiplies all colors in the bitmap with the given color.

See also
al_draw_tinted_bitmap
Like al_draw_bitmap but multiplies all colors in the bitmap with the given color.
PROCEDURE al_draw_tinted_scaled_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; sx, sy, sw, sh, dx, dy, dw, dh: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_scaled_bitmap but multiplies all colors in the bitmap with the given color.

See also
al_draw_tinted_bitmap
Like al_draw_bitmap but multiplies all colors in the bitmap with the given color.
PROCEDURE al_draw_tinted_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_rotated_bitmap but multiplies all colors in the bitmap with the given color.

See also
al_draw_tinted_bitmap
Like al_draw_bitmap but multiplies all colors in the bitmap with the given color.
PROCEDURE al_draw_tinted_scaled_rotated_bitmap (bitmap: ALLEGRO_BITMAPptr; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_tinted_scaled_rotated_bitmap but you specify an area within the bitmap to be drawn.

You can get the same effect with a sub bitmap:

  al_draw_tinted_scaled_rotated_bitmap (
    bitmap, sx, sy, sw, sh, tint, cx, cy, dx, dy, xscale, yscale, angle, flags
  );

// This draws the same:
  sub_bitmap := al_create_sub_bitmap (bitmap, sx, sy, sw, sh);
  al_draw_tinted_scaled_rotated_bitmap (
    sub_bitmap, tint, cx, cy, dx, dy, xscale, yscale, angle, flags
  );

See al_draw_bitmap for a note on restrictions on which bitmaps can be drawn where.

See also
al_draw_tinted_bitmap
Like al_draw_bitmap but multiplies all colors in the bitmap with the given color.
PROCEDURE al_draw_tinted_scaled_rotated_bitmap_region (bitmap: ALLEGRO_BITMAPptr; sx, sy, sw, sh: AL_FLOAT; tint: ALLEGRO_COLOR; cx, cy, dx, dy, xscale, yscale, angle: AL_FLOAT; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_draw_tinted_scaled_rotated_bitmap but you specify an area within the bitmap to be drawn.

You can get the same effect with a sub bitmap:

  al_draw_tinted_scaled_rotated_bitmap_region (
    bitmap, sx, sy, sw, sh, tint,
    cx, cy, dx, dy, xscale, yscale, angle, flags
  );

{ This draws the same: }
  sub_bitmap := al_create_sub_bitmap (bitmap, sx, sy, sw, sh);
  al_draw_tinted_scaled_rotated_bitmap (
    sub_bitmap, tint, cx, cy,
    dx, dy, xscale, yscale, angle, flags
  );

See al_draw_bitmap for a note on restrictions on which bitmaps can be drawn where.

See also
al_draw_tinted_bitmap
Like al_draw_bitmap but multiplies all colors in the bitmap with the given color.
FUNCTION al_ustr_new (CONST s: AL_STR): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a new string containing a copy of the C-style string s. The string must eventually be freed with al_ustr_free.

See also
al_ustr_new_from_buffer
Creates a new string containing a copy of the buffer pointed to by s of the given size in bytes.
al_ustr_dup
Returns a duplicate copy of a string.
al_ustr_new_from_utf16
FUNCTION al_ustr_new_from_buffer (CONST s: AL_STRptr; size: AL_SIZE_T): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a new string containing a copy of the buffer pointed to by s of the given size in bytes. The string must eventually be freed with al_ustr_free.

See also
al_ustr_new
Creates a new string containing a copy of the C-style string s.
PROCEDURE al_ustr_free (us: ALLEGRO_USTRptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Frees a previously allocated string. Does nothing if the argument is Nil.

See also
al_ustr_new
Creates a new string containing a copy of the C-style string s.
al_ustr_new_from_buffer
Creates a new string containing a copy of the buffer pointed to by s of the given size in bytes.
FUNCTION al_cstr (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Get a AL_STRptr pointer to the data in a string. This pointer will only be valid while the ALLEGRO_USTR object is not modified and not destroyed. The pointer may be passed to functions expecting C-style strings, with the following caveats:

  • ALLEGRO_USTRs are allowed to contain embedded NUL ($00) bytes. That means al_ustr_size (u) and strlen (al_cstr (u)) may not agree.

  • An ALLEGRO_USTR may be created in such a way that it is not NUL terminated. A string which is dynamically allocated will always be NUL terminated, but a string which references the middle of another string or region of memory will not be NUL terminated.

  • If the ALLEGRO_USTR references another string, the returned C string will point into the referenced string. Again, no NUL terminator will be added to the referenced string.

See also
al_ustr_to_buffer
Writes the contents of the string into a pre-allocated buffer of the given size in bytes.
al_cstr_dup
Creates a NUL ($00) terminated copy of the string.
PROCEDURE al_ustr_to_buffer (CONST us: ALLEGRO_USTRptr; buffer: AL_STRptr; size: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes the contents of the string into a pre-allocated buffer of the given size in bytes. The result will always be NUL terminated, so a maximum of size - 1 bytes will be copied.

See also
al_cstr
Get a AL_STRptr pointer to the data in a string.
al_cstr_dup
Creates a NUL ($00) terminated copy of the string.
FUNCTION al_cstr_dup (CONST us: ALLEGRO_USTRptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a NUL ($00) terminated copy of the string. Any embedded NUL bytes will still be presented in the returned string. The new string must eventually be freed with al_free.

If an error occurs Nil is returned.

See also
al_cstr
Get a AL_STRptr pointer to the data in a string.
al_ustr_to_buffer
Writes the contents of the string into a pre-allocated buffer of the given size in bytes.
al_free
Like free in the C standard library, but the implementation may be overridden.
FUNCTION al_ustr_dup (CONST us: ALLEGRO_USTRptr): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns a duplicate copy of a string. The new string will need to be freed with al_ustr_free.

See also
al_ustr_dup_substr
Return a new copy of a string, containing its contents in the byte interval [start_pos, end_pos).
al_ustr_free
Frees a previously allocated string.
FUNCTION al_ustr_dup_substr (CONST us: ALLEGRO_USTRptr; start_pos, end_pos: AL_INT): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return a new copy of a string, containing its contents in the byte interval [start_pos, end_pos). The new string will be NUL terminated and will need to be freed with al_ustr_free.

If necessary, use al_ustr_offset to find the byte offsets for a given code point that you are interested in.

Note: This is used because the way the C language works. I didn't test if Pascal do need this kind of stuff. Future versions of Allegro.pas would not include this function, so don't use it unless your really need to (and tell me if you really need it to remove this warning from documentation).

See also
al_ustr_dup
Returns a duplicate copy of a string.
al_ustr_free
Frees a previously allocated string.
FUNCTION al_ustr_empty_string: ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Predefined string

FUNCTION al_ref_cstr (OUT info: ALLEGRO_USTR_INFO; CONST s: AL_STR): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Create a string that references the storage of a C-style string. The information about the string (e.g. its size) is stored in the info parameter. The string will not have any other storage allocated of its own, so if you allocate the info structure on the stack then no explicit "free" operation is required.

The string is valid until the underlying C string disappears.

Example:

VAR
  Info: ALLEGRO_USTR_INFO;
  us: ALLEGRO_USTRptr;
BEGIN
  us := al_ref_cstr (Info, 'my string')
END;

See also
al_ref_buffer
al_ref_ustr
FUNCTION al_ref_buffer (OUT info: ALLEGRO_USTR_INFO; CONST s: AL_STRptr; size: AL_SIZE_T): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ref_ustr (OUT info: ALLEGRO_USTR_INFO; CONST us: ALLEGRO_USTRptr; star_pos, end_pos: AL_INT): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ustr_size (CONST us: ALLEGRO_USTRptr): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sizes and offsets

FUNCTION al_ustr_length (CONST us: ALLEGRO_USTRptr): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ustr_offset (CONST us: ALLEGRO_USTRptr;index: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ustr_next (CONST us: ALLEGRO_USTRptr; VAR aPos: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Find the byte offset of the next code point in string, beginning at aPos. aPos does not have to be at the beginning of a code point.

This function just looks for an appropriate byte; it doesn't check if found offset is the beginning of a valid code point. If you are working with possibly invalid UTF-8 strings then it could skip over some invalid bytes.

Returns

True on success, and aPos will be updated to the found offset. Otherwise returns False if aPos was already at the end of the string, and aPos is unmodified.

See also
al_ustr_prev
Find the byte offset of the previous code point in string, before aPos.
FUNCTION al_ustr_prev (CONST us: ALLEGRO_USTRptr; VAR aPos: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Find the byte offset of the previous code point in string, before aPos. aPos does not have to be at the beginning of a code point.

This function just looks for an appropriate byte; it doesn't check if found offset is the beginning of a valid code point. If you are working with possibly invalid UTF-8 strings then it could skip over some invalid bytes.

Returns

True on success, and aPos will be updated to the found offset. Otherwise returns False if aPos was already at the end of the string, and aPos is unmodified.

See also
al_ustr_next
Find the byte offset of the next code point in string, beginning at aPos.
FUNCTION al_ustr_assign (us1: ALLEGRO_USTRptr; CONST us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Assign

FUNCTION al_ustr_assign_cstr (us1: ALLEGRO_USTRptr; CONST s: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ustr_equal (CONST us1, us2: ALLEGRO_USTRptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Compare

FUNCTION al_ustr_compare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_ustr_ncompare (CONST u, v: ALLEGRO_USTRptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_fopen (CONST path, mode: AL_STR): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates and opens a file (real or virtual) given the path and mode. The current file interface is used to open the file.

Depending on the stream type and the mode string, files may be opened in "text" mode. The handling of newlines is particularly important. For example, using the default stdio-based streams on DOS and Windows platforms, where the native end-of-line terminators are CR+LF sequences, a call to al_fgetc may return just one character ('\n') where there were two bytes (CR+LF) in the file. When writing out '\n', two bytes would be written instead. (As an aside, '\n' is not defined to be equal to LF either.)

Newline translations can be useful for text files but is disastrous for binary files. To avoid this behaviour you need to open file streams in binary mode by using a mode argument containing a "b", e.g. "rb", "wb".

Parameters
path
Path to the file to open.
mode
Access mode to open the file in ('r', 'w', etc.).
Returns

a file handle on success, or Nil on error.

See also
al_set_new_file_interface
Sets the ALLEGRO_FILE_INTERFACEptr table for the calling thread.
al_fclose
Close the given file, writing any buffered output data (if any).
FUNCTION al_fopen_interface ( CONST vt: ALLEGRO_FILE_INTERFACEptr; CONST path, mode: AL_STR ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Opens a file using the specified interface, instead of the interface set with al_set_new_file_interface.

See also
al_fopen
Creates and opens a file (real or virtual) given the path and mode.
FUNCTION al_create_file_handle ( CONST vt: ALLEGRO_FILE_INTERFACEptr; userdata: AL_POINTER ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates an empty, opened file handle with some abstract user data. This allows custom interfaces to extend the ALLEGRO_FILEptr struct with their own data. You should close the handle with the standard al_fclose function when you are finished with it.

See also
al_fopen
Creates and opens a file (real or virtual) given the path and mode.
al_fclose
Close the given file, writing any buffered output data (if any).
al_set_new_file_interface
Sets the ALLEGRO_FILE_INTERFACEptr table for the calling thread.
FUNCTION al_fclose (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Close the given file, writing any buffered output data (if any).

Returns

True on success, False on failure.

FUNCTION al_fread (f: ALLEGRO_FILEptr; ptr: AL_POINTER; size: AL_SIZE_T): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Read size bytes into the buffer pointed to by ptr, from the given file.

Returns

The number of bytes actually read. If an error occurs, or the end-of-file is reached, the return value is a short byte count (or zero).

al_fread does not distinguish between EOF and other errors. Use al_feof and al_ferror to determine which occurred.

See also
al_fgetc
Reads and returns next byte in the given file.
al_fread16be
Reads a 16-bit word in big-endian format (MSB first).
al_fread16le
Reads a 16-bit word in little-endian format (LSB first).
al_fread32be
Reads a 32-bit word in big-endian format (MSB first).
al_fread32le
Reads a 32-bit word in little-endian format (LSB first).
FUNCTION al_fwrite (f: ALLEGRO_FILEptr; CONST ptr: AL_POINTER; size: AL_SIZE_T): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Write size bytes from the buffer pointed to by ptr into the given file.

Returns

The number of bytes actually written. If an error occurs,the return value is a short byte count (or zero).

See also
al_fputc
Writes a single byte to the given file.
al_fputs
Writes a string to file.
al_fwrite16be
Writes a 16-bit word in big-endian format (MSB first).
al_fwrite16le
Writes a 16-bit word in little-endian format (LSB first).
al_fwrite32be
Writes a 32-bit word in big-endian format (MSB first).
al_fwrite32le
Writes a 32-bit word in little-endian format (LSB first).
FUNCTION al_fflush (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Flush any pending writes to the given file.

Returns

True on success, False otherwise.

See also
al_get_errno
Some Allegro functions will set an error number as well as returning an error code.
FUNCTION al_ftell (f: ALLEGRO_FILEptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the current position in the given file, or -1 on error.

On some platforms this function may not support large files.

See also
al_fseek
Set the current position of the given file to a position relative to that specified by whence, plus offset number of bytes.
al_get_errno
Some Allegro functions will set an error number as well as returning an error code.
FUNCTION al_fseek (f: ALLEGRO_FILEptr; offset: AL_INT64; whence: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Set the current position of the given file to a position relative to that specified by whence, plus offset number of bytes.

whence can be:

  • ALLEGRO_SEEK_SET - seek relative to beginning of file

  • ALLEGRO_SEEK_CUR - seek relative to current file position

  • ALLEGRO_SEEK_END - seek relative to end of file

After a successful seek, the end-of-file indicator is cleared and all pushback bytes are forgotten.

On some platforms this function may not support large files.

Returns

True on success, False on failure.

See also
al_ftell
Returns the current position in the given file, or -1 on error.
al_get_errno
Some Allegro functions will set an error number as well as returning an error code.
FUNCTION al_feof (f: ALLEGRO_FILEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if the end-of-file indicator has been set on the file, i.e. we have attempted to read past the end of the file.

This does not return True if we simply are at the end of the file. The following code correctly reads two bytes, even when the file contains exactly two bytes:

  b1 := al_fgetc (f);
  b2 := al_fgetc (f);
  IF al_feof (f) THEN
  // At least one byte was unsuccessfully read.
    ReportError ();

See also
al_ferror
Returns non-zero if the error indicator is set on the given file, i.e.
al_fclearerr
Clears the error indicator for the given file.
FUNCTION al_ferror (f: ALLEGRO_FILEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns non-zero if the error indicator is set on the given file, i.e. there was some sort of previous error. The error code may be system or file interface specific.

See also
al_feof
Returns True if the end-of-file indicator has been set on the file, i.e.
al_fclearerr
Clears the error indicator for the given file.
al_ferrmsg
Returns a message string with details about the last error that occurred on the given file handle.
FUNCTION al_ferrmsg (f: ALLEGRO_FILEptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns a message string with details about the last error that occurred on the given file handle. The returned string is empty if there was no error, or if the file interface does not provide more information.

See also
al_fclearerr
Clears the error indicator for the given file.
al_ferror
Returns non-zero if the error indicator is set on the given file, i.e.
PROCEDURE al_fclearerr (f: ALLEGRO_FILEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Clears the error indicator for the given file.

The standard I/O backend also clears the end-of-file indicator, and other backends should try to do this. However, they may not if it would require too much effort (e.g. PhysicsFS backend), so your code should not rely on it if you need your code to be portable to other backends.

See also
al_ferror
Returns non-zero if the error indicator is set on the given file, i.e.
al_feof
Returns True if the end-of-file indicator has been set on the file, i.e.
FUNCTION al_fungetc (f: ALLEGRO_FILEptr; c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Ungets a single byte from a file. Pushed-back bytes are not written to the file, only made available for subsequent reads, in reverse order.

The number of pushbacks depends on the backend. The standard I/O backend only guarantees a single pushback; this depends on the libc implementation.

For backends that follow the standard behavior, the pushback buffer will be cleared after any seeking or writing; also calls to al_fseek and al_ftell are relative to the number of pushbacks. If a pushback causes the position to become negative, the behavior of al_fseek and al_ftell are undefined.

See also
al_fgetc
Reads and returns next byte in the given file.
al_get_errno
Some Allegro functions will set an error number as well as returning an error code.
FUNCTION al_fsize (f: ALLEGRO_FILEptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the size of the file, if it can be determined, or -1 otherwise.

FUNCTION al_fgetc (f: ALLEGRO_FILEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads and returns next byte in the given file. Returns a negative number on end of file or if an error occurred.

See also
al_fungetc
Ungets a single byte from a file.
FUNCTION al_fputc (f: ALLEGRO_FILEptr; c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a single byte to the given file. The byte written is the value of c cast to an unsigned char.

Parameters
c
byte value to write.
f
file to write to.
Returns

the written byte (cast back to an AL_INT) on success, or negative number on error.

FUNCTION al_fread16le (f: ALLEGRO_FILEptr): AL_INT16; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads a 16-bit word in little-endian format (LSB first).

Returns

On success, the 16-bit word. On failure, returns EOF (-1). Since -1 is also a valid return value, use al_feof to check if the end of the file was reached prematurely, or al_ferror to check if an error occurred.

See also
al_fread16be
Reads a 16-bit word in big-endian format (MSB first).
FUNCTION al_fread16be (f: ALLEGRO_FILEptr): AL_INT16; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads a 16-bit word in big-endian format (MSB first).

Returns

On success, the 16-bit word. On failure, returns EOF (-1). Since -1 is also a valid return value, use al_feof to check if the end of the file was reached prematurely, or al_ferror to check if an error occurred.

See also
al_fread16le
Reads a 16-bit word in little-endian format (LSB first).
FUNCTION al_fwrite16le (f: ALLEGRO_FILEptr; w: AL_INT16): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a 16-bit word in little-endian format (LSB first).

Returns

The number of bytes written: 2 on success, less than 2 on an error.

See also
al_fwrite16be
Writes a 16-bit word in big-endian format (MSB first).
FUNCTION al_fwrite16be (f: ALLEGRO_FILEptr; w: AL_INT16): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a 16-bit word in big-endian format (MSB first).

Returns

The number of bytes written: 2 on success, less than 2 on an error.

See also
al_fwrite16le
Writes a 16-bit word in little-endian format (LSB first).
FUNCTION al_fread32le (f: ALLEGRO_FILEptr): AL_INT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads a 32-bit word in little-endian format (LSB first).

Returns

On success, the 32-bit word. On failure, returns EOF (-1). Since -1 is also a valid return value, use al_feof to check if the end of the file was reached prematurely, or al_ferror to check if an error occurred.

See also
al_fread32be
Reads a 32-bit word in big-endian format (MSB first).
FUNCTION al_fread32be (f: ALLEGRO_FILEptr): AL_INT32; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads a 32-bit word in big-endian format (MSB first).

Returns

On success, the 32-bit word. On failure, returns EOF (-1). Since -1 is also a valid return value, use al_feof to check if the end of the file was reached prematurely, or al_ferror to check if an error occurred.

See also
al_fread32le
Reads a 32-bit word in little-endian format (LSB first).
FUNCTION al_fwrite32le (f: ALLEGRO_FILEptr; l: AL_INT32): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a 32-bit word in little-endian format (LSB first).

Returns

The number of bytes written: 2 on success, less than 2 on an error.

See also
al_fwrite32be
Writes a 32-bit word in big-endian format (MSB first).
FUNCTION al_fwrite32be (f: ALLEGRO_FILEptr; l: AL_INT32): AL_SIZE_T; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a 32-bit word in big-endian format (MSB first).

Returns

The number of bytes written: 2 on success, less than 2 on an error.

See also
al_fwrite32le
Writes a 32-bit word in little-endian format (LSB first).
FUNCTION al_fgets (f: ALLEGRO_FILEptr; CONST p: AL_STRptr; max: AL_SIZE_T): AL_STRptr CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Reads a string of bytes terminated with a newline or end-of-file into the buffer given. The line terminator(s), if any, are included in the returned string. A maximum of max-1 bytes are read, with one byte being reserved for a NUL terminator.

See al_fopen about translations of end-of-line characters.

Parameters
f
File to read from.
buf
Buffer to fill.
max
Maximum size of buffer.
Returns

The pointer to buf on success. Returns Nil if an error occurred or if the end of file was reached without reading any bytes.

See also
al_fget_ustr
Read a string of bytes terminated with a newline or end-of-file.
FUNCTION al_fget_ustr (f: ALLEGRO_FILEptr): ALLEGRO_USTRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Read a string of bytes terminated with a newline or end-of-file. The line terminator(s), if any, are included in the returned string.

See al_fopen about translations of end-of-line characters.

Returns

On success a pointer to a new ALLEGRO_USTR structure. This must be freed eventually with al_ustr_free. Returns Nil if an error occurred or if the end of file was reached without reading any bytes.

See also
al_fgetc
Reads and returns next byte in the given file.
al_fgets
Reads a string of bytes terminated with a newline or end-of-file into the buffer given.
FUNCTION al_fputs (f: ALLEGRO_FILEptr; CONST p: AL_STR): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Writes a string to file. Apart from the return value, this is equivalent to al_fwrite (f, p, Length (p));

Note: depending on the stream type and the mode passed to al_fopen, newline characters in the string may or may not be automatically translated to native end-of-line sequences, e.g. CR/LF instead of LF.

Parameters
f
File handle to write to.
p
String to write.
Returns

A non-negative integer on success, EOF (-1) on error.

See also
al_fwrite
Write size bytes from the buffer pointed to by ptr into the given file.
FUNCTION al_fopen_slice ( fp: ALLEGRO_FILEptr; initial_size: AL_SIZE_T; CONST mode: AL_STR ): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

/* Specific to stdio backend. */ AL_FUNC(ALLEGRO_FILE*, al_fopen_fd, (int fd, const char *mode)); CDECL; EXTERNAL ALLEGRO_LIB_NAME; FUNCTION al_make_temp_file (CONST tmpl: AL_STR; OUT ret_path: ALLEGRO_PATHptr): ALLEGRO_FILEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Opens a slice (subset) of an already open random access file as if it were a stand alone file. While the slice is open, the parent file handle must not be used in any way.

The slice is opened at the current location of the parent file, up through initial_size bytes. The initial_size may be any non-negative integer that will not exceed the bounds of the parent file.

Seeking with ALLEGRO_SEEK_SET will be relative to this starting location. ALLEGRO_SEEK_END will be relative to the starting location plus the size of the slice.

The mode can be any combination of:

  • r: read access

  • w: write access

  • e: expandable

For example, a mode of 'rw' indicates the file can be read and written. (Note that this is slightly different from the stdio modes.) Keep in mind that the parent file must support random access and be open in normal write mode (not append) for the slice to work in a well defined way.

If the slice is marked as expandable, then reads and writes can happen after the initial end point, and the slice will grow accordingly. Otherwise, all activity is restricted to the initial size of the slice.

A slice must be closed with al_fclose. The parent file will then be positioned immediately after the end of the slice.

See also
al_fopen
Creates and opens a file (real or virtual) given the path and mode.
FUNCTION al_get_new_file_interface: ALLEGRO_FILE_INTERFACEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return a pointer to the ALLEGRO_FILE_INTERFACEptr table in effect for the calling thread.

See also
al_store_state
Stores part of the state of the current thread in the given ALLEGRO_STATE object.
al_restore_state
Restores part of the state of the current thread from the given ALLEGRO_STATE object.
PROCEDURE al_set_new_file_interface (CONST file_interface: ALLEGRO_FILE_INTERFACEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the ALLEGRO_FILE_INTERFACEptr table for the calling thread. This will change the handler for later calls to al_fopen.

See also
al_set_standard_file_interface
Sets the ALLEGRO_FILE_INTERFACEptr table to the default, for the calling thread.
al_store_state
Stores part of the state of the current thread in the given ALLEGRO_STATE object.
al_restore_state
Restores part of the state of the current thread from the given ALLEGRO_STATE object.
PROCEDURE al_set_standard_file_interface; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the ALLEGRO_FILE_INTERFACEptr table to the default, for the calling thread. This will change the handler for later calls to al_fopen.

See also
al_set_new_file_interface
Sets the ALLEGRO_FILE_INTERFACEptr table for the calling thread.
FUNCTION al_get_file_userdata (f: ALLEGRO_FILEptr): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns a pointer to the custom userdata that is attached to the file handle. This is intended to be used by functions that extend ALLEGRO_FILE_INTERFACEptr.

FUNCTION al_register_bitmap_loader (CONST ext: AL_STR; loader: ALLEGRO_IIO_LOADER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Registers a handler for al_load_bitmap. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The loader argument may be Nil to unregister an entry.

Returns

True on success, False on error. Returns False if unregistering an entry that doesn't exist.

See also
al_register_bitmap_saver
Registers a handler for al_save_bitmap.
al_register_bitmap_loader_f
Registers a handler for al_load_bitmap_f.
FUNCTION al_register_bitmap_saver (CONST ext: AL_STR; saver: ALLEGRO_IIO_SAVER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Registers a handler for al_save_bitmap. The given function will be used to handle the saving of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The loader argument may be Nil to unregister an entry.

Returns

True on success, False on error. Returns False if unregistering an entry that doesn't exist.

See also
al_register_bitmap_loader
Registers a handler for al_load_bitmap.
al_register_bitmap_saver_f
Registers a handler for al_save_bitmap_f.
FUNCTION al_register_bitmap_loader_f (CONST ext: AL_STR; fs_loader: ALLEGRO_IIO_FS_LOADER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Registers a handler for al_load_bitmap_f. The given function will be used to handle the loading of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The fs_loader argument may be Nil to unregister an entry.

Returns

True on success, False on error. Returns False if unregistering an entry that doesn't exist.

See also
al_register_bitmap_loader
Registers a handler for al_load_bitmap.
FUNCTION al_register_bitmap_saver_f (CONST ext: AL_STR; fs_saver: ALLEGRO_IIO_FS_SAVER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Registers a handler for al_save_bitmap_f. The given function will be used to handle the saving of bitmaps files with the given extension.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The fs_saver argument may be Nil to unregister an entry.

Returns

True on success, False on error. Returns False if unregistering an entry that doesn't exist.

See also
al_register_bitmap_saver
Registers a handler for al_save_bitmap.
FUNCTION al_register_bitmap_identifier (CONST ext: AL_STR; identifier: ALLEGRO_IIO_IDENTIFIER_FUNCTION): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Registers an identify handler for al_identify_bitmap. The given function will be used to detect files for the given extension. It will be called with a single argument of type ALLEGRO_FILEptr which is a file handle opened for reading and located at the first byte of the file. The handler should try to read as few bytes as possible to safely determine if the given file contents correspond to the type with the extension and return True in that case, False otherwise. The file handle must not be closed but there is no need to reset it to the beginning.

The extension should include the leading dot ('.') character. It will be matched case-insensitively.

The identifier argument may be Nil to unregister an entry.

Returns

True on success, False on error. Returns False if unregistering an entry that doesn't exist.

See also
al_identify_bitmap
This works exactly as al_identify_bitmap_f but you specify the filename of the file for which to detect the type and not a file handle.
FUNCTION al_load_bitmap (CONST filename: AL_STR): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Loads an image file into a new ALLEGRO_BITMAPptr. The file type is determined by the extension, except if the file has no extension in which case al_identify_bitmap is used instead.

This is the same as calling al_load_bitmap_flags with a flags parameter of 0.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Returns

A pointer to the loaded bitmap or Nil on error.

See also
al_load_bitmap_f
Loads an image from an ALLEGRO_FILEptr stream into a new ALLEGRO_BITMAPptr.
al_register_bitmap_loader
Registers a handler for al_load_bitmap.
al_load_bitmap_flags
Loads an image file into a new ALLEGRO_BITMAPptr.
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
al_set_new_bitmap_flags
Sets the flags to use for newly created bitmaps.
al_init_image_addon
Initializes the image addon.
FUNCTION al_load_bitmap_flags (CONST filename: AL_STR; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Loads an image file into a new ALLEGRO_BITMAPptr. The file type is determined by the extension, except if the file has no extension in which case al_identify_bitmap is used instead.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Parameters
flags
It may be a combination of the following constants:

  • ALLEGRO_NO_PREMULTIPLIED_ALPHA By default, Allegro pre-multiplies the alpha channel of an image with the images color data when it loads it. Typically that would look something like this:

        r := get_float_byte;
        g := get_float_byte;
        b := get_float_byte;
        a := get_float_byte;
    
        r := r * a;
        g := g * a;
        b := b * a;
    
        set_image_pixel (x, y, r, g, b, a);
    

    The reason for this can be seen in the Allegro example ex_premulalpha, ie, using pre-multiplied alpha gives more accurate color results in some cases. To use alpha blending with images loaded with pre-multiplied alpha, you would use the default blending mode, which is set with al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA).

    The ALLEGRO_NO_PREMULTIPLIED_ALPHA flag being set will ensure that images are not loaded with alpha pre-multiplied, but are loaded with color values direct from the image. That looks like this:

        r := get_float_byte;
        g := get_float_byte;
        b := get_float_byte;
        a := get_float_byte;
    
        set_image_pixel (x, y, r, g, b, a);
    

    To draw such an image using regular alpha blending, you would use al_set_blender (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA) to set the correct blender. This has some caveats. First, as mentioned above, drawing such an image can result in less accurate color blending (when drawing an image with linear filtering on, the edges will be darker than they should be). Second, the behaviour is somewhat confusing, which is explained in the example below.

      // Load and create bitmaps with an alpha channel
        al_set_new_bitmap_format (ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA);
      // Load some bitmap with alpha in it
        bmp := al_load_bitmap ('some_alpha_bitmap.png');
      // We will draw to this buffer and then draw this buffer to the screen
        tmp_buffer := al_create_bitmap (SCREEN_W, SCREEN_H);
      // Set the buffer as the target and clear it
        al_set_target_bitmap (tmp_buffer);
        al_clear_to_color (al_map_rgba_f (0, 0, 0, 1));
      // Draw the bitmap to the temporary buffer
        al_draw_bitmap (bmp, 0, 0, 0);
      // Finally, draw the buffer to the screen
      // The output will look incorrect (may take close inspection
      // depending on the bitmap -- it may also be very obvious)
        al_set_target_bitmap (al_get_backbuffer (display));
        al_draw_bitmap (tmp_buffer, 0, 0, 0);
    

    To explain further, if you have a pixel with 0.5 alpha, and you're using (ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA) for blending, the formula is:

        a := da * dst + sa * src
    

    Expands to:

        result_a := dst_a * (1-0.5) + 0.5 * 0.5
    

    So if you draw the image to the temporary buffer, it is blended once resulting in 0.75 alpha, then drawn again to the screen, blended in the same way, resulting in a pixel has 0.1875 as an alpha value.

  • ALLEGRO_KEEP_INDEX

    Load the palette indices of 8-bit .bmp and .pcx files instead of the rgb colors.

  • ALLEGRO_KEEP_BITMAP_FORMAT

    Force the resulting ALLEGRO_BITMAP to use the same format as the file.

    This is not yet honoured.

Returns

Nil on error.

See also
al_load_bitmap
Loads an image file into a new ALLEGRO_BITMAPptr.
FUNCTION al_load_bitmap_f (fp: ALLEGRO_FILEptr; CONST ident: AL_STRptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Loads an image from an ALLEGRO_FILEptr stream into a new ALLEGRO_BITMAPptr. The file type is determined by the passed ident parameter, which is a file name extension including the leading dot. If (and only if) ident is Nil, the file type is determined with al_identify_bitmap_f instead.

This is the same as calling al_load_bitmap_flags_f with 0 for the flags parameter.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Returns

Nil on error. The file remains open afterwards.

See also
al_load_bitmap_flags_f
Loads an image from an ALLEGRO_FILEptr stream into a new ALLEGRO_BITMAPptr.
al_load_bitmap
Loads an image file into a new ALLEGRO_BITMAPptr.
al_register_bitmap_loader_f
Registers a handler for al_load_bitmap_f.
al_init_image_addon
Initializes the image addon.
FUNCTION al_load_bitmap_flags_f ( fp: ALLEGRO_FILEptr; CONST ident: AL_STR; flags: AL_INT ): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Loads an image from an ALLEGRO_FILEptr stream into a new ALLEGRO_BITMAPptr. The file type is determined by the passed ident parameter, which is a file name extension including the leading dot. If (and only if) ident is Nil, the file type is determined with al_identify_bitmap_f instead.

The flags parameter is the same as for al_load_bitmap_flags.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Returns

Nil on error. The file remains open afterwards.

See also
al_load_bitmap_f
Loads an image from an ALLEGRO_FILEptr stream into a new ALLEGRO_BITMAPptr.
al_load_bitmap_flags
Loads an image file into a new ALLEGRO_BITMAPptr.
FUNCTION al_save_bitmap (CONST filename: AL_STR; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Saves an ALLEGRO_BITMAP to an image file. The file type is determined by the extension.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Returns

True on success, False on error.

See also
al_save_bitmap_f
Saves an ALLEGRO_BITMAP to an ALLEGRO_FILE stream.
al_register_bitmap_saver
Registers a handler for al_save_bitmap.
al_init_image_addon
Initializes the image addon.
FUNCTION al_save_bitmap_f ( fp: ALLEGRO_FILEptr; CONST ident: AL_STR; bitmap: ALLEGRO_BITMAPptr ): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Saves an ALLEGRO_BITMAP to an ALLEGRO_FILE stream. The file type is determined by the passed ident parameter, which is a file name extension including the leading dot.

Note: the core Allegro library does not support any image file formats by default. You must use the al5image addon, or register your own format handler.

Returns

True on success, False on error.

See also
al_save_bitmap
Saves an ALLEGRO_BITMAP to an image file.
al_register_bitmap_saver_f
Registers a handler for al_save_bitmap_f.
al_init_image_addon
Initializes the image addon.
FUNCTION al_identify_bitmap_f (fp: ALLEGRO_FILEptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Tries to guess the bitmap file type of the given file by reading the first few bytes. The extension, if any, of the passed filename is not taken into account - only the file contents. By default Allegro cannot recognize any file types, but calling al_init_image_addon will add detection of (some of) the types it can read.

Returns

a pointer to a static string with a file extension for the type, including the leading dot. For example ".png" or ".jpg". Returns Nil if the bitmap type cannot be determined.

See also
al_init_image_addon
Initializes the image addon.
al_identify_bitmap
This works exactly as al_identify_bitmap_f but you specify the filename of the file for which to detect the type and not a file handle.
al_register_bitmap_identifier
Registers an identify handler for al_identify_bitmap.
FUNCTION al_identify_bitmap (CONST filename: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This works exactly as al_identify_bitmap_f but you specify the filename of the file for which to detect the type and not a file handle. The extension, if any, of the passed filename is not taken into account - only the file contents.

Returns

a pointer to a static string with a file extension for the type, including the leading dot. For example ".png" or ".jpg". Returns Nil if the bitmap type cannot be determined.

See also
al_init_image_addon
Initializes the image addon.
al_identify_bitmap_f
Tries to guess the bitmap file type of the given file by reading the first few bytes.
al_register_bitmap_identifier
Registers an identify handler for al_identify_bitmap.
FUNCTION al_lock_bitmap (bitmap: ALLEGRO_BITMAPptr; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Lock an entire bitmap for reading or writing. If the bitmap is a display bitmap it will be updated from system memory after the bitmap is unlocked (unless locked read only).

On some platforms, Allegro automatically backs up the contents of video bitmaps because they may be occasionally lost (see discussion in al_create_bitmap's documentation). If you're completely recreating the bitmap contents often (e.g. every frame) then you will get much better performance by creating the target bitmap with ALLEGRO_NO_PRESERVE_TEXTURE flag.

Note: While a bitmap is locked, you can not use any drawing operations on it (with the sole exception of al_put_pixel and al_put_blended_pixel).

Parameters
flags

  • ALLEGRO_LOCK_READONLY The locked region will not be written to. This can be faster if the bitmap is a video texture, as it can be discarded after the lock instead of uploaded back to the card.

  • ALLEGRO_LOCK_WRITEONLY The locked region will not be read from. This can be faster if the bitmap is a video texture, as no data need to be read from the video card. You are required to fill in all pixels before unlocking the bitmap again, so be careful when using this flag.

  • ALLEGRO_LOCK_READWRITE The locked region can be written to and read from. Use this flag if a partial number of pixels need to be written to, even if reading is not needed.

format
Indicates the pixel format that the returned buffer will be in. To lock in the same format as the bitmap stores its data internally, call with al_get_bitmap_format (bitmap) as the format or use ALLEGRO_PIXEL_FORMAT_ANY. Locking in the native format will usually be faster. If the bitmap format is compressed, using ALLEGRO_PIXEL_FORMAT_ANY will choose an implementation defined non-compressed format.
Returns

Nil if the bitmap cannot be locked, e.g. the bitmap was locked previously and not unlocked. This function also returns Nil if the format is a compressed format.

See also
ALLEGRO_LOCKED_REGION
Users who wish to manually edit or read from a bitmap are required to lock it first.
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_unlock_bitmap
Unlock a previously locked bitmap or bitmap region.
al_lock_bitmap_region
Like al_lock_bitmap, but only locks a specific area of the bitmap.
al_lock_bitmap_blocked
Like al_lock_bitmap, but allows locking bitmaps with a blocked pixel format (i.e.
al_lock_bitmap_region_blocked
Like al_lock_bitmap_blocked, but allows locking a sub-region, for performance.
FUNCTION al_lock_bitmap_region (bitmap: ALLEGRO_BITMAPptr; x, y, width, height: AL_INT; format: ALLEGRO_PIXEL_FORMAT; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_lock_bitmap, but only locks a specific area of the bitmap. If the bitmap is a video bitmap, only that area of the texture will be updated when it is unlocked. Locking only the region you indend to modify will be faster than locking the whole bitmap.

Note: Using the ALLEGRO_LOCK_WRITEONLY with a blocked pixel format (i.e. formats for which al_get_pixel_block_width or al_get_pixel_block_height do not return 1) requires you to have the region be aligned to the block width for optimal performance. If it is not, then the function will have to lock the region with the ALLEGRO_LOCK_READWRITE instead in order to pad this region with valid data.

See also
ALLEGRO_LOCKED_REGION
Users who wish to manually edit or read from a bitmap are required to lock it first.
ALLEGRO_PIXEL_FORMAT
Pixel formats.
al_unlock_bitmap
Unlock a previously locked bitmap or bitmap region.
FUNCTION al_lock_bitmap_blocked (bitmap: ALLEGRO_BITMAPptr; flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_lock_bitmap, but allows locking bitmaps with a blocked pixel format (i.e. a format for which al_get_pixel_block_width or al_get_pixel_block_height do not return 1) in that format. To that end, this function also does not allow format conversion. For bitmap formats with a block size of 1, this function is identical to calling al_lock_bitmap (bmp, al_get_bitmap_format (bmp), flags).

Note: Currently there are no drawing functions that work when the bitmap is locked with a compressed format. al_get_pixel will also not work.

See also
al_lock_bitmap
Lock an entire bitmap for reading or writing.
al_lock_bitmap_region_blocked
Like al_lock_bitmap_blocked, but allows locking a sub-region, for performance.
FUNCTION al_lock_bitmap_region_blocked (bitmap: ALLEGRO_BITMAPptr; x_block, y_block, width_block, height_block, flags: AL_INT): ALLEGRO_LOCKED_REGIONptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_lock_bitmap_blocked, but allows locking a sub-region, for performance. Unlike al_lock_bitmap_region the region specified in terms of blocks and not pixels.

See also
al_lock_bitmap_region
Like al_lock_bitmap, but only locks a specific area of the bitmap.
al_lock_bitmap_blocked
Like al_lock_bitmap, but allows locking bitmaps with a blocked pixel format (i.e.
PROCEDURE al_unlock_bitmap (bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Unlock a previously locked bitmap or bitmap region. If the bitmap is a video bitmap, the texture will be updated to match the system memory copy (unless it was locked read only).

See also
al_lock_bitmap
Lock an entire bitmap for reading or writing.
al_lock_bitmap_region
Like al_lock_bitmap, but only locks a specific area of the bitmap.
al_lock_bitmap_blocked
Like al_lock_bitmap, but allows locking bitmaps with a blocked pixel format (i.e.
al_lock_bitmap_region_blocked
Like al_lock_bitmap_blocked, but allows locking a sub-region, for performance.
FUNCTION al_is_bitmap_locked (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns whether or not a bitmap is already locked.

See also
al_lock_bitmap
Lock an entire bitmap for reading or writing.
al_lock_bitmap_region
Like al_lock_bitmap, but only locks a specific area of the bitmap.
al_unlock_bitmap
Unlock a previously locked bitmap or bitmap region.
PROCEDURE al_set_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the function to use for blending for the current thread.

Blending means, the source and destination colors are combined in drawing operations.

Assume the source color (e.g. color of a rectangle to draw, or pixel of a bitmap to draw) is given as its red/green/blue/alpha components (if the bitmap has no alpha it always is assumed to be fully opaque, so 255 for 8-bit or 1.0 for floating point): s = s.r, s.g, s.b, s.a. And this color is drawn to a destination, which already has a color: d = d.r, d.g, d.b, d.a.

The conceptional formula used by Allegro to draw any pixel then depends on the op parameter:

  • ALLEGRO_ADD

         r = d.r * df.r + s.r * sf.r
         g = d.g * df.g + s.g * sf.g
         b = d.b * df.b + s.b * sf.b
         a = d.a * df.a + s.a * sf.a
    

  • ALLEGRO_DEST_MINUS_SRC

         r = d.r * df.r - s.r * sf.r
         g = d.g * df.g - s.g * sf.g
         b = d.b * df.b - s.b * sf.b
         a = d.a * df.a - s.a * sf.a
    

  • ALLEGRO_SRC_MINUS_DEST

         r = s.r * sf.r - d.r * df.r
         g = s.g * sf.g - d.g * df.g
         b = s.b * sf.b - d.b * df.b
         a = s.a * sf.a - d.a * df.a
    

Valid values for the factors sf and df passed to this function are as follows, where s is the source color, d the destination color and cc the color set with al_set_blend_color (white by default)

  • ALLEGRO_ZERO f = 0, 0, 0, 0

  • ALLEGRO_ONE f = 1, 1, 1, 1

  • ALLEGRO_ALPHA f = s.a, s.a, s.a, s.a

  • ALLEGRO_INVERSE_ALPHA f = 1 - s.a, 1 - s.a, 1 - s.a, 1 - s.a

  • ALLEGRO_SRC_COLOR f = s.r, s.g, s.b, s.a

  • ALLEGRO_DEST_COLOR f = d.r, d.g, d.b, d.a

  • ALLEGRO_INVERSE_SRC_COLOR f = 1 - s.r, 1 - s.g, 1 - s.b, 1 - s.a

  • ALLEGRO_INVERSE_DEST_COLOR f = 1 - d.r, 1 - d.g, 1 - d.b, 1 - d.a

  • ALLEGRO_CONST_COLOR f = cc.r, cc.g, cc.b, cc.a

  • ALLEGRO_INVERSE_CONST_COLOR f = 1 - cc.r, 1 - cc.g, 1 - cc.b, 1 - cc.a

So for example, to restore the default of using premultiplied alpha blending, you would use:

al_set_blender (ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA);

As formula:

r = d.r * (1 - s.a) + s.r * 1
g = d.g * (1 - s.a) + s.g * 1
b = d.b * (1 - s.a) + s.b * 1
a = d.a * (1 - s.a) + s.a * 1

If you are using non-pre-multiplied alpha, you could use

al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA);

Additive blending would be achieved with

al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE);

Copying the source to the destination (including alpha) unmodified

al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO);

Multiplying source and destination components

al_set_blender(ALLEGRO_ADD, ALLEGRO_DEST_COLOR, ALLEGRO_ZERO)

Tinting the source (like al_draw_tinted_bitmap)

al_set_blender(ALLEGRO_ADD, ALLEGRO_CONST_COLOR, ALLEGRO_ONE);
al_set_blend_color(al_map_rgb(0, 96, 255)); /* nice Chrysler blue */

Averaging source and destination pixels

al_set_blender(ALLEGRO_ADD, ALLEGRO_CONST_COLOR, ALLEGRO_CONST_COLOR);
al_set_blend_color(al_map_rgba_f(0.5, 0.5, 0.5, 0.5));

As formula:

r = d.r * 0 + s.r * d.r
g = d.g * 0 + s.g * d.g
b = d.b * 0 + s.b * d.b
a = d.a * 0 + s.a * d.a

See also
al_set_separate_blender
Like al_set_blender, but allows specifying a separate blending operation for the alpha channel.
al_set_blend_color
Sets the color to use for blending when using the ALLEGRO_CONST_COLOR or ALLEGRO_INVERSE_CONST_COLOR blend functions.
al_get_blender
Returns the active blender for the current thread.
PROCEDURE al_set_blend_color (color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the color to use for blending when using the ALLEGRO_CONST_COLOR or ALLEGRO_INVERSE_CONST_COLOR blend functions. See al_set_blender for more information.

See also
al_set_blender
Sets the function to use for blending for the current thread.
al_get_blend_color
Returns the color currently used for constant color blending (white by default).
PROCEDURE al_get_blender (OUT op: ALLEGRO_BLEND_OPERATIONS; OUT source, dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the active blender for the current thread.

See also
al_set_blender
Sets the function to use for blending for the current thread.
al_get_separate_blender
FUNCTION al_get_blend_color: ALLEGRO_COLOR; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the color currently used for constant color blending (white by default).

See also
al_set_blend_color
Sets the color to use for blending when using the ALLEGRO_CONST_COLOR or ALLEGRO_INVERSE_CONST_COLOR blend functions.
al_set_blender
Sets the function to use for blending for the current thread.
PROCEDURE al_set_separate_blender (op: ALLEGRO_BLEND_OPERATIONS; source, dest: ALLEGRO_BLEND_MODE; alpha_op: ALLEGRO_BLEND_OPERATIONS; alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_set_blender, but allows specifying a separate blending operation for the alpha channel. This is useful if your target bitmap also has an alpha channel and the two alpha channels need to be combined in a different way than the color components.

See also
al_set_blender
Sets the function to use for blending for the current thread.
al_get_blender
Returns the active blender for the current thread.
al_get_separate_blender
PROCEDURE al_get_separate_blender (OUT op: ALLEGRO_BLEND_OPERATIONS; OUT source, dest: ALLEGRO_BLEND_MODE; OUT alpha_op: ALLEGRO_BLEND_OPERATIONS; OUT alpha_source, alpha_dest: ALLEGRO_BLEND_MODE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION ALLEGRO_EVENT_TYPE_IS_USER (t: ALLEGRO_EVENT_TYPE): AL_BOOL; INLINE;

Returns True if the event type is not a builtin event type, i.e. one of those described in ALLEGRO_EVENT_TYPE.

FUNCTION ALLEGRO_GET_EVENT_TYPE (CONST str: SHORTSTRING): AL_INT; INLINE;

Makes an event type identifier, which is a 32-bit integer. Usually, but not necessarily, this will be made from four 8-bit character codes, for example:

  MY_EVENT_TYPE := ALLEGRO_GET_EVENT_TYPE ('MINE');

IDs less than 1024 are reserved for Allegro or its addons. Don't use anything lower than ALLEGRO_GET_EVENT_TYPE (#0#0#4#0).

You should try to make your IDs unique so they don't clash with any 3rd party code you may be using. Be creative. Numbering from 1024 is not creative.

If you need multiple identifiers, you could define them like this:

  BASE_EVENT := ALLEGRO_GET_EVENT_TYPE ('MINE');
  BARK_EVENT := BASE_EVENT + 1;
  MEOW_EVENT := BASE_EVENT + 2;
  SQUAWK_EVENT := BASE_EVENT + 3;

See also
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
ALLEGRO_USER_EVENT
ALLEGRO_EVENT_TYPE_IS_USER
Returns True if the event type is not a builtin event type, i.e.
PROCEDURE al_init_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Initialices an event source for emitting user events. The space for the event source must already have been allocated.

One possible way of creating custom event sources is to derive other structures with ALLEGRO_EVENT_SOURCE at the head, e.g.

TYPE
  THINGptr = ˆTHING;
  THING = RECORD
    event_source: ALLEGRO_EVENT_SOURCE;
    field1, field2: INTEGER;
    // etc.
  END;

FUNCTION CreateThing: THINGptr;
BEGIN
  RESULT := getmem (sizeof (THING));
  IF RESULT <> NIL THEN
  BEGIN
    al_init_user_event_source (@(RESULTˆ.event_source));
    RESULTˆ.field1 := 0;
    RESULTˆ.field2 := 0;
  END
END;

The advantage here is that the THING pointer will be the same as the ALLEGRO_EVENT_SOURCE pointer. Events emitted by the event source will have the event source pointer as the source field, from which you can get a pointer to a THING by a simple cast (after ensuring checking the event is of the correct type).

However, it is only one technique and you are not obliged to use it.

The user event source will never be destroyed automatically. You must destroy it manually with al_destroy_user_event_source.

See also
ALLEGRO_EVENT_SOURCE
An event source is any object which can generate events.
al_destroy_user_event_source
Destroys an event source initialised with al_init_user_event_source.
al_emit_user_event
The second argument is ALLEGRO_EVENT instead of ALLEGRO_USER_EVENT * to prevent users passing a pointer to a too-short structure.
ALLEGRO_USER_EVENT
PROCEDURE al_destroy_user_event_source (source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Destroys an event source initialised with al_init_user_event_source.

This does not free the memory, as that was user allocated to begin with.

See also
ALLEGRO_EVENT_SOURCE
An event source is any object which can generate events.
FUNCTION al_emit_user_event ( source: ALLEGRO_EVENT_SOURCEptr; Event: ALLEGRO_EVENTptr; dtor: ALLEGRO_EVENT_DTOR_PROC ): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

The second argument is ALLEGRO_EVENT instead of ALLEGRO_USER_EVENT * to prevent users passing a pointer to a too-short structure.

PROCEDURE al_unref_user_event (event: ALLEGRO_USER_EVENTptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_event_source_data (source: ALLEGRO_EVENT_SOURCEptr; data: AL_POINTER); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_event_source_data (CONST source: ALLEGRO_EVENT_SOURCEptr): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_create_event_queue: ALLEGRO_EVENT_QUEUEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a new, empty event queue.

Returns

A pointer to the newly created object if successful, Nil on error.

See also
al_register_event_source
Register the event source with the event queue specified.
al_destroy_event_queue
Destroys the event queue specified.
ALLEGRO_EVENT_QUEUEptr
PROCEDURE al_destroy_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Destroys the event queue specified. All event sources currently registered with the queue will be automatically unregistered before the queue is destroyed.

See also
al_create_event_queue
Creates a new, empty event queue.
ALLEGRO_EVENT_QUEUEptr
FUNCTION al_is_event_source_registered (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_register_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Register the event source with the event queue specified. An event source may be registered with any number of event queues simultaneously, or none. Trying to register an event source with the same event queue more than once does nothing.

See also
al_unregister_event_source
ALLEGRO_EVENT_SOURCE
An event source is any object which can generate events.
PROCEDURE al_unregister_event_source (queue: ALLEGRO_EVENT_QUEUEptr; source: ALLEGRO_EVENT_SOURCEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_pause_event_queue (queue: ALLEGRO_EVENT_QUEUEptr; pause: AL_BOOL); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_is_event_queue_paused (CONST queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_is_event_queue_empty (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Takes the next event out of the event queue specified, and copy the contents into ret_event, returning True. The original event will be removed from the queue. If the event queue is empty, returns False and the contents of ret_event are unspecified.

See also
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
al_peek_next_event
al_wait_for_event
Wait until the event queue specified is non-empty.
FUNCTION al_peek_next_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_drop_next_event (queue: ALLEGRO_EVENT_QUEUEptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_flush_event_queue (queue: ALLEGRO_EVENT_QUEUEptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_wait_for_event (queue: ALLEGRO_EVENT_QUEUEptr; OUT ret_event: ALLEGRO_EVENT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Wait until the event queue specified is non-empty. The first event in the queue will be copied into ret_event and removed from the queue.

See also
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
al_wait_for_event_timed
al_wait_for_event_until
al_get_next_event
Takes the next event out of the event queue specified, and copy the contents into ret_event, returning True.
FUNCTION al_wait_for_event_timed (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; secs: AL_FLOAT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_wait_for_event_until (queue: ALLEGRO_EVENT_QUEUEptr; OUT event: ALLEGRO_EVENT; VAR timeout: ALLEGRO_TIMEOUT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_create_display (w, h: AL_INT): ALLEGRO_DISPLAYptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a display, or window, with the specified dimensions. The parameters of the display are determined by the last calls to al_set_new_display_* . Default parameters are used if none are set explicitly. Creating a new display will automatically make it the active one, with the backbuffer selected for drawing.

Each display that uses OpenGL as a backend has a distinct OpenGL rendering context associated with it. See al_set_target_bitmap for the discussion about rendering contexts.

Returns

Nil on error.

See also
al_set_new_display_flags
Sets various flags to be used when creating new displays on the calling thread.
al_set_new_display_option
Set an extra display option, to be used when creating new displays on the calling thread.
al_set_new_display_refresh_rate
al_set_new_display_adapter
al_set_new_window_title
al_destroy_display
Destroys a display.
PROCEDURE al_destroy_display (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Destroys a display.

If the target bitmap of the calling thread is tied to the display, then it implies a call to al_set_target_bitmap (Nil); before the display is destroyed.

That special case notwithstanding, you should make sure no threads are currently targeting a bitmap which is tied to the display before you destroy it.

See also
al_set_target_bitmap
This function selects the bitmap to which all subsequent drawing operations in the calling thread will draw to.
PROCEDURE al_set_new_display_flags (flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets various flags to be used when creating new displays on the calling thread. flags is a bitfield containing any reasonable combination of the following:

  • ALLEGRO_WINDOWED Prefer a windowed mode.

    Under multi-head X (not XRandR/TwinView), the use of more than one adapter is impossible due to bugs in X and GLX. al_create_display will fail if more than one adapter is attempted to be used.

  • ALLEGRO_FULLSCREEN_WINDOW Make the window span the entire screen. Unlike ALLEGRO_FULLSCREEN this will never attempt to modify the screen resolution. Instead the pixel dimensions of the created display will be the same as the desktop.

    The passed width and height are only used if the window is switched out of fullscreen mode later but will be ignored initially.

    Under Windows and X11 a fullscreen display created with this flag will behave differently from one created with the ALLEGRO_FULLSCREEN flag - even if the ALLEGRO_FULLSCREEN display is passed the desktop dimensions. The exact difference is platform dependent, but some things which may be different is how alt-tab works, how fast you can toggle between fullscreen/windowed mode or how additional monitors behave while your display is in fullscreen mode.

    Additionally under X, the use of more than one adapter in multi-head mode or with true Xinerama enabled is impossible due to bugs in X/GLX, creation will fail if more than one adapter is attempted to be used.

  • ALLEGRO_FULLSCREEN Prefer a fullscreen mode.

    Under X the use of more than one FULLSCREEN display when using multi-head X, or true Xinerama is not possible due to bugs in X and GLX, display creation will fail if more than one adapter is attempted to be used.

    Note: Prefer using ALLEGRO_FULLSCREEN_WINDOW as it typically provides a better user experience as the monitor doesn't change resolution and switching away from your game via Alt-Tab works smoothly. ALLEGRO_FULLSCREEN is typically less well supported compared to ALLEGRO_FULLSCREEN_WINDOW.

  • ALLEGRO_RESIZABLE The display is resizable (only applicable if combined with ALLEGRO_WINDOWED).

  • ALLEGRO_MAXIMIZED The display window will be maximized (only applicable if combined with ALLEGRO_RESIZABLE).

  • ALLEGRO_OPENGL Require the driver to provide an initialized OpenGL context after returning successfully.

  • ALLEGRO_OPENGL_3_0 Require the driver to provide an initialized OpenGL context compatible with OpenGL version 3.0.

  • ALLEGRO_OPENGL_FORWARD_COMPATIBLE If this flag is set, the OpenGL context created with ALLEGRO_OPENGL_3_0 will be forward compatible only, meaning that all of the OpenGL API declared deprecated in OpenGL 3.0 will not be supported. Currently, a display created with this flag will not be compatible with Allegro drawing routines; the display option ALLEGRO_COMPATIBLE_DISPLAY will be set to false.

  • ALLEGRO_OPENGL_ES_PROFILE Used together with ALLEGRO_OPENGL, requests that the OpenGL context uses the OpenGL ES profile. A specific version can be requested with al_set_new_display_option. Note: Currently this is only supported by the X11/GLX driver.

  • ALLEGRO_DIRECT3D Require the driver to do rendering with Direct3D and provide a Direct3D device.

  • ALLEGRO_PROGRAMMABLE_PIPELINE Require a programmable graphics pipeline. This flag is required to use ALLEGRO_SHADER objects.

  • ALLEGRO_FRAMELESS Try to create a window without a frame (i.e. no border or titlebar). This usually does nothing for fullscreen modes, and even in windowed modes it depends on the underlying platform whether it is supported or not.

  • ALLEGRO_GENERATE_EXPOSE_EVENTS Let the display generate expose events.

  • ALLEGRO_GTK_TOPLEVEL Create a GTK toplevel window for the display, on X. This flag is conditionally defined by the native dialog addon. You must call al_init_native_dialog_addon for it to succeed. ALLEGRO_GTK_TOPLEVEL is incompatible with ALLEGRO_FULLSCREEN.

0 can be used for default values.

See also
al_set_new_display_option
Set an extra display option, to be used when creating new displays on the calling thread.
al_get_display_option
al_set_display_option
PROCEDURE al_set_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; value, importance: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Set an extra display option, to be used when creating new displays on the calling thread. Display options differ from display flags, and specify some details of the context to be created within the window itself. These mainly have no effect on Allegro itself, but you may want to specify them, for example if you want to use multisampling.

The importance parameter can be either:

  • ALLEGRO_REQUIRE - The display will not be created if the setting can not be met.

  • ALLEGRO_SUGGEST - If the setting is not available, the display will be created anyway with a setting as close as possible to the requested one. You can query the actual value used in that case by calling al_get_display_option after the display has been created.

  • ALLEGRO_DONTCARE - If you added a display option with one of the above two settings before, it will be removed again. Else this does nothing.

The supported options are:

  • ALLEGRO_COLOR_SIZE - This can be used to ask for a specific bit depth. For example to force a 16-bit framebuffer set this to 16.

  • ALLEGRO_RED_SIZE, ALLEGRO_GREEN_SIZE, ALLEGRO_BLUE_SIZE, ALLEGRO_ALPHA_SIZE - Individual color component size in bits.

  • ALLEGRO_RED_SHIFT, ALLEGRO_GREEN_SHIFT, ALLEGRO_BLUE_SHIFT, ALLEGRO_ALPHA_SHIFT - Together with the previous settings these can be used to specify the exact pixel layout the display should use. Normally there is no reason to use these.

  • ALLEGRO_ACC_RED_SIZE, ALLEGRO_ACC_GREEN_SIZE, ALLEGRO_ACC_BLUE_SIZE, ALLEGRO_ACC_ALPHA_SIZE - This can be used to define the required accumulation buffer size.

  • ALLEGRO_STEREO - Whether the display is a stereo display.

  • ALLEGRO_AUX_BUFFERS - Number of auxiliary buffers the display should have.

  • ALLEGRO_DEPTH_SIZE - How many depth buffer (z-buffer) bits to use.

  • ALLEGRO_STENCIL_SIZE - How many bits to use for the stencil buffer.

  • ALLEGRO_SAMPLE_BUFFERS - Whether to use multisampling (1) or not (0).

  • ALLEGRO_SAMPLES - If the above is 1, the number of samples to use per pixel. Else 0.

  • ALLEGRO_RENDER_METHOD: - 0 if hardware acceleration is not used with this display.

  • ALLEGRO_FLOAT_COLOR - Whether to use floating point color components.

  • ALLEGRO_FLOAT_DEPTH - Whether to use a floating point depth buffer.

  • ALLEGRO_SINGLE_BUFFER - Whether the display uses a single buffer (1) or another update method (0).

  • ALLEGRO_SWAP_METHOD - If the above is 0, this is set to 1 to indicate the display is using a copying method to make the next buffer in the flip chain available, or to 2 to indicate a flipping or other method.

  • ALLEGRO_COMPATIBLE_DISPLAY - Indicates if Allegro's graphics functions can use this display. If you request a display not useable by Allegro, you can still use for example OpenGL to draw graphics.

  • ALLEGRO_UPDATE_DISPLAY_REGION - Set to 1 if the display is capable of updating just a region, and 0 if calling al_update_display_region is equivalent to al_flip_display.

  • ALLEGRO_VSYNC - Set to 1 to tell the driver to wait for vsync in al_flip_display, or to 2 to force vsync off. The default of 0 means that Allegro does not try to modify the vsync behavior so it may be on or off. Note that even in the case of 1 or 2 it is possible to override the vsync behavior in the graphics driver so you should not rely on it.

  • ALLEGRO_MAX_BITMAP_SIZE - When queried this returns the maximum size (width as well as height) a bitmap can have for this display. Calls to al_create_bitmap or al_load_bitmap for bitmaps larger than this size will fail. It does not apply to memory bitmaps which always can have arbitrary size (but are slow for drawing).

  • ALLEGRO_SUPPORT_NPOT_BITMAP - Set to 1 if textures used for bitmaps on this display can have a size which is not a power of two. This is mostly useful if you use Allegro to load textures as otherwise only power-of-two textures will be used internally as bitmap storage.

  • ALLEGRO_CAN_DRAW_INTO_BITMAP - Set to 1 if you can use al_set_target_bitmap on bitmaps of this display to draw into them. If this is not the case software emulation will be used when drawing into display bitmaps (which can be very slow).

  • ALLEGRO_SUPPORT_SEPARATE_ALPHA - This is set to 1 if the al_set_separate_blender function is supported. Otherwise the alpha parameters will be ignored.

  • ALLEGRO_AUTO_CONVERT_BITMAPS - This is on by default. It causes any existing memory bitmaps with the ALLEGRO_CONVERT_BITMAP flag to be converted to a display bitmap of the newly created display with the option set.

  • ALLEGRO_SUPPORTED_ORIENTATIONS - This is a bit-combination of the orientations supported by the application. The orientations are the same as for al_get_display_orientation with the additional possibilities:

    • ALLEGRO_DISPLAY_ORIENTATION_PORTRAIT - means only the two portrait orientations are supported.

    • ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE - means only the two landscape orientations

    • ALLEGRO_DISPLAY_ORIENTATION_ALL - allows all four orientations.

    When the orientation changes between a portrait and a landscape orientation the display needs to be resized. This is done by sending an ALLEGRO_EVENT_DISPLAY_RESIZE message which should be handled by calling al_acknowledge_resize.

  • ALLEGRO_OPENGL_MAJOR_VERSION - Request a specific OpenGL major version.

  • ALLEGRO_OPENGL_MINOR_VERSION - Request a specific OpenGL minor version.

See also
al_set_new_display_flags
Sets various flags to be used when creating new displays on the calling thread.
al_get_display_option
FUNCTION al_get_display_flags (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Gets the flags of the display.

In addition to the flags set for the display at creation time with al_set_new_display_flags it can also have the ALLEGRO_MINIMIZED flag set, indicating that the window is currently minimized. This flag is very platform-dependent as even a minimized application may still render a preview version so normally you should not care whether it is minimized or not.

See also
al_set_new_display_flags
Sets various flags to be used when creating new displays on the calling thread.
al_set_display_flag
Enable or disable one of the display flags.
FUNCTION al_set_display_flag (display: ALLEGRO_DISPLAYptr; flag: AL_INT; onoff: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Enable or disable one of the display flags. The flags are the same as for al_set_new_display_flags. The only flags that can be changed after creation are:

    ALLEGRO_FULLSCREEN_WINDOW
    ALLEGRO_FRAMELESS
    ALLEGRO_MAXIMIZED

You can use al_get_display_flags to query whether the given display property actually changed.

Returns

True if the driver supports toggling the specified flag else False.

See also
al_set_new_display_flags
Sets various flags to be used when creating new displays on the calling thread.
al_get_display_flags
Gets the flags of the display.
PROCEDURE al_set_new_display_refresh_rate (refresh_rate: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_new_display_refresh_rate: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_new_display_flags: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_new_window_title (CONST title: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_new_window_title: AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_width (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_height (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_format (display: ALLEGRO_DISPLAYptr): ALLEGRO_PIXEL_FORMAT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Gets the pixel format of the display.

FUNCTION al_get_display_refresh_rate (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_orientation (display: ALLEGRO_DISPLAYptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_toggle_display_flag (display: ALLEGRO_DISPLAYptr; flag: AL_INT; onoff: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_current_display: ALLEGRO_DISPLAYptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_target_bitmap (Bitmap: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This function selects the bitmap to which all subsequent drawing operations in the calling thread will draw to. To return to drawing to a display, set the backbuffer of the display as the target bitmap, using al_get_backbuffer. As a convenience, you may also use al_set_target_backbuffer.

Each video bitmap is tied to a display. When a video bitmap is set to as the target bitmap, the display that the bitmap belongs to is automatically made "current" for the calling thread (if it is not current already). Then drawing other bitmaps which are tied to the same display can be hardware accelerated.

A single display cannot be current for multiple threads simultaneously. If you need to release a display, so it is not current for the calling thread, call al_set_target_bitmap (Nil);

Setting a memory bitmap as the target bitmap will not change which display is current for the calling thread.

On some platforms, Allegro automatically backs up the contents of video bitmaps because they may be occasionally lost (see discussion in al_create_bitmap's documentation). If you're completely recreating the bitmap contents often (e.g. every frame) then you will get much better performance by creating the target bitmap with ALLEGRO_NO_PRESERVE_TEXTURE flag.

OpenGL note:

Framebuffer objects (FBOs) allow OpenGL to directly draw to a bitmap, which is very fast. When using an OpenGL display, if all of the following conditions are met an FBO will be created for use with the bitmap:

  • The GL_EXT_framebuffer_object OpenGL extension is available.

  • The bitmap is not a memory bitmap.

  • The bitmap is not currently locked.

In Allegro 5.0.0, you had to be careful as an FBO would be kept around until the bitmap is destroyed or you explicitly called al_remove_opengl_fbo on the bitmap, wasting resources. In newer versions, FBOs will be freed automatically when the bitmap is no longer the target bitmap, unless you have called al_get_opengl_fbo to retrieve the FBO id.

In the following example, no FBO will be created:

lock := al_lock_bitmap (bitmap);
al_set_target_bitmap (bitmap);
al_put_pixel (x, y, color);
al_unlock_bitmap (bitmap);

The above allows using al_put_pixel on a locked bitmap without creating an FBO.

In this example an FBO is created however:

al_set_target_bitmap(bitmap);
al_draw_line(x1, y1, x2, y2, color, 0);

An OpenGL command will be used to directly draw the line into the bitmap's associated texture.

See also
al_get_target_bitmap
Returns the target bitmap of the calling thread.
al_set_target_backbuffer
Same as al_set_target_bitmap(al_get_backbuffer(display));.
PROCEDURE al_set_target_backbuffer (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Same as al_set_target_bitmap(al_get_backbuffer(display));.

See also
al_set_target_bitmap
This function selects the bitmap to which all subsequent drawing operations in the calling thread will draw to.
al_get_backbuffer
Returns a special bitmap representing the back-buffer of the display.
FUNCTION al_get_backbuffer (display: ALLEGRO_DISPLAYptr): ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns a special bitmap representing the back-buffer of the display.

Care should be taken when using the backbuffer bitmap (and its sub-bitmaps) as the source bitmap (e.g as the bitmap argument to al_draw_bitmap). Only untransformed operations are hardware accelerated. These consist of al_draw_bitmap and al_draw_bitmap_region when the current transformation is the identity. If the tranformation is not the identity, or some other drawing operation is used, the call will be routed through the memory bitmap routines, which are slow. If you need those operations to be accelerated, then first copy a region of the backbuffer into a temporary bitmap (via the al_draw_bitmap and al_draw_bitmap_region), and then use that temporary bitmap as the source bitmap.

FUNCTION al_get_target_bitmap: ALLEGRO_BITMAPptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the target bitmap of the calling thread.

See also
al_set_target_bitmap
This function selects the bitmap to which all subsequent drawing operations in the calling thread will draw to.
FUNCTION al_acknowledge_resize (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

When the user receives a resize event from a resizable display, if they wish the display to be resized they must call this function to let the graphics driver know that it can now resize the display.

Adjusts the clipping rectangle to the full size of the backbuffer. This also resets the backbuffers projection transform to default orthographic transform (see al_use_projection_transform).

Note that a resize event may be outdated by the time you acknowledge it; there could be further resize events generated in the meantime.

Returns

True on success.

See also
al_resize_display
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
FUNCTION al_resize_display (display: ALLEGRO_DISPLAYptr; width, height: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_flip_display; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen. Pointers to the special back buffer bitmap remain valid and retain their semantics as the back buffer, although the contents may have changed.

Several display options change how this function behaves:

  • With ALLEGRO_SINGLE_BUFFER, no flipping is done. You still have to call this function to display graphics, depending on how the used graphics system works.

  • The ALLEGRO_SWAP_METHOD option may have additional information about what kind of operation is used internally to flip the front and back buffers.

  • If ALLEGRO_VSYNC is 1, this function will force waiting for vsync. If ALLEGRO_VSYNC is 2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, and ALLEGRO_VSYNC will not be set; in this case al_flip_display will wait for vsync depending on the settings set in the system's graphics preferences.

See also
al_set_new_display_flags
Sets various flags to be used when creating new displays on the calling thread.
al_set_new_display_option
Set an extra display option, to be used when creating new displays on the calling thread.
PROCEDURE al_update_display_region (x, y, Width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_is_compatible_bitmap (bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_wait_for_vsync: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Wait for the beginning of a vertical retrace. Some driver/card/monitor combinations may not be capable of this.

Note how al_flip_display usually already waits for the vertical retrace, so unless you are doing something special, there is no reason to call this function.

Returns

False if not possible, True if successful.

See also
al_flip_display
Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen.
FUNCTION al_get_display_event_source (display: ALLEGRO_DISPLAYptr): ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieve the associated event source. See the documentation on events for a list of the events displays will generate.

PROCEDURE al_set_display_icon (display: ALLEGRO_DISPLAYptr; icon: ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_display_icons (display: ALLEGRO_DISPLAYptr; num_icons: AL_INT; VAR icons: ARRAY OF ALLEGRO_BITMAPptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_new_display_adapter: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Stuff for multihead/window management

PROCEDURE al_set_new_display_adapter (adapter: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_new_window_position (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_get_new_window_position (OUT x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_window_position (display: ALLEGRO_DISPLAYptr; x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_get_window_position (display: ALLEGRO_DISPLAYptr; OUT x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_set_window_constraints (display: ALLEGRO_DISPLAYptr; min_w, min_h, max_w, max_h: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_window_constraints (display: ALLEGRO_DISPLAYptr; OUT min_w, min_h, max_w, max_h: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_window_title (display: ALLEGRO_DISPLAYptr; const title: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_new_display_option (option: ALLEGRO_DISPLAY_OPTIONS; VAR importance: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_reset_new_display_options; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_set_display_option (display: ALLEGRO_DISPLAYptr; option: ALLEGRO_DISPLAY_OPTIONS; value: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_option (display: ALLEGRO_DISPLAYptr; option: ALLEGRO_DISPLAY_OPTIONS): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_hold_bitmap_drawing (hold: AL_BOOL); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Deferred drawing

FUNCTION al_is_bitmap_drawing_held: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_acknowledge_drawing_halt (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_acknowledge_drawing_resume (display: ALLEGRO_DISPLAYptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_clipboard_text (display: ALLEGRO_DISPLAYptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

* clipboard.h * * Clipboard handling. ****************************************************************************

FUNCTION al_set_clipboard_text (display: ALLEGRO_DISPLAYptr; CONST text: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_clipboard_has_text (display: ALLEGRO_DISPLAYptr): AL_BOOL CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_create_config: ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates an empty configuration structure.

See also
al_load_config_file
Read a configuration file from disk.
al_destroy_config
Frees the resources used by a configuration structure.
PROCEDURE al_add_config_section (config: ALLEGRO_CONFIGptr; CONST name: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Adds a section to a configuration structure with the given name. If the section already exists then nothing happens.

PROCEDURE al_set_config_value (config: ALLEGRO_CONFIGptr; CONST section, key, value: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a value in a section of a configuration. If the section doesn't yet exist, it will be created. If a value already existed for the given key, it will be overwritten. The section can be '' for the global section.

For consistency with the on-disk format of config files, any leading and trailing whitespace will be stripped from the value. If you have significant whitespace you wish to preserve, you should add your own quote characters and remove them when reading the values back in.

See also
al_get_config_value
Sets a pointer to an internal character buffer that will only remain valid as long as the ALLEGRO_CONFIGptr structure is not destroyed.
PROCEDURE al_add_config_comment (config: ALLEGRO_CONFIGptr; CONST section, comment: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Adds a comment in a section of a configuration. If the section doesn't yet exist, it will be created. The section can be '' for the global section.

The comment may or may not begin with a hash character. Any newlines in the comment string will be replaced by space characters.

See also
al_add_config_section
Adds a section to a configuration structure with the given name.
FUNCTION al_get_config_value (CONST config: ALLEGRO_CONFIGptr; CONST section, key: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a pointer to an internal character buffer that will only remain valid as long as the ALLEGRO_CONFIGptr structure is not destroyed. Copy the value if you need a copy. The section can be '' for the global section.

Returns

Nil if section or key do not exist.

See also
al_set_config_value
Sets a value in a section of a configuration.
FUNCTION al_load_config_file (CONST filename: AL_STR): ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Read a configuration file from disk.

The configuration structure should be destroyed with al_destroy_config.)

Returns

Pointer to configuration or Nil on error.

See also
al_load_config_file_f
Read a configuration file from an already open file.
al_save_config_file
Write out a configuration file to disk.
FUNCTION al_load_config_file_f (fp: ALLEGRO_FILEptr): ALLEGRO_CONFIGptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Read a configuration file from an already open file.

Returns

Nil on error. The configuration structure should be destroyed with al_destroy_config. The file remains open afterwards.

See also
al_load_config_file
Read a configuration file from disk.
FUNCTION al_save_config_file (CONST filename: AL_STR; CONST config: ALLEGRO_CONFIGptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Write out a configuration file to disk.

Returns

True on success, False on error.

See also
al_save_config_file_f
Write out a configuration file to an already open file.
al_load_config_file
Read a configuration file from disk.
FUNCTION al_save_config_file_f (fp: ALLEGRO_FILEptr; CONST config: ALLEGRO_CONFIGptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Write out a configuration file to an already open file.

Returns

True on success, False on error. The file remains open afterwards.

See also
al_save_config_file
Write out a configuration file to disk.
PROCEDURE al_destroy_config (config: ALLEGRO_CONFIGptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Frees the resources used by a configuration structure. Does nothing if passed Nil.

FUNCTION al_remove_config_section (config: ALLEGRO_CONFIGptr; CONST section: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Removes a section of a configuration.

Returns

True if the section was removed, or False if the section did not exist.

FUNCTION al_remove_config_key (config: ALLEGRO_CONFIGptr; CONST section, key: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Removes a key and its associated value in a section of a configuration.

Returns

True if the entry was removed, or False if the entry did not exist.

FUNCTION al_get_first_config_section (CONST config: ALLEGRO_CONFIGptr; OUT iterator: ALLEGRO_CONFIG_SECTIONptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the name of the first section in the given config file. Usually this will return an empty string for the global section, even it contains no values. The iterator parameter will receive an opaque iterator which is used by al_get_next_config_section to iterate over the remaining sections.

The returned string and the iterator are only valid as long as no change is made to the passed ALLEGRO_CONFIGptr.

See also
al_get_next_config_section
Returns the name of the next section in the given config file or Nil if there are no more sections.
FUNCTION al_get_next_config_section (VAR iterator: ALLEGRO_CONFIG_SECTIONptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the name of the next section in the given config file or Nil if there are no more sections. The iterator must have been obtained with al_get_first_config_section first.

See also
al_get_first_config_section
Returns the name of the first section in the given config file.
FUNCTION al_get_first_config_entry ( CONST config: ALLEGRO_CONFIGptr; CONST section: AL_STR; OUT iterator: ALLEGRO_CONFIG_ENTRYptr ): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the name of the first key in the given section in the given config or Nil if the section is empty. The iterator works like the one for al_get_first_config_section

The returned string and the iterator are only valid as long as no change is made to the passed ALLEGRO_CONFIGptr.

See also
al_get_next_config_entry
Returns the next key for the iterator obtained by al_get_first_config_entry.
FUNCTION al_get_next_config_entry (VAR iterator: ALLEGRO_CONFIG_ENTRYptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the next key for the iterator obtained by al_get_first_config_entry. The iterator works like the one for al_get_next_config_section.

FUNCTION al_get_cpu_count: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the number of CPU cores that the system Allegro is running on has and which could be detected, or a negative number if detection failed. Even if a positive number is returned, it might be that it is not correct. For example, Allegro running on a virtual machine will return the amount of CPU's of the VM, and not that of the underlying system.

Furthermore even if the number is correct, this only gives you information about the total CPU cores of the system Allegro runs on. The amount of cores available to your program may be less due to circumstances such as programs that are currently running.

Therefore, it's best to use this for advisory purposes only. It is certainly a bad idea to make your program exclusive to systems for which this function returns a certain "desirable" number.

This function may be called prior to al_install_system or al_init.

FUNCTION al_get_ram_size: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the size in MB of the random access memory that the system Allegro is running on has and which could be detected, or a negative number if detection failed. Even if a positive number is returned, it might be that it is not correct. For example, Allegro running on a virtual machine will return the amount of RAM of the VM, and not that of the underlying system.

Furthermore even if the number is correct, this only gives you information about the total physical memory of the system Allegro runs on. The memory available to your program may be less due to circumstances such as virtual memory, and other programs that are currently running.

Therefore, it's best to use this for advisory purposes only. It is certainly a bad idea to make your program exclusive to systems for which this function returns a certain "desirable" number.

This function may be called prior to al_install_system or al_init.

PROCEDURE al_clear_to_color (color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Clears the complete target bitmap, but confined by the clipping rectangle.

See also
al_set_clipping_rectangle
Sets the region of the target bitmap or display that pixels get clipped to.
al_clear_depth_buffer
PROCEDURE al_clear_depth_buffer (x: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_draw_pixel (x, y: AL_FLOAT; color: ALLEGRO_COLOR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_errno: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Some Allegro functions will set an error number as well as returning an error code. Call this function to retrieve the last error number set for the calling thread.

See also
al_set_errno
Sets the error number for the calling thread.
PROCEDURE al_set_errno (errnum: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the error number for the calling thread.

See also
al_get_errno
Some Allegro functions will set an error number as well as returning an error code.
FUNCTION al_get_num_display_modes: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_display_mode (index: AL_INT; OUT mode: ALLEGRO_DISPLAY_MODE): ALLEGRO_DISPLAY_MODEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves a fullscreen mode. Display parameters should not be changed between a call of al_get_num_display_modes and al_get_display_mode.

Parameters
index
Must be between 0 and the number returned from al_get_num_display_modes - 1.
mode
Must be an allocated ALLEGRO_DISPLAY_MODE structure.
Returns

Nil on failure, and the mode parameter that was passed in on success.

See also
ALLEGRO_DISPLAY_MODE
al_get_num_display_modes
FUNCTION al_install_joystick: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Install a joystick driver, returning True if successful. If a joystick driver was already installed, returns True immediately.

See also
al_uninstall_joystick
PROCEDURE al_uninstall_joystick; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_is_joystick_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_reconfigure_joysticks: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_num_joysticks: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick (joyn: AL_INT): ALLEGRO_JOYSTICKptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_release_joystick (j: ALLEGRO_JOYSTICKptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_active (j: ALLEGRO_JOYSTICKptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_name (j: ALLEGRO_JOYSTICKptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_num_sticks (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_stick_flags (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_stick_name (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_num_axes (j: ALLEGRO_JOYSTICKptr; stick: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_axis_name (j: ALLEGRO_JOYSTICKptr; stick, axis: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_num_buttons (j: ALLEGRO_JOYSTICKptr): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_button_name (j: ALLEGRO_JOYSTICKptr; buttonn: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_get_joystick_state (j: ALLEGRO_JOYSTICKptr; OUT ret_state: ALLEGRO_JOYSTICK_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_joystick_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieves the global joystick event source. All joystick events are generated by this event source.

See also
al_register_event_source
Register the event source with the event queue specified.
FUNCTION al_is_keyboard_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if al_install_keyboard was called successfully.

FUNCTION al_install_keyboard: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Installs a keyboard driver.

Returns True if successful. If a driver was already installed, nothing happens and True is returned.

See also
al_uninstall_keyboard
Uninstalls the active keyboard driver, if any.
al_is_keyboard_installed
Returns True if al_install_keyboard was called successfully.
PROCEDURE al_uninstall_keyboard; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Uninstalls the active keyboard driver, if any. This will automatically unregister the keyboard event source with any event queues.

This function is automatically called when Allegro is shut down.

See also
al_install_keyboard
Installs a keyboard driver.
FUNCTION al_set_keyboard_leds (leds: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Overrides the state of the keyboard LED indicators. Set leds to a combination of the keyboard modifier flags to enable the corresponding LED indicators (ALLEGRO_KEYMOD_NUMLOCK, ALLEGRO_KEYMOD_CAPSLOCK and ALLEGRO_KEYMOD_SCROLLLOCK are supported) or to -1 to return to default behavior.

Returns

False if the current keyboard driver cannot set LED.

FUNCTION al_keycode_to_name (keycode: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Converts the given keycode to a description of the key.

PROCEDURE al_get_keyboard_state (OUT ret_state: ALLEGRO_KEYBOARD_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Save the state of the keyboard specified at the time the function is called into the structure pointed to by ret_state.

See also
al_key_down
Returns True if the key specified was held down in the state specified.
ALLEGRO_KEYBOARD_STATE
Holds a "snapshot" of keyboard.
FUNCTION al_key_down (VAR state: ALLEGRO_KEYBOARD_STATE; keycode: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if the key specified was held down in the state specified.

See also
ALLEGRO_KEYBOARD_STATE
Holds a "snapshot" of keyboard.
FUNCTION al_get_keyboard_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieve the keyboard event source. All keyboard events are generated by this event source.

Returns

Nil if the keyboard subsystem was not installed.

See also
al_register_event_source
Register the event source with the event queue specified.
FUNCTION al_is_mouse_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if al_install_mouse was called successfully.

FUNCTION al_install_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Installs mouse driver.

Returns True if successful. If a driver was already installed, nothing happens and True is returned.

PROCEDURE al_uninstall_mouse; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Uninstalls the active mouse driver, if any. This will automatically unregister the mouse event source with any event queues.

This function is automatically called when Allegro is shut down.

FUNCTION al_get_mouse_num_buttons: AL_UINT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the number of buttons on the mouse. The first button is 1.

See also
al_get_mouse_num_axes
Returns the number of axes on the mouse.
FUNCTION al_get_mouse_num_axes: AL_UINT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the number of axes on the mouse. The first axis is 0.

See also
al_get_mouse_num_buttons
Returns the number of buttons on the mouse.
FUNCTION al_set_mouse_xy (display: ALLEGRO_DISPLAYptr; x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Tryes to position the mouse at the given coordinates on the given display. The mouse movement resulting from a successful move will generate an ALLEGRO_EVENT_MOUSE_WARPED event.

Returns

True on success, False on failure.

See also
al_set_mouse_z
Sets the mouse wheel position to the given value.
al_set_mouse_w
Sets the second mouse wheel position to the given value.
FUNCTION al_set_mouse_z (z: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the mouse wheel position to the given value.

Returns

True on success, False on failure.

See also
al_set_mouse_xy
Tryes to position the mouse at the given coordinates on the given display.
al_set_mouse_w
Sets the second mouse wheel position to the given value.
FUNCTION al_set_mouse_w (w: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the second mouse wheel position to the given value.

Returns

True on success, False on failure.

See also
al_set_mouse_xy
Tryes to position the mouse at the given coordinates on the given display.
al_set_mouse_z
Sets the mouse wheel position to the given value.
FUNCTION al_set_mouse_axis (axis, value: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the given mouse axis to the given value.

The axis number must not be 0 or 1, which are the X and Y axes. Use al_set_mouse_xy for that. @returns(True on success, False on failure.9

See also
al_set_mouse_xy
Tryes to position the mouse at the given coordinates on the given display.
al_set_mouse_z,
l_set_mouse_w
PROCEDURE al_get_mouse_state (OUT ret_state: ALLEGRO_MOUSE_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Saves the state of the mouse specified at the time the function is called into the given structure.

Example:

VAR
  State: ALLEGRO_MOUSE_STATE;
BEGIN
  al_get_mouse_state (State);
  IF (State.buttons AND 1) <> 0 THEN
  { Primary (e.g. left) mouse button is held. }
    WriteLn (Format ('Mouse position: (%d, %d)', [State.x, State.y]));
  IF (State.buttons AND 2) <> 0 THEN
  { Secondary (e.g. right) mouse button is held. }
    ;
  IF (State.buttons AND 4) <> 0 THEN
  { Tertiary (e.g. middle) mouse button is held. }
    ;
END.

See also
ALLEGRO_MOUSE_STATE
Stores mouse state.
al_get_mouse_state_axis
Extracts the mouse axis value from the saved state.
al_mouse_button_down
Returns True if the mouse button specified was held down in the state specified.
FUNCTION al_mouse_button_down (VAR state: ALLEGRO_MOUSE_STATE; button: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if the mouse button specified was held down in the state specified. Unlike most things, the first mouse button is numbered 1.

See also
ALLEGRO_MOUSE_STATE
Stores mouse state.
al_get_mouse_state
Saves the state of the mouse specified at the time the function is called into the given structure.
al_get_mouse_state_axis
Extracts the mouse axis value from the saved state.
FUNCTION al_get_mouse_state_axis (VAR state: ALLEGRO_MOUSE_STATE; axis: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Extracts the mouse axis value from the saved state. The axes are numbered from 0, in this order: x-axis, y-axis, z-axis, w-axis.

See also
ALLEGRO_MOUSE_STATE
Stores mouse state.
al_get_mouse_state
Saves the state of the mouse specified at the time the function is called into the given structure.
al_mouse_button_down
Returns True if the mouse button specified was held down in the state specified.
FUNCTION al_get_mouse_cursor_position (OUT ret_x, ret_y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

On platforms where this information is available, this function returns the global location of the mouse cursor, relative to the desktop. You should not normally use this function, as the information is not useful except for special scenarios as moving a window.

Returns

True on success, False on failure.

FUNCTION al_grab_mouse (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Confines the mouse cursor to the given display. The mouse cursor can only be confined to one display at a time.

Returns true if successful, otherwise returns false. Do not assume that the cursor will remain confined until you call al_ungrab_mouse. It may lose the confined status at any time for other reasons.

Note: not yet implemented on Mac OS X.

See also
al_ungrab_mouse
Stop confining the mouse cursor to any display belonging to the program.
FUNCTION al_ungrab_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Stop confining the mouse cursor to any display belonging to the program.

Note: not yet implemented on Mac OS X.

See also
al_grab_mouse
Confines the mouse cursor to the given display.
PROCEDURE al_set_mouse_wheel_precision (precision: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the precision of the mouse wheel (the z and w coordinates). This precision manifests itself as a multiplier on the dz and dw fields in mouse events. It also affects the z and w fields of events and ALLEGRO_MOUSE_STATE, but not in a simple way if you alter the precision often, so it is suggested to reset those axes to 0 when you change precision. Setting this to a high value allows you to detect small changes in those two axes for some high precision mice. A flexible way of using this precision is to set it to a high value (120 is likely sufficient for most, if not all, mice) and use a floating point dz and dw like so:

VAR
  Event: ALLEGRO_EVENT;
  dz := DOUBLE;
BEGIN
  al_set_mouse_wheel_precision (120);
  al_wait_for_event (EventQueue, Event);
  IF Event._type = ALLEGRO_EVENT_MOUSE_AXES THEN
  BEGIN
    dz := Event.mouse.dz / al_get_mouse_wheel_precision ();
  { Use dz in some way... }
  END;
END.

Precision is set to 1 by default. It is impossible to set it to a lower precision than that. #)

See also
al_get_mouse_wheel_precision
Gets the precision of the mouse wheel (the z and w coordinates).
FUNCTION al_get_mouse_wheel_precision: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Gets the precision of the mouse wheel (the z and w coordinates).

See also
al_set_mouse_wheel_precision
Sets the precision of the mouse wheel (the z and w coordinates).
FUNCTION al_get_mouse_event_source: ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Retrieve the mouse event source. All mouse events are generated by this event source.

Returns

Nil if the mouse subsystem was not installed.

See also
al_register_event_source
Register the event source with the event queue specified.
PROCEDURE al_set_memory_interface (VAR iface: ALLEGRO_MEMORY_INTERFACE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Overrides the memory management functions with implementations of al_malloc_with_context, al_free_with_context, al_realloc_with_context and al_calloc_with_context. The context arguments may be used for debugging. The new functions should be thread safe.

See also
ALLEGRO_MEMORY_INTERFACE
Used to define the memory management functions.
al_restore_memory_interface
Restores the default behavior of the memory management functions.
PROCEDURE al_restore_memory_interface; INLINE;

Restores the default behavior of the memory management functions.

See also
al_set_memory_interface
Overrides the memory management functions with implementations of al_malloc_with_context, al_free_with_context, al_realloc_with_context and al_calloc_with_context.
FUNCTION al_malloc (CONST n: AL_SIZE_T): AL_POINTER; INLINE;

Like malloc in the C standard library, but the implementation may be overridden.

See also
al_free
Like free in the C standard library, but the implementation may be overridden.
al_realloc
Like realloc in the C standard library, but the implementation may be overridden.
al_calloc
Like calloc in the C standard library, but the implementation may be overridden.
al_malloc_with_context
This calls malloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.
al_set_memory_interface
Overrides the memory management functions with implementations of al_malloc_with_context, al_free_with_context, al_realloc_with_context and al_calloc_with_context.
PROCEDURE al_free (p: AL_POINTER); INLINE;

Like free in the C standard library, but the implementation may be overridden.

Additionally, on Windows, a memory block allocated by one DLL must be freed from the same DLL. In the few places where an Allegro function returns a pointer that must be freed, you must use al_free for portability to Windows.

See also
al_malloc
Like malloc in the C standard library, but the implementation may be overridden.
al_free_with_context
This calls free from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.
FUNCTION al_realloc (p: AL_POINTER; CONST n: AL_SIZE_T): AL_POINTER; INLINE;

Like realloc in the C standard library, but the implementation may be overridden.

See also
al_malloc
Like malloc in the C standard library, but the implementation may be overridden.
al_realloc_with_context
This calls realloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.
FUNCTION al_calloc (CONST c, n: AL_SIZE_T): AL_POINTER; INLINE;

Like calloc in the C standard library, but the implementation may be overridden.

See also
al_malloc
Like malloc in the C standard library, but the implementation may be overridden.
al_calloc_with_context
This calls calloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.
FUNCTION al_malloc_with_context (n: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This calls malloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.

Generally you should use the al_malloc function.

PROCEDURE al_free_with_context (ptr: AL_POINTER; line: AL_INT; CONST afile, func: AL_STR); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This calls free from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.

Generally you should use the al_free function.

FUNCTION al_realloc_with_context (ptr: AL_POINTER; n: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This calls realloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.

Generally you should use the al_realloc function.

FUNCTION al_calloc_with_context (n, count: AL_SIZE_T; line: AL_INT; CONST afile, func: AL_STR): AL_POINTER; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This calls calloc from the Allegro library (this matters on Windows), unless overridden with al_set_memory_interface.

Generally you should use the al_calloc function.

FUNCTION al_get_num_video_adapters: AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_monitor_info (adapter: AL_INT; OUT info: ALLEGRO_MONITOR_INFO): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_create_mouse_cursor (sprite: ALLEGRO_BITMAPptr; xfocus, yfocus: AL_INT): ALLEGRO_MOUSE_CURSORptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a mouse cursor from the bitmap provided.

Parameters
x_focus
Describes the bit of the cursor that will represent the actual mouse position.
y_focus
Describes the bit of the cursor that will represent the actual mouse position.
Returns

A pointer to the cursor on success, or Nil on failure.

See also
al_set_mouse_cursor
Sets the given mouse cursor to be the current mouse cursor for the given display.
al_destroy_mouse_cursor
Frees the memory used by the given cursor.
PROCEDURE al_destroy_mouse_cursor (cursor: ALLEGRO_MOUSE_CURSORptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Frees the memory used by the given cursor.

It has no effect if cursor is Nil.

See also
al_create_mouse_cursor
Creates a mouse cursor from the bitmap provided.
FUNCTION al_set_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor: ALLEGRO_MOUSE_CURSORptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the given mouse cursor to be the current mouse cursor for the given display.

If the cursor is currently 'shown' (as opposed to 'hidden') the change is immediately visible.

Returns

True on success, False on failure.

See also
al_set_system_mouse_cursor
Sets the given system mouse cursor to be the current mouse cursor for the given display.
al_show_mouse_cursor
Make a mouse cursor visible in the given display.
al_hide_mouse_cursor
Hide the mouse cursor in the given display.
FUNCTION al_set_system_mouse_cursor (display: ALLEGRO_DISPLAYptr; cursor_id: ALLEGRO_SYSTEM_MOUSE_CURSOR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets the given system mouse cursor to be the current mouse cursor for the given display. If the cursor is currently 'shown' (as opposed to 'hidden') the change is immediately visible.

If the cursor doesn't exist on the current platform another cursor will be silently be substituted.

Returns

True on success, False on failure.

See also
ALLEGRO_SYSTEM_MOUSE_CURSOR
Used to identify the mouse cursor.
al_set_mouse_cursor
Sets the given mouse cursor to be the current mouse cursor for the given display.
al_show_mouse_cursor
Make a mouse cursor visible in the given display.
al_hide_mouse_cursor
Hide the mouse cursor in the given display.
FUNCTION al_show_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Make a mouse cursor visible in the given display.

Returns

True if a mouse cursor is shown as a result of the call (or one already was visible), False otherwise.

See also
al_hide_mouse_cursor
Hide the mouse cursor in the given display.
FUNCTION al_hide_mouse_cursor (display: ALLEGRO_DISPLAYptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Hide the mouse cursor in the given display. This has no effect on what the current mouse cursor looks like; it just makes it disappear.

Returns

True on success (or if the cursor already was hidden), False otherwise.

See also
al_show_mouse_cursor
Make a mouse cursor visible in the given display.
PROCEDURE al_set_render_state (state: ALLEGRO_RENDER_STATE; value: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Set one of several render attributes.

This function does nothing if the target bitmap is a memory bitmap.

Parameters
state
Possible render states which can be one of ALLEGRO_RENDER_STATE.
PROCEDURE al_use_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Transformations

PROCEDURE al_use_projection_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_copy_transform (OUT dest: ALLEGRO_TRANSFORM; VAR src: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_identity_transform (OUT trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_build_transform (OUT trans: ALLEGRO_TRANSFORM; x, y, sx, sy, theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_build_camera_transform (OUT trans: ALLEGRO_TRANSFORM; position_x, position_y, position_z, look_x, look_y, look_z, up_x, up_y, up_z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_translate_transform (VAR trans: ALLEGRO_TRANSFORM; x, y: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_translate_transform_3d (VAR trans: ALLEGRO_TRANSFORM; x, y, z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_rotate_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_rotate_transform_3d (VAR trans: ALLEGRO_TRANSFORM; x, y, z, theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_scale_transform (VAR trans: ALLEGRO_TRANSFORM; sx, sy: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_scale_transform_3D (VAR trans: ALLEGRO_TRANSFORM; sx, sy, sz: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_transform_coordinates (VAR trans: ALLEGRO_TRANSFORM; OUT x, y: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_transform_coordinates_3d (VAR trans: ALLEGRO_TRANSFORM; OUT x, y, z: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_compose_transform (VAR trans, other: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_current_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_current_inverse_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_current_projection_transform: ALLEGRO_TRANSFORMptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_invert_transform (VAR trans: ALLEGRO_TRANSFORM); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_check_inverse (VAR trans: ALLEGRO_TRANSFORM; tol: AL_FLOAT): AL_INT; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_orthographic_transform (VAR trans: ALLEGRO_TRANSFORM; left, top, n, right, bottom, f: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_perspective_transform (VAR trans: ALLEGRO_TRANSFORM; left, top, n, right, bottom, f: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_horizontal_shear_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_vertical_shear_transform (VAR trans: ALLEGRO_TRANSFORM; theta: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_create_shader (platform: ALLEGRO_SHADER_PLATFORM): ALLEGRO_SHADERptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Creates a shader object.

The platform argument is one of the ALLEGRO_SHADER_PLATFORM values, and specifies the type of shader object to create, and which language is used to program the shader.

The shader platform must be compatible with the type of display that you will use the shader with. For example, you cannot create and use a HLSL shader on an OpenGL display, nor a GLSL shader on a Direct3D display.

The ALLEGRO_SHADER_AUTO value automatically chooses the appropriate platform for the display currently targeted by the calling thread; there must be such a display. It will create a GLSL shader for an OpenGL display, and a HLSL shader for a Direct3D display.

Returns

The shader object on success. Otherwise, returns Nil.

See also
al_attach_shader_source
Attaches the shader's source code to the shader object and compiles it.
al_attach_shader_source_file
Like al_attach_shader_source but reads the source code for the shader from the named file.
al_build_shader
This is required before the shader can be used with al_use_shader.
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
al_destroy_shader
Destroy a shader.
al_get_shader_platform
Returns the platform the shader was created with (either ALLEGRO_SHADER_HLSL or ALLEGRO_SHADER_GLSL).
FUNCTION al_attach_shader_source (shader: ALLEGRO_SHADERptr; aType: ALLEGRO_SHADER_TYPE; CONST Source: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Attaches the shader's source code to the shader object and compiles it. Passing Nil deletes the underlying (OpenGL or DirectX) shader. See also al_attach_shader_source_file if you prefer to obtain your shader source from an external file.

If you do not use ALLEGRO_PROGRAMMABLE_PIPELINE Allegro's graphics functions will not use any shader specific functions themselves. In case of a system with no fixed function pipeline (like OpenGL ES 2 or OpenGL 3 or 4) this means Allegro's drawing functions cannot be used.

TODO: Is ALLEGRO_PROGRAMMABLE_PIPELINE set automatically in this case?

When ALLEGRO_PROGRAMMABLE_PIPELINE is used the following shader uniforms are provided by Allegro and can be accessed in your shaders:

  • al_projview_matrix matrix for Allegro's orthographic projection multiplied by the al_use_transform matrix. The type is mat4 in GLSL, and float4x4 in HLSL.

  • al_use_tex whether or not to use the bound texture. The type is bool in both GLSL and HLSL.

  • al_tex the texture if one is bound. The type is sampler2D in GLSL and texture in HLSL.

  • al_use_tex_matrix whether or not to use a texture matrix (used by the primitives addon). The type is bool in both GLSL and HLSL.

  • al_tex_matrix the texture matrix (used by the primitives addon). Your shader should multiply the texture coordinates by this matrix. The type is mat4 in GLSL, and float4x4 in HLSL.

For GLSL shaders the vertex attributes are passed using the following variables:

  • al_pos vertex position attribute. Type is vec4.

  • al_texcoord vertex texture coordinate attribute. Type is vec2.

  • al_color vertex color attribute. Type is vec4.

For HLSL shaders the vertex attributes are passed using the following semantics:

  • POSITION0 vertex position attribute. Type is float4.

  • TEXCOORD0 vertex texture coordinate attribute. Type is float2.

  • TEXCOORD1 vertex color attribute. Type is float4.

Also, each shader variable has a corresponding macro name that can be used when defining the shaders using string literals. Don't use these macros with the other shader functions as that will lead to undefined behavior.

  • ALLEGRO_SHADER_VAR_PROJVIEW_MATRIX for "al_projview_matrix"

  • ALLEGRO_SHADER_VAR_POS for "al_pos"

  • ALLEGRO_SHADER_VAR_COLOR for "al_color"

  • ALLEGRO_SHADER_VAR_TEXCOORD for "al_texcoord"

  • ALLEGRO_SHADER_VAR_USE_TEX for "al_use_tex"

  • ALLEGRO_SHADER_VAR_TEX for "al_tex"

  • ALLEGRO_SHADER_VAR_USE_TEX_MATRIX for "al_use_tex_matrix"

  • ALLEGRO_SHADER_VAR_TEX_MATRIX for "al_tex_matrix"

Examine the output of al_get_default_shader_source for an example of how to use the above uniforms and attributes.

Returns

True on success and False on error, in which case the error log is updated. The error log can be retrieved with al_get_shader_log.

See also
al_attach_shader_source_file
Like al_attach_shader_source but reads the source code for the shader from the named file.
al_build_shader
This is required before the shader can be used with al_use_shader.
al_get_default_shader_source
Returns a string containing the source code to Allegro's default vertex or pixel shader appropriate for the passed platform.
al_get_shader_log
Return a read-only string containing the information log for a shader program.
FUNCTION al_attach_shader_source_file (shader: ALLEGRO_SHADERptr; aType: ALLEGRO_SHADER_TYPE; CONST filename: AL_STR): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Like al_attach_shader_source but reads the source code for the shader from the named file.

Returns

True on success and False on error, in which case the error log is updated. The error log can be retrieved with al_get_shader_log.

See also
al_attach_shader_source
Attaches the shader's source code to the shader object and compiles it.
al_build_shader
This is required before the shader can be used with al_use_shader.
al_get_shader_log
Return a read-only string containing the information log for a shader program.
FUNCTION al_build_shader (shader: ALLEGRO_SHADERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This is required before the shader can be used with al_use_shader. It should be called after successfully attaching the pixel and/or vertex shaders with al_attach_shader_source or al_attach_shader_source_file.

Note: If you are using the ALLEGRO_PROGRAMMABLE_PIPELINE flag, then you must specify both a pixel and a vertex shader sources for anything to be rendered.

Returns

True on success and False on error, in which case the error log is updated. The error log can be retrieved with al_get_shader_log.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
al_get_shader_log
Return a read-only string containing the information log for a shader program.
FUNCTION al_get_shader_log (shader: ALLEGRO_SHADERptr): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Return a read-only string containing the information log for a shader program. The log is updated by certain functions, such as al_attach_shader_source or al_build_shader when there is an error.

This function never returns Nil.

See also
al_attach_shader_source
Attaches the shader's source code to the shader object and compiles it.
al_attach_shader_source_file
Like al_attach_shader_source but reads the source code for the shader from the named file.
al_build_shader
This is required before the shader can be used with al_use_shader.
FUNCTION al_get_shader_platform (shader: ALLEGRO_SHADERptr): ALLEGRO_SHADER_PLATFORM; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns the platform the shader was created with (either ALLEGRO_SHADER_HLSL or ALLEGRO_SHADER_GLSL).

See also
al_create_shader
Creates a shader object.
FUNCTION al_use_shader (shader: ALLEGRO_SHADERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Uses the shader for subsequent drawing operations on the current target bitmap. Pass Nil to stop using any shader on the current target bitmap.

Returns

True on success. Otherwise returns False, e.g. because the shader is incompatible with the target bitmap.

See also
al_destroy_shader
Destroy a shader.
al_set_shader_sampler
Sets a texture sampler uniform and texture unit of the current target bitmap's shader.
al_set_shader_matrix
Sets a matrix uniform of the current target bitmap's shader.
al_set_shader_int
Sets an integer uniform of the current target bitmap's shader.
al_set_shader_float
Sets a float uniform of the current target bitmap's shader.
al_set_shader_bool
Sets a boolean uniform of the current target bitmap's shader.
al_set_shader_int_vector
Sets an integer vector array uniform of the current target bitmap's shader.
al_set_shader_float_vector
Same as al_set_shader_int_vector except all values are float instead of intteger.
PROCEDURE al_destroy_shader (shader: ALLEGRO_SHADERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Destroy a shader. Any bitmaps which currently use the shader will implicitly stop using the shader. In multi-threaded programs, be careful that no such bitmaps are being accessed by other threads at the time.

As a convenience, if the target bitmap of the calling thread is using the shader then the shader is implicitly unused before being destroyed.

This function does nothing if the shader argument is Nil.

See also
al_create_shader
Creates a shader object.
FUNCTION al_set_shader_sampler (CONST name: AL_STR; bitmap: ALLEGRO_BITMAPptr; aUnit: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a texture sampler uniform and texture unit of the current target bitmap's shader. The given bitmap must be a video bitmap.

Different samplers should use different units. The bitmap passed to Allegro's drawing functions uses the 0th unit, so if you're planning on using the al_tex variable in your pixel shader as well as another sampler, set the other sampler to use a unit different from 0. With the primitives addon, it is possible to free up the 0th unit by passing Nil as the texture argument to the relevant drawing functions. In this case, you may set a sampler to use the 0th unit and thus not use al_tex (the al_use_tex variable will be set to false).

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_matrix (CONST name: AL_STR; VAR matrix: ALLEGRO_TRANSFORM): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a matrix uniform of the current target bitmap's shader.

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_int (CONST name: AL_STR; i: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets an integer uniform of the current target bitmap's shader.

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_float (CONST name: AL_STR; f: AL_FLOAT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a float uniform of the current target bitmap's shader.

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_bool (CONST name: AL_STR; b: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets a boolean uniform of the current target bitmap's shader.

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_int_vector (CONST name: AL_STR; num_components: AL_INT; i: AL_INTptr; num_elems: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Sets an integer vector array uniform of the current target bitmap's shader. The num_components parameter can take one of the values 1, 2, 3 or 4. If it is 1 then an array of num_elems integer elements is added. Otherwise each added array element is assumed to be a vector with 2, 3 or 4 components in it.

For example, if you have a GLSL uniform declared as uniform ivec3 flowers[4] or an HLSL uniform declared as uniform int3 flowers[4], then you'd use this function from your code like so:

VAR
  Flowers: ARRAY [0..3] OF ARRAY [0..2] OF AL_INT =
  (
   (1, 2, 3),
   (4, 5, 6),
   (7, 8, 9),
   (2, 5, 7)
  );
BEGIN
  ...
  al_set_shader_int_vector ('flowers', 3, @Flowers, 4);
  ...
END

Returns

True on success. Otherwise returns False, e.g. if the uniform by that name does not exist in the shader.

See also
al_set_shader_float_vector
Same as al_set_shader_int_vector except all values are float instead of intteger.
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_set_shader_float_vector (CONST name: AL_STR; num_components: AL_INT; f: AL_FLOATptr; num_elems: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Same as al_set_shader_int_vector except all values are float instead of intteger.

See also
al_set_shader_int_vector
Sets an integer vector array uniform of the current target bitmap's shader.
al_use_shader
Uses the shader for subsequent drawing operations on the current target bitmap.
FUNCTION al_get_default_shader_source (platform: ALLEGRO_SHADER_PLATFORM; aType: ALLEGRO_SHADER_TYPE): AL_STRptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns a string containing the source code to Allegro's default vertex or pixel shader appropriate for the passed platform. The ALLEGRO_SHADER_AUTO value means GLSL is used if OpenGL is being used otherwise HLSL. ALLEGRO_SHADER_AUTO requires that there is a current display set on the calling thread. This function can return Nil if Allegro was built without support for shaders of the selected platform.

See also
al_attach_shader_source
Attaches the shader's source code to the shader object and compiles it.
FUNCTION al_init: AL_BOOL;

Like al_install_system, but automatically passes in the version and uses the atexit function visible in the current compilation unit.

Note: It is typically wrong to call al_init anywhere except the final game binary. In particular, do not call it inside a shared library unless you know what you're doing. In those cases, it is better to call al_install_system either with a Nil atexit_ptr, or with a pointer to atexit provided by the user of this shared library.

FUNCTION al_install_system (version: AL_INT; atexit_ptr: AL_POINTER): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Initializes the Allegro system. No other Allegro functions can be called before this (with one or two exceptions).

Parameters
version
Should always be set to ALLEGRO_VERSION_INT.
atexit_ptr
If non-Nil, and if hasn't been done already, al_uninstall_system will be registered as an atexit function.
Returns

True if Allegro was successfully initialized by this function call (or already was initialized previously), False if Allegro cannot be used.

See also
al_init
Like al_install_system, but automatically passes in the version and uses the atexit function visible in the current compilation unit.
PROCEDURE al_uninstall_system; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Closes down the Allegro system.

In most cases you don't need to call this, because it's called by the FINALIZATION section.

See also
al_init
Like al_install_system, but automatically passes in the version and uses the atexit function visible in the current compilation unit.
al_install_system
Initializes the Allegro system.
FUNCTION al_is_system_installed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Returns True if Allegro is initialized, otherwise returns False.

FUNCTION al_inhibit_screensaver (inhibit: AL_BOOL): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

This function allows the user to stop the system screensaver from starting up if True is passed, or resets the system back to the default state (the state at program start) if False is passed.

Returns

True if the state was set successfully, otherwise False.

FUNCTION ALLEGRO_USECS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;

Converts microseconds to seconds.

FUNCTION ALLEGRO_MSECS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;

Converts milliseconds to seconds.

FUNCTION ALLEGRO_BPS_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;

Converts beats per second to seconds.

FUNCTION ALLEGRO_BPM_TO_SECS (x: AL_INT): AL_DOUBLE; INLINE;

Converts beats per minute to seconds.

FUNCTION al_create_timer (speed_secs: AL_DOUBLE): ALLEGRO_TIMERptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Allocates and initializes a timer. The new timer is initially stopped.

Usage note: typical granularity is on the order of microseconds, but with some drivers might only be milliseconds.

Parameters
speed_secs
Seconds per "tick". Must be positive.
Returns

If successful, a pointer to a new timer object is returned, otherwise Nil is returned.

See also
al_start_timer
Starts the timer specified.
al_destroy_timer
PROCEDURE al_destroy_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_start_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Starts the timer specified. From then, the timer's counter will increment at a constant rate, and it will begin generating events. Starting a timer that is already started does nothing. Starting a timer that was stopped will reset the timer's counter, effectively restarting the timer from the beginning.

See also
al_stop_timer
al_get_timer_started
al_resume_timer
PROCEDURE al_stop_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_resume_timer (timer: ALLEGRO_TIMERptr); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_timer_started (CONST timer: ALLEGRO_TIMERptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_timer_speed (CONST timer: ALLEGRO_TIMERptr): AL_DOUBLE; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_timer_speed (timer: ALLEGRO_TIMERptr; speed_secs: AL_DOUBLE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_timer_count (CONST timer: ALLEGRO_TIMERptr): AL_INT64; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_set_timer_count (timer: ALLEGRO_TIMERptr; count: AL_INT64); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_add_timer_count (timer: ALLEGRO_TIMERptr; diff: AL_INT64); CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
FUNCTION al_get_timer_event_source (timer: ALLEGRO_TIMERptr): ALLEGRO_EVENT_SOURCEptr; CDECL; EXTERNAL ALLEGRO_LIB_NAME;
 
PROCEDURE al_store_state (OUT state: ALLEGRO_STATE; flags: AL_INT); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Stores part of the state of the current thread in the given ALLEGRO_STATE object. The flags parameter can take any bit-combination of these flags:

  • ALLEGRO_STATE_NEW_DISPLAY_PARAMETERS - new_display_format, new_display_refresh_rate, new_display_flags

  • ALLEGRO_STATE_NEW_BITMAP_PARAMETERS - new_bitmap_format, new_bitmap_flags

  • ALLEGRO_STATE_DISPLAY - current_display

  • ALLEGRO_STATE_TARGET_BITMAP - target_bitmap

  • ALLEGRO_STATE_BLENDER - blender

  • ALLEGRO_STATE_TRANSFORM - current_transformation

  • ALLEGRO_STATE_PROJECTION_TRANSFORM - current_projection_transformation

  • ALLEGRO_STATE_NEW_FILE_INTERFACE - new_file_interface

  • ALLEGRO_STATE_BITMAP - same as ALLEGRO_STATE_NEW_BITMAP_PARAMETERS and ALLEGRO_STATE_TARGET_BITMAP

  • ALLEGRO_STATE_ALL - all of the above

See also
al_restore_state
Restores part of the state of the current thread from the given ALLEGRO_STATE object.
PROCEDURE al_restore_state (VAR state: ALLEGRO_STATE); CDECL; EXTERNAL ALLEGRO_LIB_NAME;

Restores part of the state of the current thread from the given ALLEGRO_STATE object.

See also
al_store_state
Stores part of the state of the current thread in the given ALLEGRO_STATE object.

Types

ALLEGRO_USER_MAIN = FUNCTION (argc: AL_INT; argv: AL_POINTER): AL_INT; CDECL;

Description of user main function for al_run_main.

ALLEGRO_PIXEL_FORMAT = (...);

Pixel formats.

Each pixel format specifies the exact size and bit layout of a pixel in memory. Components are specified from high bits to low bits, so for example a fully opaque red pixel in ARGB_8888 format is 0xFFFF0000.

Note: The pixel format is independent of endianness. That is, in the above example you can always get the red component with

(pixel AND $00ff0000) SHR 16

But you can not rely on this code:

(PBYTE (pixel + 2))ˆ

It will return the red component on little endian systems, but the green component on big endian systems.

Also note that Allegro's naming is different from OpenGL naming here, where a format of GL_RGBA8 merely defines the component order and the exact layout including endianness treatment is specified separately. Usually GL_RGBA8 will correspond to ALLEGRO_PIXEL_ABGR_8888 though on little endian systems, so care must be taken (note the reversal of RGBA <-> ABGR).

The only exception to this ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE which always have the components as 4 bytes corresponding to red, green, blue and alpha, in this order, independent of the endianness.

See also
al_set_new_bitmap_format
Sets the pixel format for newly created bitmaps.
al_get_bitmap_format
Returns the pixel format of a bitmap.
Values
  • ALLEGRO_PIXEL_FORMAT_ANY = 0: Let the driver choose a format. This is the default format at program start.
  • ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA = 1: Let the driver choose a format without alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_WITH_ALPHA = 2: Let the driver choose a format with alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_15_NO_ALPHA = 3: Let the driver choose a 15 bit format without alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_16_NO_ALPHA = 4: Let the driver choose a 16 bit format without alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_16_WITH_ALPHA = 5: Let the driver choose a 16 bit format with alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_24_NO_ALPHA = 6: Let the driver choose a 24 bit format without alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_32_NO_ALPHA = 7: Let the driver choose a 32 bit format without alpha.
  • ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA = 8: Let the driver choose a 32 bit format with alpha.
  • ALLEGRO_PIXEL_FORMAT_ARGB_8888 = 9: 32 bit
  • ALLEGRO_PIXEL_FORMAT_RGBA_8888 = 10: 32 bit
  • ALLEGRO_PIXEL_FORMAT_ARGB_4444 = 11: 24 bit
  • ALLEGRO_PIXEL_FORMAT_RGB_888 = 12: 24 bit
  • ALLEGRO_PIXEL_FORMAT_RGB_565 = 13: 16 bit
  • ALLEGRO_PIXEL_FORMAT_RGB_555 = 14: 15 bit
  • ALLEGRO_PIXEL_FORMAT_RGBA_5551 = 15: 16 bit
  • ALLEGRO_PIXEL_FORMAT_ARGB_1555 = 16: 16 bit
  • ALLEGRO_PIXEL_FORMAT_ABGR_8888 = 17: 32 bit
  • ALLEGRO_PIXEL_FORMAT_XBGR_8888 = 18: 32 bit
  • ALLEGRO_PIXEL_FORMAT_BGR_888 = 19: 24 bit
  • ALLEGRO_PIXEL_FORMAT_BGR_565 = 20: 16 bit
  • ALLEGRO_PIXEL_FORMAT_BGR_555 = 21: 15 bit
  • ALLEGRO_PIXEL_FORMAT_RGBX_8888 = 22: 32 bit
  • ALLEGRO_PIXEL_FORMAT_XRGB_8888 = 23: 32 bit
  • ALLEGRO_PIXEL_FORMAT_ABGR_F32 = 24: 128 bit
  • ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE = 25: Like the version without _LE, but the component order is guaranteed to be red, green, blue, alpha. This only makes a difference on big endian systems, on little endian it is just an alias.
  • ALLEGRO_PIXEL_FORMAT_RGBA_4444 = 26: 16bit
  • ALLEGRO_PIXEL_FORMAT_SINGLE_CHANNEL_8 = 27
  • ALLEGRO_PIXEL_FORMAT_COMPRESSED_RGBA_DXT1 = 28
  • ALLEGRO_PIXEL_FORMAT_COMPRESSED_RGBA_DXT3 = 29
  • ALLEGRO_PIXEL_FORMAT_COMPRESSED_RGBA_DXT5 = 30
  • ALLEGRO_NUM_PIXEL_FORMATS
ALLEGRO_BITMAPptr = AL_POINTER;

Abstract type representing a bitmap (2D image).

ALLEGRO_USTRptr = ˆALLEGRO_USTR;

Pointer to ALLEGRO_USTR.

ALLEGRO_USTR = _al_tagbstring;

An opaque type representing a string. ALLEGRO_USTRs normally contain UTF-8 encoded strings, but they may be used to hold any byte sequences, including Nil.

ALLEGRO_USTR_INFOptr = ˆALLEGRO_USTR_INFO;

Pointer to ALLEGRO_USTR_INFO.

ALLEGRO_USTR_INFO = _al_tagbstring;

A type that holds additional information for an ALLEGRO_USTR that references an external memory buffer.

See also
al_ref_cstr
Create a string that references the storage of a C-style string.
al_ref_buffer
al_ref_ustr
ALLEGRO_FILEptr = AL_POINTER;

An opaque object representing an open file. This could be a real file on disk or a virtual file.

ALLEGRO_FILE_INTERFACEptr = ˆALLEGRO_FILE_INTERFACE;

Pointer to ALLEGRO_FILE_INTERFACE.

ALLEGRO_IIO_LOADER_FUNCTION = FUNCTION (CONST filename: AL_STR; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL;

Used by al_register_bitmap_loader.

ALLEGRO_IIO_FS_LOADER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr; flags: AL_INT): ALLEGRO_BITMAPptr; CDECL;

Used by al_register_bitmap_loader_f.

ALLEGRO_IIO_SAVER_FUNCTION = FUNCTION (CONST filename: AL_STR; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL;

Used by al_register_bitmap_saver.

ALLEGRO_IIO_FS_SAVER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr; bitmap: ALLEGRO_BITMAPptr): AL_BOOL; CDECL;

Used by al_register_bitmap_saver_f.

ALLEGRO_IIO_IDENTIFIER_FUNCTION = FUNCTION (fp: ALLEGRO_FILEptr): AL_BOOL; CDECL;

Used by al_register_bitmap_identifier.

ALLEGRO_LOCKED_REGIONptr = ˆALLEGRO_LOCKED_REGION;

Pointer to ALLEGRO_LOCKED_REGION.

ALLEGRO_BLEND_MODE = (...);

Blending modes.

See also
al_set_blender
Sets the function to use for blending for the current thread.
Values
  • ALLEGRO_ZERO = 0
  • ALLEGRO_ONE = 1
  • ALLEGRO_ALPHA = 2
  • ALLEGRO_INVERSE_ALPHA = 3
  • ALLEGRO_SRC_COLOR = 4
  • ALLEGRO_DEST_COLOR = 5
  • ALLEGRO_INVERSE_SRC_COLOR = 6
  • ALLEGRO_INVERSE_DEST_COLOR = 7
  • ALLEGRO_CONST_COLOR = 8
  • ALLEGRO_INVERSE_CONST_COLOR = 9
  • ALLEGRO_NUM_BLEND_MODES
ALLEGRO_BLEND_OPERATIONS = (...);

Blending modes.

See also
al_set_blender
Sets the function to use for blending for the current thread.
Values
  • ALLEGRO_ADD = 0
  • ALLEGRO_SRC_MINUS_DEST = 1
  • ALLEGRO_DEST_MINUS_SRC = 2
  • ALLEGRO_NUM_BLEND_OPERATIONS
ALLEGRO_EVENT_TYPE = AL_UINT;

An integer used to distinguish between different types of events.

See also
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.
ALLEGRO_GET_EVENT_TYPE
Makes an event type identifier, which is a 32-bit integer.
ALLEGRO_EVENT_TYPE_IS_USER
Returns True if the event type is not a builtin event type, i.e.
ALLEGRO_DISPLAYptr = AL_POINTER;

Pointer to a display.

An opaque type representing an open display or window.

ALLEGRO_JOYSTICKptr = AL_POINTER;

Pointer to joystick.

ALLEGRO_KEYBOARDptr = AL_POINTER;

Pointer to keyboard.

ALLEGRO_MOUSEptr = AL_POINTER;

Pointer to mouse.

ALLEGRO_TIMERptr = AL_POINTER;

Pointer to timer.

ALLEGRO_EVENT_SOURCEptr = ˆALLEGRO_EVENT_SOURCE;

Pointer to ALLEGRO_EVENT_SOURCE.

ALLEGRO_USER_EVENT_DESCRIPTORptr = POINTER;
 
ALLEGRO_USER_EVENTptr = ˆALLEGRO_USER_EVENT;
 
ALLEGRO_EVENTptr = ˆALLEGRO_EVENT;

Pointer to ALLEGRO_EVENT

ALLEGRO_EVENT_DTOR_PROC = PROCEDURE (evt: ALLEGRO_USER_EVENTptr); CDECL;

User event destructor.

See also
al_emit_user_event
The second argument is ALLEGRO_EVENT instead of ALLEGRO_USER_EVENT * to prevent users passing a pointer to a too-short structure.
ALLEGRO_EVENT_QUEUEptr = AL_POINTER;
 
ALLEGRO_DISPLAY_OPTIONS = (...);

Possible parameters for al_set_display_option.

Make sure to update ALLEGRO_EXTRA_DISPLAY_SETTINGS if you modify anything here.

Values
  • ALLEGRO_RED_SIZE = 0
  • ALLEGRO_GREEN_SIZE = 1
  • ALLEGRO_BLUE_SIZE = 2
  • ALLEGRO_ALPHA_SIZE = 3
  • ALLEGRO_RED_SHIFT = 4
  • ALLEGRO_GREEN_SHIFT = 5
  • ALLEGRO_BLUE_SHIFT = 6
  • ALLEGRO_ALPHA_SHIFT = 7
  • ALLEGRO_ACC_RED_SIZE = 8
  • ALLEGRO_ACC_GREEN_SIZE = 9
  • ALLEGRO_ACC_BLUE_SIZE = 10
  • ALLEGRO_ACC_ALPHA_SIZE = 11
  • ALLEGRO_STEREO = 12
  • ALLEGRO_AUX_BUFFERS = 13
  • ALLEGRO_COLOR_SIZE = 14
  • ALLEGRO_DEPTH_SIZE = 15
  • ALLEGRO_STENCIL_SIZE = 16
  • ALLEGRO_SAMPLE_BUFFERS = 17
  • ALLEGRO_SAMPLES = 18
  • ALLEGRO_RENDER_METHOD = 19
  • ALLEGRO_FLOAT_COLOR = 20
  • ALLEGRO_FLOAT_DEPTH = 21
  • ALLEGRO_SINGLE_BUFFER = 22
  • ALLEGRO_SWAP_METHOD = 23
  • ALLEGRO_COMPATIBLE_DISPLAY = 24
  • ALLEGRO_UPDATE_DISPLAY_REGION = 25
  • ALLEGRO_VSYNC = 26
  • ALLEGRO_MAX_BITMAP_SIZE = 27
  • ALLEGRO_SUPPORT_NPOT_BITMAP = 28
  • ALLEGRO_CAN_DRAW_INTO_BITMAP = 29
  • ALLEGRO_SUPPORT_SEPARATE_ALPHA = 30
  • ALLEGRO_AUTO_CONVERT_BITMAPS = 31
  • ALLEGRO_SUPPORTED_ORIENTATIONS = 32
  • ALLEGRO_OPENGL_MAJOR_VERSION = 33
  • ALLEGRO_OPENGL_MINOR_VERSION = 34
  • ALLEGRO_DISPLAY_OPTIONS_COUNT
ALLEGRO_CONFIGptr = AL_POINTER;

An abstract configuration structure.

ALLEGRO_CONFIG_SECTIONptr = AL_POINTER;

An opaque structure used for iterating across sections in a configuration structure.

ALLEGRO_CONFIG_ENTRYptr = AL_POINTER;

An opaque structure used for iterating across entries in a configuration section.

ALLEGRO_DISPLAY_MODEptr = ˆALLEGRO_DISPLAY_MODE;

* fullscreen_mode.h ****************************************************************************

ALLEGRO_JOYFLAGS = (...);

0 to 32767

Values
  • ALLEGRO_JOYFLAG_DIGITAL = $01
  • ALLEGRO_JOYFLAG_ANALOGUE = $02
ALLEGRO_MONITOR_INFOptr = ˆALLEGRO_MONITOR_INFO;
 
ALLEGRO_MOUSE_CURSORptr = AL_POINTER;

Pointer to a custom mouse cursor

ALLEGRO_SYSTEM_MOUSE_CURSOR = (...);

Used to identify the mouse cursor.

See also
al_set_system_mouse_cursor
Sets the given system mouse cursor to be the current mouse cursor for the given display.
Values
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_NONE = 0
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_DEFAULT = 1
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_ARROW = 2
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_BUSY = 3
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_QUESTION = 4
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_EDIT = 5
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_MOVE = 6
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_N = 7
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_W = 8
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_S = 9
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_E = 10
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NW = 11
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_SW = 12
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_SE = 13
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_RESIZE_NE = 14
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_PROGRESS = 15
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_PRECISION = 16
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_LINK = 17
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_ALT_SELECT = 18
  • ALLEGRO_SYSTEM_MOUSE_CURSOR_UNAVAILABLE = 19
  • ALLEGRO_NUM_SYSTEM_MOUSE_CURSORS
ALLEGRO_RENDER_STATE = (...);

Used by al_set_render_state.

Values
  • ALLEGRO_ALPHA_TEST = $0010: If this is set to 1, the values of ALLEGRO_ALPHA_FUNCTION and ALLEGRO_ALPHA_TEST_VALUE define a comparison function which is performed for each pixel. Only if it evaluates to true the pixel is written. Otherwise no subsequent processing (like depth test or blending) is performed.
  • ALLEGRO_WRITE_MASK: This determines how the framebuffer and depthbuffer are updated whenever a pixel is written (in case alpha and/or depth testing is enabled: after all such enabled tests succeed). Depth values are only written if ALLEGRO_DEPTH_TEST is 1, in addition to the write mask flag being set.
  • ALLEGRO_DEPTH_TEST: If this is set to 1, compare the depth value of any newly written pixels with the depth value already in the buffer, according to ALLEGRO_DEPTH_FUNCTION. Allegro primitives with no explicit z coordinate will write a value of 0 into the depth buffer.
  • ALLEGRO_DEPTH_FUNCTION: One of ALLEGRO_RENDER_NEVER ALLEGRO_RENDER_ALWAYS ALLEGRO_RENDER_LESS ALLEGRO_RENDER_EQUAL ALLEGRO_RENDER_LESS_EQUAL ALLEGRO_RENDER_GREATER ALLEGRO_RENDER_NOT_EQUAL ALLEGRO_RENDER_GREATER_EQUAL, only used when ALLEGRO_DEPTH_TEST is 1.
  • ALLEGRO_ALPHA_FUNCTION: One of ALLEGRO_RENDER_NEVER ALLEGRO_RENDER_ALWAYS ALLEGRO_RENDER_LESS ALLEGRO_RENDER_EQUAL ALLEGRO_RENDER_LESS_EQUAL ALLEGRO_RENDER_GREATER ALLEGRO_RENDER_NOT_EQUAL ALLEGRO_RENDER_GREATER_EQUAL, only used when ALLEGRO_ALPHA_TEST is 1.
  • ALLEGRO_ALPHA_TEST_VALUE: Only used when ALLEGRO_ALPHA_TEST is 1.
ALLEGRO_TRANSFORMptr = ˆALLEGRO_TRANSFORM;

* transformations.h ****************************************************************************

ALLEGRO_SHADERptr = AL_POINTER;

An ALLEGRO_SHADER is a program that runs on the GPU. It combines both a vertex and a pixel shader. (In OpenGL terms, an ALLEGRO_SHADER is actually a program which has one or more shaders attached. This can be confusing.)

The source code for the underlying vertex or pixel shader can be provided either as GLSL or HLSL, depending on the value of ALLEGRO_SHADER_PLATFORM used when creating it.

ALLEGRO_SHADER_TYPE = (...);

Used with al_attach_shader_source and al_attach_shader_source_file to specify how to interpret the attached source.

Values
  • ALLEGRO_VERTEX_SHADER = 1: A vertex shader is executed for each vertex it is used with. The program will output exactly one vertex at a time.

    When Allegro's graphics are being used then in addition to all vertices of primitives from the primitives addon, each drawn bitmap also consists of four vertices.

  • ALLEGRO_PIXEL_SHADER = 2: A pixel shader is executed for each pixel it is used with. The program will output exactly one pixel at a time - either in the backbuffer or in the current target bitmap.

    With Allegro's builtin graphics this means the shader is for example called for each destination pixel of the output of an al_draw_bitmap call.

    A more accurate term for pixel shader would be fragment shader since one final pixel in the target bitmap is not necessarily composed of only a single output but of multiple fragments (for example when multi-sampling is being used).

ALLEGRO_SHADER_PLATFORM = (...);

The underlying platform which the ALLEGRO_SHADER is built on top of, which dictates the language used to program the shader.

Values
  • ALLEGRO_SHADER_AUTO = 0
  • ALLEGRO_SHADER_GLSL = 1: OpenGL Shading Language.
  • ALLEGRO_SHADER_HLSL = 2: High Level Shader Language (for Direct3D).
ALLEGRO_SYSTEMptr = AL_POINTER;

Pointer to the Allegro system description record. For internal use only.

Constants

ALLEGRO_VERSION = 5;

Major version of Allegro.

ALLEGRO_SUB_VERSION = 2;

Minor version of Allegro.

ALLEGRO_WIP_VERSION = 0;

Revision number of Allegro.

ALLEGRO_RELEASE_NUMBER = 1;

Not sure we need it, but ALLEGRO_VERSION_STR contains it: 0 = SVN 1 = first release 2... = hotfixes?

Note x.y.z (= x.y.z.0) has release number 1, and x.y.z.1 has release number 2, just to confuse you.

ALLEGRO_VERSION_INT = ( (ALLEGRO_VERSION SHL 24) OR (ALLEGRO_SUB_VERSION SHL 16) OR (ALLEGRO_WIP_VERSION SHL 8) OR ALLEGRO_RELEASE_NUMBER );

Packs version number in a simple AL_INT number.

ALLEGRO_PI = 3.14159265358979323846;

Just to be sure that PI number is available.

ALLEGRO_SEEK_SET = 0;

Seek relative to beginning of file.

ALLEGRO_SEEK_CUR = 1;

Seek relative to current file position.

ALLEGRO_SEEK_END = 2;

Seek relative to end of file.

ALLEGRO_DISPLAY_ORIENTATION_UNKNOWN = 0;
 
ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES = 1;
 
ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES = 2;
 
ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES = 4;
 
ALLEGRO_DISPLAY_ORIENTATION_PORTRAIT = 5;
 
ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES = 8;
 
ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE = 10;
 
ALLEGRO_DISPLAY_ORIENTATION_ALL = 15;
 
ALLEGRO_DISPLAY_ORIENTATION_FACE_UP = 16;
 
ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN = 32;
 
ALLEGRO_DONTCARE = 0;
 
ALLEGRO_REQUIRE = 1;
 
ALLEGRO_SUGGEST = 2;
 
_ALLEGRO_PRIM_MAX_USER_ATTR = 10;

Formelly part of the primitives addon.

ALLEGRO_NEW_WINDOW_TITLE_MAX_SIZE = 255;

pointer ALLEGRO_DISPLAYptr declared at section "events.h".

_AL_MAX_JOYSTICK_AXES = 3;

internal values

_AL_MAX_JOYSTICK_STICKS = 16;
 
_AL_MAX_JOYSTICK_BUTTONS = 32;
 
ALLEGRO_MOUSE_MAX_EXTRA_AXES = 4;

Allow up to four extra axes for future expansion.

ALLEGRO_DEFAULT_DISPLAY_ADAPTER = -1;

* monitor.h ****************************************************************************


Generated by PasDoc 0.14.0. Generated on 2017-01-03 17:39:12.