Unit Allegro

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Allegro core.

This is the main module of the Allegro library. There are very different stuff on this unit, but procedures, functions, types, variables and constants are grouped to make it easer to find them. Read the How to use Allegro.pas section for a brief description of this unit.

Overview

Classes, Interfaces, Objects and Records

Name Description
record AL_JOYSTICK_AXIS_INFO This provides both analogue input in the pos field (ranging from -128 to 128 or from 0 to 255, depending on the type of the control), and digital values in the d1 and d2 fields.
record AL_JOYSTICK_STICK_INFO information about one or more axis (a slider or directional control)
record AL_JOYSTICK_BUTTON_INFO information about a joystick button.
record AL_JOYSTICK_INFO information about an entire joystick.
record AL_RGB Palette entry.
record AL_RGB_MAP Stores an rgb map to accelerate conversions.
record AL_BITMAP Stores the contents of a bitmap.
record AL_GFX_MODE Graphics mode description.
record AL_GFX_MODE_LIST Graphics mode list.
record AL_RLE_SPRITE An RLE compressed sprite.
record AL_MIDI A structure holding MIDI data.
record AL_SAMPLE A sample structure, which holds sound data, used by the digital sample routines.

Functions and Procedures

FUNCTION AL_ID (str: SHORTSTRING): AL_INT32; INLINE;
FUNCTION al_install (system_id: AL_INT): AL_BOOL; INLINE;
FUNCTION al_init: AL_BOOL; INLINE;
PROCEDURE al_exit; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_exit';
PROCEDURE al_message (CONST msg: AL_STR); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_message';
FUNCTION al_set_close_button_callback (proc: AL_SIMPLE_PROC): AL_BOOL; INLINE;
PROCEDURE al_check_cpu; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'check_cpu';
PROCEDURE al_set_window_title (CONST title: AL_STR); INLINE;
FUNCTION al_desktop_color_depth: AL_INT; INLINE;
FUNCTION al_get_desktop_resolution (OUT w, h: AL_INT): AL_BOOL; INLINE;
PROCEDURE al_set_config_file (CONST filename: AL_STR); INLINE;
PROCEDURE al_set_config_data (CONST data: AL_POINTER; lng: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_data';
PROCEDURE al_override_config_file (CONST filename: AL_STR); INLINE;
PROCEDURE al_override_config_data (CONST data: AL_POINTER; lng: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'override_config_data';
PROCEDURE al_flush_config_file; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'flush_config_file';
PROCEDURE al_push_config_state; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'push_config_state';
PROCEDURE al_pop_config_state; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pop_config_state';
FUNCTION al_get_config_string (CONST section, name, def: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_string';
FUNCTION al_get_config_int (CONST section, name: AL_STR; def: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_int';
FUNCTION al_get_config_hex (CONST section, name: AL_STR; def: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_hex';
FUNCTION al_get_config_float (CONST section, name: AL_STR; def: AL_FLOAT): AL_FLOAT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_float';
FUNCTION al_get_config_id (CONST section, name: AL_STR; def: AL_INT32): AL_INT32; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_id';
PROCEDURE al_set_config_string (CONST section, name, val: AL_STR); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_string';
PROCEDURE al_set_config_int (CONST section, name: AL_STR; val: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_int';
PROCEDURE al_set_config_hex (CONST section, name: AL_STR; val: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_hex';
PROCEDURE al_set_config_float (CONST section, name: AL_STR; val: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_float';
PROCEDURE al_set_config_id (CONST section, name: AL_STR; val: AL_INT32); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_id';
FUNCTION al_install_timer: AL_BOOL; INLINE;
PROCEDURE al_remove_timer; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_timer';
FUNCTION al_install_int_ex (proc: AL_SIMPLE_PROC; speed: AL_LONG): AL_BOOL; INLINE;
FUNCTION al_install_int (proc: AL_SIMPLE_PROC; speed: AL_LONG): AL_BOOL; INLINE;
PROCEDURE al_remove_int (proc: AL_SIMPLE_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_int';
FUNCTION al_install_param_int_ex (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): AL_BOOL; INLINE;
FUNCTION al_install_param_int (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): AL_BOOL; INLINE;
PROCEDURE al_remove_param_int (proc: AL_PARAM_PROC; param: AL_VOIDptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_param_int';
FUNCTION AL_SECS_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;
FUNCTION AL_MSEC_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;
FUNCTION AL_BPS_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;
FUNCTION AL_BPM_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;
PROCEDURE al_rest (mseconds: AL_UINT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest';
PROCEDURE al_rest_callback (mseconds: AL_UINT; callback: AL_PARAM_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest_callback';
FUNCTION al_install_keyboard: AL_BOOL; INLINE;
PROCEDURE al_remove_keyboard; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_keyboard';
FUNCTION al_poll_keyboard: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_keyboard';
FUNCTION al_keyboard_needs_poll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keyboard_needs_poll';
FUNCTION al_keypressed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keypressed';
FUNCTION al_readkey: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'readkey';
FUNCTION al_ureadkey (OUT scancode: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'ureadkey';
PROCEDURE al_simulate_keypress (keycode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'simulate_keypress';
PROCEDURE al_simulate_ukeypress (keycode, scancode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'simulate_ukeypress';
PROCEDURE al_clear_keybuf; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'clear_keybuf';
PROCEDURE al_set_leds (leds: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_leds';
PROCEDURE al_set_keyboard_rate (key_delay, key_repeat: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_keyboard_rate';
FUNCTION al_scancode_to_ascii (scancode: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scancode_to_ascii';
FUNCTION al_scancode_to_name (scancode: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scancode_to_name';
FUNCTION al_install_joystick (CONST atype: AL_INT): AL_BOOL; INLINE;
PROCEDURE al_remove_joystick; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_joystick';
FUNCTION al_calibrate_joystick_name (CONST n: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'calibrate_joystick_name';
FUNCTION al_calibrate_joystick (n: AL_INT): AL_BOOL; INLINE;
FUNCTION al_save_joystick_data (CONST filename: AL_STR): AL_BOOL; INLINE;
FUNCTION al_load_joystick_data (CONST filename: AL_STR): AL_BOOL;
FUNCTION al_poll_joystick: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_joystick';
PROCEDURE al_set_color (idx: AL_INT; VAR p: AL_RGB); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color';
PROCEDURE al_set_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette';
PROCEDURE al_set_palette_range (VAR p: AL_PALETTE; aFrom, aTo: AL_INT; vsync: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette_range';
PROCEDURE al_get_color (idx: AL_INT; OUT p: AL_RGB); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color';
PROCEDURE al_get_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_palette';
PROCEDURE al_get_palette_range (VAR p: AL_PALETTE; aFrom, aTo: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_palette_range';
PROCEDURE al_fade_interpolate (VAR source, dest, aOutput: AL_PALETTE; aPos, aFrom, aTo: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_interpolate';
PROCEDURE al_fade_from_range (VAR source, dest: AL_PALETTE; speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from_range';
PROCEDURE al_fade_in_range (VAR p: AL_PALETTE; speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_in_range';
PROCEDURE al_fade_out_range (speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_out_range';
PROCEDURE al_fade_from (VAR source, dest: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from';
PROCEDURE al_fade_in (VAR p: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_in';
PROCEDURE al_fade_out (speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_out';
PROCEDURE al_select_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'select_palette';
PROCEDURE al_unselect_palette; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'unselect_palette';
PROCEDURE al_generate_332_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'generate_332_palette';
FUNCTION al_generate_optimized_palette (image: AL_BITMAPptr; VAR pal: AL_PALETTE; VAR rsvdcols: ARRAY OF AL_CHAR): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'generate_optimized_palette';
PROCEDURE al_create_rgb_table (VAR table: AL_RGB_MAP; VAR pal: AL_PALETTE; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_rgb_table';
PROCEDURE al_hsv_to_rgb (h, s, v: AL_FLOAT; OUT r, g, b: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'hsv_to_rgb';
PROCEDURE al_rgb_to_hsv (r, g, b: AL_INT; OUT h, s, v: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rgb_to_hsv';
FUNCTION al_bestfit_color (VAR pal: AL_PALETTE; r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'bestfit_color';
FUNCTION al_makecol (r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol';
FUNCTION al_makecol8 (r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol8';
FUNCTION al_makecol_depth (color_depth, r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol_depth';
FUNCTION al_makeacol (r, g, b, a: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makeacol';
FUNCTION al_makeacol_depth (color_depth, r, g, b, a: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makeacol_depth';
FUNCTION al_getr (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getr';
FUNCTION al_getg (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getg';
FUNCTION al_getb (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getb';
FUNCTION al_geta (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'geta';
FUNCTION al_getr_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getr_depth';
FUNCTION al_getg_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getg_depth';
FUNCTION al_getb_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getb_depth';
FUNCTION al_geta_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'geta_depth';
FUNCTION al_get_gfx_mode_list (card: AL_INT): AL_GFX_MODE_LISTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode_list';
PROCEDURE al_destroy_gfx_mode_list (gfx_mode_list: AL_GFX_MODE_LISTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_gfx_mode_list';
PROCEDURE al_set_color_depth (depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color_depth';
FUNCTION al_get_color_depth: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color_depth';
PROCEDURE al_set_color_conversion (mode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color_conversion';
FUNCTION al_get_color_conversion: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color_conversion';
PROCEDURE al_request_refresh_rate (rate: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'request_refresh_rate';
FUNCTION al_get_refresh_rate: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_refresh_rate';
FUNCTION al_set_gfx_mode (card, w, h, v_w, v_h: AL_INT): AL_BOOL;
FUNCTION al_scroll_screen (x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scroll_screen';
FUNCTION al_request_scroll (x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'requests_scroll';
FUNCTION al_poll_scroll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_scroll';
FUNCTION al_show_video_bitmap (bmp: AL_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'show_video_bitmap';
FUNCTION al_request_video_bitmap (bitmap: AL_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'request_video_bitmap';
FUNCTION al_enable_triple_buffer: AL_BOOL; INLINE;
FUNCTION al_create_bitmap (w, h: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_bitmap';
FUNCTION al_create_bitmap_ex (bpp, width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_bitmap_ex';
FUNCTION al_create_sub_bitmap (parent: AL_BITMAPptr; x, y, w, h: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_sub_bitmap';
FUNCTION al_create_video_bitmap (width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_video_bitmap';
FUNCTION al_create_system_bitmap (width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_system_bitmap';
PROCEDURE al_destroy_bitmap (bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_bitmap';
PROCEDURE al_set_clip_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_clip_rect';
PROCEDURE al_add_clip_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'add_clip_rect';
PROCEDURE al_clear_bitmap (bitmap: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'clear_bitmap';
PROCEDURE al_vsync; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'vsync';
FUNCTION al_get_gfx_mode_type (graphics_card: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode_type';
FUNCTION al_get_gfx_mode: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode';
FUNCTION al_set_display_switch_mode (mode: AL_INT): AL_BOOL; INLINE;
FUNCTION al_get_display_switch_mode: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_display_switch_mode';
FUNCTION al_set_display_switch_callback (dir: AL_INT; cb: AL_SIMPLE_PROC): AL_BOOL; INLINE;
PROCEDURE al_remove_display_switch_callback (cb: AL_SIMPLE_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_display_switch_callback';
FUNCTION al_is_windowed_mode: AL_BOOL; INLINE;
PROCEDURE al_clear_to_color (bitmap: AL_BITMAPptr; CONST color: AL_INT); INLINE;
FUNCTION al_bitmap_color_depth (CONST bmp: AL_BITMAPptr): AL_INT; INLINE;
FUNCTION al_bitmap_mask_color (CONST bmp: AL_BITMAPptr): AL_INT; INLINE;
FUNCTION al_is_same_bitmap (CONST bmp1, bmp2: AL_BITMAPptr): AL_BOOL;
FUNCTION al_is_memory_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;
FUNCTION al_is_screen_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;
FUNCTION al_is_video_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;
FUNCTION al_is_system_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;
FUNCTION al_is_sub_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;
PROCEDURE al_acquire_bitmap (bmp: AL_BITMAPptr); INLINE;
PROCEDURE al_release_bitmap (bmp: AL_BITMAPptr); INLINE;
PROCEDURE al_acquire_screen; INLINE;
PROCEDURE al_release_screen; INLINE;
PROCEDURE al_get_clip_rect (bmp: AL_BITMAPptr; VAR x1, y1, x2, y2: AL_INT); INLINE;
PROCEDURE al_set_clip_state (bmp: AL_BITMAPptr; state: AL_BOOL); INLINE;
FUNCTION al_get_clip_state (bmp: AL_BITMAPptr): AL_BOOL; INLINE;
FUNCTION al_load_bitmap (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bitmap';
FUNCTION al_load_bmp (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bmp';
FUNCTION al_load_lbm (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_lbm';
FUNCTION al_load_pcx (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_pcx';
FUNCTION al_load_tga (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_tga';
FUNCTION al_save_bitmap (filename: STRING; bmp: AL_BITMAPptr; pal: AL_PALETTEptr): AL_BOOL; INLINE;
FUNCTION al_save_bmp (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;
FUNCTION al_save_pcx (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;
FUNCTION al_save_tga (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;
FUNCTION al_install_mouse: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'install_mouse';
PROCEDURE al_remove_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_mouse';
FUNCTION al_poll_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_mouse';
FUNCTION al_mouse_needs_poll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_needs_poll';
PROCEDURE al_enable_hardware_cursor; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'enable_hardware_cursor';
PROCEDURE al_disable_hardware_cursor; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'disable_hardware_cursor';
PROCEDURE al_show_mouse (bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'show_mouse';
PROCEDURE al_scare_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scare_mouse';
PROCEDURE al_scare_mouse_area (x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scare_mouse_area';
PROCEDURE al_unscare_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'unscare_mouse';
PROCEDURE al_position_mouse (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse';
PROCEDURE al_position_mouse_z (z: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse_z';
PROCEDURE al_position_mouse_w (w: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse_w';
PROCEDURE al_select_mouse_cursor (cursor: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'select_mouse_cursor';
PROCEDURE al_set_mouse_cursor_bitmap (cursor: AL_INT; bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_cursor_bitmap';
PROCEDURE al_set_mouse_sprite_focus (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_sprite_focus';
PROCEDURE al_get_mouse_mickeys (OUT mickeyx, mickeyy: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mouse_mickeys';
PROCEDURE al_set_mouse_sprite (sprite: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_sprite';
FUNCTION al_show_os_cursor (cursor: AL_INT): AL_BOOL; INLINE;
FUNCTION al_mouse_on_screen: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_on_screen';
PROCEDURE al_drawing_mode (mode: AL_INT; pattern: AL_BITMAPptr; x_anchor, y_anchor: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'drawing_mode';
PROCEDURE al_xor_mode (aOn: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'xor_mode';
PROCEDURE al_solid_mode; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'solid_mode';
PROCEDURE al_do_line (bmp: AL_BITMAPptr; x1, y1, x2, y2, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_line';
PROCEDURE al_do_circle (bmp: AL_BITMAPptr; x, y, radius, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_circle';
PROCEDURE al_do_ellipse (bmp: AL_BITMAPptr; x, y, rx, ry, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_ellipse';
PROCEDURE al_do_arc (bmp: AL_BITMAPptr; x, y: AL_INT; ang1, ang2: AL_FIXED; r, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_arc';
PROCEDURE al_calc_spline (VAR points: ARRAY OF AL_INT; npts: AL_INT; VAR x, y: ARRAY OF AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'calc_spline';
PROCEDURE al_blit (source, dest: AL_BITMAPptr; source_x, source_y, dest_x, dest_y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'blit';
PROCEDURE al_masked_blit (source, dest: AL_BITMAPptr; source_x, source_y, dest_x, dest_y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'masked_blit';
PROCEDURE al_stretch_blit (source, dest: AL_BITMAPptr; source_x, source_y, source_width, source_height, dest_x, dest_y, dest_width, dest_height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stretch_blit';
PROCEDURE al_masked_stretch_blit (source, dest: AL_BITMAPptr; source_x, source_y, source_width, source_height, dest_x, dest_y, dest_width, dest_height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'masked_stretch_blit';
PROCEDURE al_stretch_sprite (bmp, sprite: AL_BITMAPptr; x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stretch_sprite';
PROCEDURE al_rotate_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_trans';
PROCEDURE al_rotate_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_v_flip_trans';
PROCEDURE al_rotate_scaled_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_trans';
PROCEDURE al_rotate_scaled_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_v_flip_trans';
PROCEDURE al_pivot_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_trans';
PROCEDURE al_pivot_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_v_flip_trans';
PROCEDURE al_pivot_scaled_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_trans';
PROCEDURE al_pivot_scaled_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_v_flip_trans';
PROCEDURE al_rotate_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_lit';
PROCEDURE al_rotate_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_v_flip_lit';
PROCEDURE al_rotate_scaled_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_lit';
PROCEDURE al_rotate_scaled_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_v_flip_lit';
PROCEDURE al_pivot_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_lit';
PROCEDURE al_pivot_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_v_flip_lit';
PROCEDURE al_pivot_scaled_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_lit';
PROCEDURE al_pivot_scaled_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_v_flip_lit';
FUNCTION al_getpixel (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
PROCEDURE al_putpixel (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
PROCEDURE al_vline (bmp: AL_BITMAPptr; x, y1, y2, color: AL_INT); INLINE;
PROCEDURE al_hline (bmp: AL_BITMAPptr; x1, y, x2, color: AL_INT); INLINE;
PROCEDURE al_line (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT);
PROCEDURE al_fastline (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;
PROCEDURE al_rectfill (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;
PROCEDURE al_triangle (bmp: AL_BITMAPptr; x1, y1, x2, y2, x3, y3, color: AL_INT); INLINE;
PROCEDURE al_polygon (bmp: AL_BITMAPptr; vertices: AL_INT; CONST points: ARRAY OF AL_INT; color: AL_INT);
PROCEDURE al_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;
PROCEDURE al_circle (bmp: AL_BITMAPptr; x, y, r, color: AL_INT); INLINE;
PROCEDURE al_circlefill (bmp: AL_BITMAPptr; x, y, r, color: AL_INT); INLINE;
PROCEDURE al_ellipse (bmp: AL_BITMAPptr; x, y, rx, ry, color: AL_INT); INLINE;
PROCEDURE al_ellipsefill (bmp: AL_BITMAPptr; x, y, rx, ry, color: AL_INT); INLINE;
PROCEDURE al_arc (bmp: AL_BITMAPptr; x, y: AL_INT; ang1, ang2: AL_FIXED; r, color: AL_INT); INLINE;
PROCEDURE al_spline (bmp: AL_BITMAPptr; CONST points: ARRAY OF AL_INT; color: AL_INT);
PROCEDURE al_floodfill (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
PROCEDURE al_draw_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_sprite_ex (bmp, sprite: AL_BITMAPptr; x, y, mode, flip: AL_INT); INLINE;
PROCEDURE al_draw_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_sprite_h_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_sprite_vh_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_trans_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_lit_sprite (bmp, sprite: AL_BITMAPptr; x, y, c: AL_INT); INLINE;
PROCEDURE al_draw_gouraud_sprite (bmp, sprite: AL_BITMAPptr; x, y, c1, c2, c3, c4: AL_INT); INLINE;
PROCEDURE al_rotate_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); INLINE;
PROCEDURE al_rotate_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); INLINE;
PROCEDURE al_rotate_scaled_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); INLINE;
PROCEDURE al_rotate_scaled_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); INLINE;
PROCEDURE al_pivot_sprite (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); INLINE;
PROCEDURE al_pivot_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); INLINE;
PROCEDURE al_pivot_scaled_sprite (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); INLINE;
PROCEDURE al_pivot_scaled_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); INLINE;
PROCEDURE _al_putpixel (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
FUNCTION _al_getpixel (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
PROCEDURE _al_putpixel15 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
FUNCTION _al_getpixel15 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
PROCEDURE _al_putpixel16 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
FUNCTION _al_getpixel16 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
PROCEDURE _al_putpixel24 (bmp: AL_BITMAPptr; x, y, color: AL_INT);
FUNCTION _al_getpixel24 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
PROCEDURE _al_putpixel32 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;
FUNCTION _al_getpixel32 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;
FUNCTION al_font_has_alpha (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'font_has_alpha';
PROCEDURE al_make_trans_font (f: AL_FONTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'make_trans_font';
FUNCTION al_is_trans_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_trans_font';
FUNCTION al_is_color_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_color_font';
FUNCTION al_is_mono_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_mono_font';
FUNCTION al_is_compatible_font (f1, f2: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_compatible_font';
FUNCTION al_load_font (filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_font';
FUNCTION al_load_bitmap_font (filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bitmap_font';
FUNCTION al_load_txt_font (CONST filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_txt_font';
FUNCTION al_grab_font_from_bitmap (bmp: AL_BITMAPptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'grab_font_from_bitmap';
FUNCTION al_get_font_ranges (f: AL_FONTptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_ranges';
FUNCTION al_get_font_range_begin (f: AL_FONTptr; range: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_range_begin';
FUNCTION al_get_font_range_end (f: AL_FONTptr; range: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_range_end';
FUNCTION al_extract_font_range (f: AL_FONTptr; start, finish: AL_INT): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'extract_font_range';
FUNCTION al_merge_fonts (f1, f2: AL_FONTptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'merge_fonts';
FUNCTION al_transpose_font (f: AL_FONTptr; drange: AL_INT): AL_BOOL; INLINE;
PROCEDURE al_textout_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_ex';
PROCEDURE al_textout_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_centre_ex';
PROCEDURE al_textout_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_right_ex';
PROCEDURE al_textout_justify_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x1, x2, y, diff, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_justify_ex';
PROCEDURE al_textprintf_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);
PROCEDURE al_textprintf_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);
PROCEDURE al_textprintf_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);
FUNCTION al_text_length (CONST f: AL_FONTptr; CONST str: AL_STR): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'text_length';
FUNCTION al_text_height (CONST f: AL_FONTptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'text_height';
PROCEDURE al_destroy_font (f: AL_FONTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_font';
FUNCTION al_get_rle_sprite (bitmap: AL_BITMAPptr): AL_RLE_SPRITEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_rle_sprite';
PROCEDURE al_destroy_rle_sprite (sprite: AL_RLE_SPRITEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_rle_sprite';
PROCEDURE al_draw_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_trans_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y: AL_INT); INLINE;
PROCEDURE al_draw_lit_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y, color: AL_INT); INLINE;
PROCEDURE al_reserve_voices (digi_voices, midi_voices: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'reserve_voices';
PROCEDURE al_set_volume_per_voice (scale: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_volume_per_voice';
FUNCTION al_install_sound (digi, midi: AL_INT): AL_BOOL; INLINE;
PROCEDURE al_remove_sound; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_sound';
PROCEDURE al_set_volume (digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_volume';
PROCEDURE al_set_hardware_volume (digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_hardware_volume';
PROCEDURE al_get_volume (OUT digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_volume';
PROCEDURE al_get_hardware_volume (OUT digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_hardware_volume';
PROCEDURE al_set_mixer_quality (quality: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mixer_quality';
FUNCTION al_get_mixer_quality: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_quality';
FUNCTION al_get_mixer_frequency: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_frequency';
FUNCTION al_get_mixer_bits: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_bits';
FUNCTION al_get_mixer_channels: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_channels';
FUNCTION al_get_mixer_voices: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_voices';
FUNCTION al_get_mixer_buffer_length: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_buffer_length';
FUNCTION al_detect_midi_driver (driver_id: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'detect_midi_driver';
FUNCTION al_load_midi (CONST filename: AL_STR): AL_MIDIptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_midi';
PROCEDURE al_destroy_midi (midi: AL_MIDIptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_midi';
FUNCTION al_play_midi (midi: AL_MIDIptr; loop: AL_BOOL): AL_BOOL; INLINE;
FUNCTION al_play_looped_midi (midi: AL_MIDIptr; loop_start, loop_end: AL_INT): AL_BOOL; INLINE;
PROCEDURE al_stop_midi; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stop_midi';
PROCEDURE al_midi_pause; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_pause';
PROCEDURE al_midi_resume; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_resume';
FUNCTION al_midi_seek (target: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_seek';
FUNCTION al_get_midi_length (midi: AL_MIDIptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_midi_length';
PROCEDURE al_midi_out (data: AL_UCHARptr; length: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_out';
FUNCTION al_load_midi_patches: AL_BOOL; INLINE;
FUNCTION al_detect_digi_driver (driver_id: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'detect_digi_driver';
FUNCTION al_load_sample (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_sample';
FUNCTION al_load_wav (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_wav';
FUNCTION al_load_voc (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_voc';
FUNCTION al_save_sample (CONST filename: STRING; spl: AL_SAMPLEptr): AL_BOOL; INLINE;
FUNCTION al_create_sample (bits, stereo, freq, len: AL_INT): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_sample';
PROCEDURE al_destroy_sample (spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_sample';
FUNCTION al_play_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq: AL_INT; CONST loop: AL_BOOL): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'play_sample';
PROCEDURE al_stop_sample (CONST spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stop_sample';
PROCEDURE al_adjust_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq: AL_INT; CONST loop: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'adjust_sample';
FUNCTION al_allocate_voice (CONST spl: AL_SAMPLEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allocate_voice';
PROCEDURE al_deallocate_voice (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'deallocate_voice';
PROCEDURE al_reallocate_voice (voice: AL_INT; CONST spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'reallocate_voice';
PROCEDURE al_release_voice (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'release_voice';
PROCEDURE al_voice_start (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_start';
PROCEDURE al_voice_stop (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop';
PROCEDURE al_voice_set_priority (voice, priority: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_priority';
FUNCTION al_voice_check (voice: AL_INT): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_check';
PROCEDURE al_voice_set_playmode (voice, playmode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_playmode';
FUNCTION al_voice_get_position (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_position';
PROCEDURE al_voice_set_position (voice, position: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_position';
FUNCTION al_voice_get_volume (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_volume';
PROCEDURE al_voice_set_volume (voice, volume: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_volume';
PROCEDURE al_voice_ramp_volume (voice, tyme, endvol: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_ramp_volume';
PROCEDURE al_voice_stop_volumeramp (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_volumeramp';
FUNCTION al_voice_get_frequency (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_frequency';
PROCEDURE al_voice_set_frequency (voice, frequency: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_frequency';
PROCEDURE al_voice_sweep_frequency (voice, tyme, endfreq: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_sweep_frequency';
PROCEDURE al_voice_stop_frequency_sweep (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_frequency_sweep';
FUNCTION al_voice_get_pan (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_pan';
PROCEDURE al_voice_set_pan (voice, pan: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_pan';
PROCEDURE al_voice_sweep_pan (voice, tyme, endpan: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_sweep_pan';
PROCEDURE al_voice_stop_pan_sweep (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_pan_sweep';
PROCEDURE al_voice_set_echo (voice, strength, delay: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_echo';
PROCEDURE al_voice_set_tremolo (voice, rate, depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_tremolo';
PROCEDURE al_voice_set_vibrato (voice, rate, depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_vibrato';
PROCEDURE al_register_sample_file_type (CONST ext: AL_STR; load: AL_SAMPLE_LOAD_FUNC; save: AL_SAMPLE_SAVE_FUNC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'register_sample_file_type';

Types

AL_JOYSTICK_INFOptr = ˆAL_JOYSTICK_INFO;
AL_JOYSTICK_INFO_LIST = ARRAY [0..AL_UNKNOWN_SIZE] OF AL_JOYSTICK_INFO;
AL_RGBptr = ˆAL_RGB;
AL_PALETTEptr = ˆAL_PALETTE;
AL_PALETTE = ARRAY [0..AL_PAL_SIZE-1] OF AL_RGB;
AL_RGB_MAPptr = ˆAL_RGB_MAP;
AL_PALETTE_DICTptr = ˆAL_PALETTE_DICT;
AL_PALETTE_DICT = ARRAY [0..255] OF AL_INT;
AL_BITMAPptr = ˆAL_BITMAP;
AL_POINT_PROC = PROCEDURE (bmp: AL_BITMAPptr; x, y, c: AL_INT); CDECL;
AL_GFX_MODEptr = ˆAL_GFX_MODE;
AL_GFX_MODE_LISTptr = ˆAL_GFX_MODE_LIST;
AL_FONTptr = AL_POINTER;
AL_RLE_SPRITEptr = ˆAL_RLE_SPRITE;
AL_MIDIptr = ˆAL_MIDI;
AL_MIDI_MSG_CALLBACK_PROC = PROCEDURE (msg, b1, b2: AL_INT); CDECL;
AL_SAMPLEptr = ˆAL_SAMPLE;
AL_SAMPLE_LOAD_FUNC = FUNCTION (CONST filename: AL_STR): AL_SAMPLEptr; CDECL;
AL_SAMPLE_SAVE_FUNC = FUNCTION (CONST filename: AL_STR; spl: AL_SAMPLEptr): AL_INT; CDECL;

Constants

AL_VERSION = 4;
AL_SUB_VERSION = 4;
AL_PAS_VERSION = 5;
AL_PAS_IS_BETA = TRUE;
AL_PAS_VERSION_STR = '4.4.5 SVN';
AL_OSTYPE_UNKNOWN = 0;
AL_OSTYPE_WIN3 = $57494E33;
AL_OSTYPE_WIN95 = $57393520;
AL_OSTYPE_WIN98 = $57393820;
AL_OSTYPE_WINME = $574D4520;
AL_OSTYPE_WINNT = $574E5420;
AL_OSTYPE_WIN2000 = $57324B20;
AL_OSTYPE_WINXP = $57585020;
AL_OSTYPE_WIN2003 = $57324B33;
AL_OSTYPE_WINVISTA = $57565354;
AL_OSTYPE_WIN7 = $57494E37;
AL_OSTYPE_OS2 = $4F533220;
AL_OSTYPE_WARP = $57415250;
AL_OSTYPE_UNIX = $554E4958;
AL_OSTYPE_LINUX = $54555820;
AL_OSTYPE_SUNOS = $53554E20;
AL_OSTYPE_FREEBSD = $46425344;
AL_OSTYPE_NETBSD = $4E425344;
AL_OSTYPE_OPENBSD = $4F425344;
AL_OSTYPE_IRIX = $49524958;
AL_OSTYPE_QNX = $514E5820;
AL_OSTYPE_BEOS = $42454F53;
AL_OSTYPE_HAIKU = $4841494B;
AL_OSTYPE_DARWIN = $44415257;
AL_OSTYPE_MACOS = $4D414320;
AL_OSTYPE_MACOSX = $4D414358;
AL_SYSTEM_AUTODETECT = 0;
AL_SYSTEM_NONE = $4E4F4E45;
AL_CPU_ID = $0001;
AL_CPU_FPU = $0002;
AL_CPU_MMX = $0004;
AL_CPU_MMXPLUS = $0008;
AL_CPU_SSE = $0010;
AL_CPU_SSE2 = $0020;
AL_CPU_3DNOW = $0040;
AL_CPU_ENH3DNOW = $0080;
AL_CPU_CMOV = $0100;
AL_CPU_AMD64 = $0200;
AL_CPU_IA64 = $0400;
AL_CPU_SSE3 = $0800;
AL_CPU_SSSE3 = $1000;
AL_CPU_SSE41 = $2000;
AL_CPU_SSE42 = $4000;
AL_CPU_FAMILY_UNKNOWN = 0;
AL_CPU_FAMILY_I386 = 3;
AL_CPU_FAMILY_I486 = 4;
AL_CPU_FAMILY_I586 = 5;
AL_CPU_FAMILY_I686 = 6;
AL_CPU_FAMILY_ITANIUM = 7;
AL_CPU_FAMILY_EXTENDED = 15;
AL_CPU_FAMILY_POWERPC = 18;
AL_CPU_MODEL_I486DX = 0;
AL_CPU_MODEL_I486DX50 = 1;
AL_CPU_MODEL_I486SX = 2;
AL_CPU_MODEL_I487SX = 3;
AL_CPU_MODEL_I486SL = 4;
AL_CPU_MODEL_I486SX2 = 5;
AL_CPU_MODEL_I486DX2 = 7;
AL_CPU_MODEL_I486DX4 = 8;
AL_CPU_MODEL_PENTIUM = 1;
AL_CPU_MODEL_PENTIUMP54C = 2;
AL_CPU_MODEL_PENTIUMOVERDRIVE = 3;
AL_CPU_MODEL_PENTIUMOVERDRIVEDX4 = 4;
AL_CPU_MODEL_CYRIX = 14;
AL_CPU_MODEL_UNKNOWN = 15;
AL_CPU_MODEL_K5 = 0;
AL_CPU_MODEL_K6 = 6;
AL_CPU_MODEL_PENTIUMPROA = 0;
AL_CPU_MODEL_PENTIUMPRO = 1;
AL_CPU_MODEL_PENTIUMIIKLAMATH = 3;
AL_CPU_MODEL_PENTIUMII = 5;
AL_CPU_MODEL_CELERON = 6;
AL_CPU_MODEL_PENTIUMIIIKATMAI = 7;
AL_CPU_MODEL_PENTIUMIIICOPPERMINE = 8;
AL_CPU_MODEL_PENTIUMIIIMOBILE = 9;
AL_CPU_MODEL_ATHLON = 2;
AL_CPU_MODEL_DURON = 3;
AL_CPU_MODEL_PENTIUMIV = 0;
AL_CPU_MODEL_XEON = 2;
AL_CPU_MODEL_ATHLON64 = 4;
AL_CPU_MODEL_OPTERON = 5;
AL_CPU_MODEL_POWERPC_601 = 1;
AL_CPU_MODEL_POWERPC_602 = 2;
AL_CPU_MODEL_POWERPC_603 = 3;
AL_CPU_MODEL_POWERPC_603e = 4;
AL_CPU_MODEL_POWERPC_603ev = 5;
AL_CPU_MODEL_POWERPC_604 = 6;
AL_CPU_MODEL_POWERPC_604e = 7;
AL_CPU_MODEL_POWERPC_620 = 8;
AL_CPU_MODEL_POWERPC_750 = 9;
AL_CPU_MODEL_POWERPC_7400 = 10;
AL_CPU_MODEL_POWERPC_7450 = 11;
AL_KEY_A = 1;
AL_KEY_B = 2;
AL_KEY_C = 3;
AL_KEY_D = 4;
AL_KEY_E = 5;
AL_KEY_F = 6;
AL_KEY_G = 7;
AL_KEY_H = 8;
AL_KEY_I = 9;
AL_KEY_J = 10;
AL_KEY_K = 11;
AL_KEY_L = 12;
AL_KEY_M = 13;
AL_KEY_N = 14;
AL_KEY_O = 15;
AL_KEY_P = 16;
AL_KEY_Q = 17;
AL_KEY_R = 18;
AL_KEY_S = 19;
AL_KEY_T = 20;
AL_KEY_U = 21;
AL_KEY_V = 22;
AL_KEY_W = 23;
AL_KEY_X = 24;
AL_KEY_Y = 25;
AL_KEY_Z = 26;
AL_KEY_0 = 27;
AL_KEY_1 = 28;
AL_KEY_2 = 29;
AL_KEY_3 = 30;
AL_KEY_4 = 31;
AL_KEY_5 = 32;
AL_KEY_6 = 33;
AL_KEY_7 = 34;
AL_KEY_8 = 35;
AL_KEY_9 = 36;
AL_KEY_0_PAD = 37;
AL_KEY_1_PAD = 38;
AL_KEY_2_PAD = 39;
AL_KEY_3_PAD = 40;
AL_KEY_4_PAD = 41;
AL_KEY_5_PAD = 42;
AL_KEY_6_PAD = 43;
AL_KEY_7_PAD = 44;
AL_KEY_8_PAD = 45;
AL_KEY_9_PAD = 46;
AL_KEY_F1 = 47;
AL_KEY_F2 = 48;
AL_KEY_F3 = 49;
AL_KEY_F4 = 50;
AL_KEY_F5 = 51;
AL_KEY_F6 = 52;
AL_KEY_F7 = 53;
AL_KEY_F8 = 54;
AL_KEY_F9 = 55;
AL_KEY_F10 = 56;
AL_KEY_F11 = 57;
AL_KEY_F12 = 58;
AL_KEY_ESC = 59;
AL_KEY_TILDE = 60;
AL_KEY_MINUS = 61;
AL_KEY_EQUALS = 62;
AL_KEY_BACKSPACE = 63;
AL_KEY_TAB = 64;
AL_KEY_OPENBRACE = 65;
AL_KEY_CLOSEBRACE = 66;
AL_KEY_ENTER = 67;
AL_KEY_COLON = 68;
AL_KEY_QUOTE = 69;
AL_KEY_BACKSLASH = 70;
AL_KEY_BACKSLASH2 = 71;
AL_KEY_COMMA = 72;
AL_KEY_STOP = 73;
AL_KEY_SLASH = 74;
AL_KEY_SPACE = 75;
AL_KEY_INSERT = 76;
AL_KEY_DEL = 77;
AL_KEY_HOME = 78;
AL_KEY_END = 79;
AL_KEY_PGUP = 80;
AL_KEY_PGDN = 81;
AL_KEY_LEFT = 82;
AL_KEY_RIGHT = 83;
AL_KEY_UP = 84;
AL_KEY_DOWN = 85;
AL_KEY_SLASH_PAD = 86;
AL_KEY_ASTERISK = 87;
AL_KEY_MINUS_PAD = 88;
AL_KEY_PLUS_PAD = 89;
AL_KEY_DEL_PAD = 90;
AL_KEY_ENTER_PAD = 91;
AL_KEY_PRTSCR = 92;
AL_KEY_PAUSE = 93;
AL_KEY_ABNT_C1 = 94;
AL_KEY_YEN = 95;
AL_KEY_KANA = 96;
AL_KEY_CONVERT = 97;
AL_KEY_NOCONVERT = 98;
AL_KEY_AT = 99;
AL_KEY_CIRCUMFLEX = 100;
AL_KEY_COLON2 = 101;
AL_KEY_KANJI = 102;
AL_KEY_EQUALS_PAD = 103;
AL_KEY_BACKQUOTE = 104;
AL_KEY_SEMICOLON = 105;
AL_KEY_COMMAND = 106;
AL_KEY_UNKNOWN1 = 107;
AL_KEY_UNKNOWN2 = 108;
AL_KEY_UNKNOWN3 = 109;
AL_KEY_UNKNOWN4 = 110;
AL_KEY_UNKNOWN5 = 111;
AL_KEY_UNKNOWN6 = 112;
AL_KEY_UNKNOWN7 = 113;
AL_KEY_UNKNOWN8 = 114;
AL_KEY_MODIFIERS = 115;
AL_KEY_LSHIFT = 115;
AL_KEY_RSHIFT = 116;
AL_KEY_LCONTROL = 117;
AL_KEY_RCONTROL = 118;
AL_KEY_ALT = 119;
AL_KEY_ALTGR = 120;
AL_KEY_LWIN = 121;
AL_KEY_RWIN = 122;
AL_KEY_MENU = 123;
AL_KEY_SCRLOCK = 124;
AL_KEY_NUMLOCK = 125;
AL_KEY_CAPSLOCK = 126;
AL_KEY_MAX = 127;
AL_KB_SHIFT_FLAG = $0001;
AL_KB_CTRL_FLAG = $0002;
AL_KB_ALT_FLAG = $0004;
AL_KB_LWIN_FLAG = $0008;
AL_KB_RWIN_FLAG = $0010;
AL_KB_MENU_FLAG = $0020;
AL_KB_COMMAND_FLAG = $0040;
AL_KB_SCROLOCK_FLAG = $0100;
AL_KB_NUMLOCK_FLAG = $0200;
AL_KB_CAPSLOCK_FLAG = $0400;
AL_KB_INALTSEQ_FLAG = $0800;
AL_KB_ACCENT1_FLAG = $1000;
AL_KB_ACCENT2_FLAG = $2000;
AL_KB_ACCENT3_FLAG = $4000;
AL_KB_ACCENT4_FLAG = $8000;
AL_JOY_TYPE_AUTODETECT = -1;
AL_JOY_TYPE_NONE = 0;
AL_MAX_JOYSTICKS = 8;
AL_MAX_JOYSTICK_AXIS = 3;
AL_MAX_JOYSTICK_STICKS = 5;
AL_MAX_JOYSTICK_BUTTONS = 32;
AL_JOYFLAG_DIGITAL = 1;
AL_JOYFLAG_ANALOGUE = 2;
AL_JOYFLAG_CALIB_DIGITAL = 4;
AL_JOYFLAG_CALIB_ANALOGUE = 8;
AL_JOYFLAG_CALIBRATE = 16;
AL_JOYFLAG_SIGNED = 32;
AL_JOYFLAG_UNSIGNED = 64;
AL_JOYFLAG_ANALOG = AL_JOYFLAG_ANALOGUE;
AL_JOYFLAG_CALIB_ANALOG = AL_JOYFLAG_CALIB_ANALOGUE;
AL_PAL_SIZE = 256;
AL_GFX_TEXT = -1;
AL_GFX_AUTODETECT = 0;
AL_GFX_AUTODETECT_FULLSCREEN = 1;
AL_GFX_AUTODETECT_WINDOWED = 2;
AL_GFX_SAFE = $53414645;
AL_GFX_NONE = $4E4F4E45;
AL_COLORCONV_NONE = 0;
AL_COLORCONV_8_TO_15 = 1;
AL_COLORCONV_8_TO_16 = 2;
AL_COLORCONV_8_TO_24 = 4;
AL_COLORCONV_8_TO_32 = 8;
AL_COLORCONV_15_TO_8 = $10;
AL_COLORCONV_15_TO_16 = $20;
AL_COLORCONV_15_TO_24 = $40;
AL_COLORCONV_15_TO_32 = $80;
AL_COLORCONV_16_TO_8 = $100;
AL_COLORCONV_16_TO_15 = $200;
AL_COLORCONV_16_TO_24 = $400;
AL_COLORCONV_16_TO_32 = $800;
AL_COLORCONV_24_TO_8 = $1000;
AL_COLORCONV_24_TO_15 = $2000;
AL_COLORCONV_24_TO_16 = $4000;
AL_COLORCONV_24_TO_32 = $8000;
AL_COLORCONV_32_TO_8 = $10000;
AL_COLORCONV_32_TO_15 = $20000;
AL_COLORCONV_32_TO_16 = $40000;
AL_COLORCONV_32_TO_24 = $80000;
AL_COLORCONV_32A_TO_8 = $100000;
AL_COLORCONV_32A_TO_15 = $200000;
AL_COLORCONV_32A_TO_16 = $400000;
AL_COLORCONV_32A_TO_24 = $800000;
AL_COLORCONV_DITHER_PAL = $1000000;
AL_COLORCONV_DITHER_HI = $2000000;
AL_COLORCONV_KEEP_TRANS = $4000000;
AL_COLORCONV_DITHER = AL_COLORCONV_DITHER_PAL OR AL_COLORCONV_DITHER_HI;
AL_COLORCONV_EXPAND_256 = AL_COLORCONV_8_TO_15 OR AL_COLORCONV_8_TO_16 OR AL_COLORCONV_8_TO_24 OR AL_COLORCONV_8_TO_32;
AL_COLORCONV_REDUCE_TO_256 = AL_COLORCONV_15_TO_8 OR AL_COLORCONV_16_TO_8 OR AL_COLORCONV_24_TO_8 OR AL_COLORCONV_32_TO_8 OR AL_COLORCONV_32A_TO_8;
AL_COLORCONV_EXPAND_15_TO_16 = AL_COLORCONV_15_TO_16;
AL_COLORCONV_REDUCE_16_TO_15 = AL_COLORCONV_16_TO_15;
AL_COLORCONV_EXPAND_HI_TO_TRUE = AL_COLORCONV_15_TO_24 OR AL_COLORCONV_15_TO_32 OR AL_COLORCONV_16_TO_24 OR AL_COLORCONV_16_TO_32;
AL_COLORCONV_REDUCE_TRUE_TO_HI = AL_COLORCONV_24_TO_15 OR AL_COLORCONV_24_TO_16 OR AL_COLORCONV_32_TO_15 OR AL_COLORCONV_32_TO_16;
AL_COLORCONV_24_EQUALS_32 = AL_COLORCONV_24_TO_32 OR AL_COLORCONV_32_TO_24;
AL_COLORCONV_TOTAL = AL_COLORCONV_EXPAND_256 OR AL_COLORCONV_REDUCE_TO_256 OR AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_EXPAND_HI_TO_TRUE OR AL_COLORCONV_REDUCE_TRUE_TO_HI OR AL_COLORCONV_24_EQUALS_32 OR AL_COLORCONV_32A_TO_15 OR AL_COLORCONV_32A_TO_16 OR AL_COLORCONV_32A_TO_24;
AL_COLORCONV_PARTIAL = AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_24_EQUALS_32;
AL_COLORCONV_MOST = AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_EXPAND_HI_TO_TRUE OR AL_COLORCONV_REDUCE_TRUE_TO_HI OR AL_COLORCONV_24_EQUALS_32;
AL_COLORCONV_KEEP_ALPHA = AL_COLORCONV_TOTAL AND NOT (AL_COLORCONV_32A_TO_8 OR AL_COLORCONV_32A_TO_15 OR AL_COLORCONV_32A_TO_16 OR AL_COLORCONV_32A_TO_24);
AL_GFX_CAN_SCROLL = $00000001;
AL_GFX_CAN_TRIPLE_BUFFER = $00000002;
AL_GFX_HW_CURSOR = $00000004;
AL_GFX_HW_HLINE = $00000008;
AL_GFX_HW_HLINE_XOR = $00000010;
AL_GFX_HW_HLINE_SOLID_PATTERN = $00000020;
AL_GFX_HW_HLINE_COPY_PATTERN = $00000040;
AL_GFX_HW_FILL = $00000080;
AL_GFX_HW_FILL_XOR = $00000100;
AL_GFX_HW_FILL_SOLID_PATTERN = $00000200;
AL_GFX_HW_FILL_COPY_PATTERN = $00000400;
AL_GFX_HW_LINE = $00000800;
AL_GFX_HW_LINE_XOR = $00001000;
AL_GFX_HW_GLYPH = $00008000;
AL_GFX_HW_VRAM_BLIT = $00010000;
AL_GFX_HW_VRAM_BLIT_MASKED = $00020000;
AL_GFX_HW_MEM_BLIT = $00040000;
AL_GFX_HW_MEM_BLIT_MASKED = $00080000;
AL_GFX_HW_SYS_TO_VRAM_BLIT = $00100000;
AL_GFX_HW_SYS_TO_VRAM_BLIT_MASKED = $00200000;
AL_GFX_SYSTEM_CURSOR = $00400000;
AL_MOUSE_CURSOR_NONE = 0;
AL_MOUSE_CURSOR_ALLEGRO = 1;
AL_MOUSE_CURSOR_ARROW = 2;
AL_MOUSE_CURSOR_BUSY = 3;
AL_MOUSE_CURSOR_QUESTION = 4;
AL_MOUSE_CURSOR_EDIT = 5;
AL_DRAW_MODE_SOLID = 0;
AL_DRAW_MODE_XOR = 1;
AL_DRAW_MODE_COPY_PATTERN = 2;
AL_DRAW_MODE_SOLID_PATTERN = 3;
AL_DRAW_MODE_MASKED_PATTERN = 4;
AL_DRAW_MODE_TRANS = 5;
AL_MIDI_AUTODETECT = -1;
AL_MIDI_NONE = 0;
AL_MIDI_DIGMID = $44494749;
AL_MIDI_VOICES = 64;
AL_MIDI_TRACKS = 32;
AL_DIGI_AUTODETECT = -1;
AL_DIGI_NONE = 0;
AL_DIGI_VOICES = 64;
AL_PLAYMODE_PLAY = 0;
AL_PLAYMODE_LOOP = 1;
AL_PLAYMODE_FORWARD = 0;
AL_PLAYMODE_BACKWARD = 2;
AL_PLAYMODE_BIDIR = 4;

Variables

al_errno: AL_INTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_errno';
al_id_string: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_id';
al_error: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_error';
al_os_type: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_type';
al_os_version: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_version';
al_os_revision: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_revision';
al_os_multitasking: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_multitasking';
al_cpu_vendor: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_vendor';
al_cpu_family: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_family';
al_cpu_model: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_model';
al_cpu_capabilities: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_capabilities';
al_retrace_count: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'retrace_count';
al_keyboard_lowlevel_callback: AL_INT_PROC; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keyboard_lowlevel_callback';
al_key: AL_KEY_LIST; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key';
al_key_shifts: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key_shifts';
al_three_finger_flag: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'three_finger_flag';
al_key_led_flag: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key_led_flag';
al_joy: AL_JOYSTICK_INFO_LIST; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'joy';
al_num_joysticks: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'num_joysticks';
al_black_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'black_palette';
al_desktop_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'desktop_palette';
al_default_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'default_palette';
al_rgb_table: AL_RGB_MAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rgb_map';
al_palette_color: AL_PALETTE_DICTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'palette_color';
al_screen: AL_BITMAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'screen';
AL_SCREEN_W: AL_INT;
AL_SCREEN_H: AL_INT;
AL_VIRTUAL_W: AL_INT;
AL_VIRTUAL_H: AL_INT;
al_gfx_capabilities: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'gfx_capabilities';
al_mouse_sprite: AL_BITMAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_sprite';
al_mouse_x_focus: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_x_focus';
al_mouse_y_focus: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_y_focus';
al_mouse_x: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_x';
al_mouse_y: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_y';
al_mouse_z: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_z';
al_mouse_w: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_w';
al_mouse_b: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_b';
al_mouse_pos: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_pos';
al_font: AL_FONTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'font';
al_404_char: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_404_char';
al_midi_pos: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_pos';
al_midi_time: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_time';
al_midi_loop_start: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_loop_start';
al_midi_loop_end: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_loop_end';
al_midi_msg_callback: AL_MIDI_MSG_CALLBACK_PROC; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_msg_callback';

Description

Functions and Procedures

FUNCTION AL_ID (str: SHORTSTRING): AL_INT32; INLINE;

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_install (system_id: AL_INT): AL_BOOL; INLINE;

Initialises the Allegro library. You must call either this or al_init before doing anything other. The functions that can be called before this one will be marked explicitly in the documentation, like al_set_config_file.

The available system ID codes will vary from one platform to another, but you will almost always want to pass AL_SYSTEM_AUTODETECT. Alternatively, AL_SYSTEM_NONE installs a stripped down version of Allegro that won't even try to touch your hardware or do anything platform specific: this can be useful for situations where you only want to manipulate memory bitmaps, such as the text mode datafile tools or the Windows GDI interfacing functions.

Parameters
system_id
Identification of the system.
Returns

True on success or False on failure (e.g. no system driver could be used).

See also
al_exit
Closes down the Allegro system.
al_set_uformat
Sets the current text encoding format.
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
alUNIX
UNIX and Linux specific stuff.
alWin
Windows specific stuff.
FUNCTION al_init: AL_BOOL; INLINE;

Function which initialises the Allegro library. This is the same thing as calling al_install (AL_SYSTEM_AUTODETECT).

Returns

True on success or False on failure (e.g. no system driver could be used).

See also
al_exit
Closes down the Allegro system.
PROCEDURE al_exit; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_exit';

Closes down the Allegro system. This includes returning the system to text mode and removing whatever mouse, keyboard, and timer routines have been installed. You don't normally need to bother making an explicit call to this function, because it will be called automatically when your program exits.

Note that after you call this function, other functions like al_destroy_bitmap will most likely crash. This might be a problem for some Object Pascal programs, depending where the destructors are called.

See also
al_install
Initialises the Allegro library.
al_init
Function which initialises the Allegro library.
PROCEDURE al_message (CONST msg: AL_STR); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_message';

Outputs a message. Usually you want to use this to report messages to the user in an OS independant way when some Allegro subsystem cannot be initialised. But you must not use this function if you are in a graphic mode, only before calling al_set_gfx_mode, or after a al_set_gfx_mode (AL_GFX_TEXT). Also, this function depends on a system driver being installed, which means that it won't display the message at all on some platforms if Allegro has not been initialised correctly.

On platforms featuring a windowing system, it will bring up a blocking GUI message box. If there is no windowing system, it will try to print the string to a text console, attempting to work around codepage differences by reducing any accented characters to 7-bit ASCII approximations. Example:

  IF NOT al_init THEN
    EXIT (1);
  IF NOT init_my_data THEN
  BEGIN
    al_message ('Sorry, missing game data!\n');
    EXIT (2);
  END;
  

FUNCTION al_set_close_button_callback (proc: AL_SIMPLE_PROC): AL_BOOL; INLINE;

On platforms that have a close button, this routine installs a callback function to handle the close event. In other words, when the user clicks the close button on your program's window or any equivalent device, the function you specify here will be called.

This function should not generally attempt to exit the program or save any data itself. The function could be called at any time, and there is usually a risk of conflict with the main thread of the program. Instead, you should set a flag during this function, and test it on a regular basis in the main loop of the program.

Pass Nil as the `proc' argument to this function to disable the close button functionality, which is the default state.

Example:

VAR
  CloseButtonPressed: BOOLEAN = FALSE;

PROCEDURE CloseButtonHandler; CDECL;
BEGIN
  CloseButtonPressed := TRUE;
END;

    ...
  al_init;
  al_set_close_button_callback (@CloseButtonHandler);
    ...
  REPEAT DoStuff UNTIL CloseButtonPressed;
  

Returns

True on success or False on failure (e.g. the feature is not supported by the platform).

See also
al_set_window_title
On platforms that are capable of it, this routine alters the window title for your Allegro program.
PROCEDURE al_check_cpu; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'check_cpu';

Detects the CPU type, setting the following global variables. You don't normally need to call this, because al_init will do it for you.

See also
al_cpu_vendor
On Intel PCs, contains the CPU vendor name if known.
al_cpu_family
Contains the CPU type, where applicable.
al_cpu_model
Contains the CPU submodel, where applicable.
al_cpu_capabilities
Contains CPU flags indicating what features are available on the current CPU.
PROCEDURE al_set_window_title (CONST title: AL_STR); INLINE;

On platforms that are capable of it, this routine alters the window title for your Allegro program.

Parameters
title
Title string.
See also
al_set_close_button_callback
On platforms that have a close button, this routine installs a callback function to handle the close event.
al_set_uformat
Sets the current text encoding format.
FUNCTION al_desktop_color_depth: AL_INT; INLINE;

Finds out the currently selected desktop color depth. You can use this information to make your program use the same color depth as the desktop, which will likely make it run faster because the graphic driver won't be doing unnecessary color conversions behind your back.

Under some OSes, switching to a full screen graphics mode may automatically change the desktop color depth. You have, therefore, to call this function before setting any graphics mode in order to retrieve the real desktop color depth.

Returns

the color depth or zero on platforms where this information is not available or does not apply.

See also
al_get_desktop_resolution
Finds out the currently selected desktop resolution.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_set_gfx_mode
Switches into graphics mode.
FUNCTION al_get_desktop_resolution (OUT w, h: AL_INT): AL_BOOL; INLINE;

Finds out the currently selected desktop resolution. You can use this information to avoid creating windows bigger than the current resolution. This is especially important for some windowed drivers which are unable to create windows bigger than the desktop.

Under some OSes, switching to a full screen graphics mode may automatically change the desktop resolution. You have, therefore, to call this function before setting any graphics mode in order to retrieve the real desktop resolution.

Parameters
w
Width desktop resolution.
h
Height desktop resolution.
Returns

True on success, or False if this information is not available or does not apply, in which case the values stored in the variables you provided for `width' and `height' are undefined.

See also
al_desktop_color_depth
Finds out the currently selected desktop color depth.
al_set_gfx_mode
Switches into graphics mode.
PROCEDURE al_set_config_file (CONST filename: AL_STR); INLINE;

Sets the configuration file to be used by all subsequent config functions. (Allegro will not search for this file in other locations as it does with allegro.cfg at the time of initialization.)

All pointers returned by previous calls to al_get_config_string and other related functions are invalidated when you call this function! You can call this function before al_install to change the configuration file, but after al_set_uformat if you want to use a text encoding format other than the default.

See also
al_set_config_data
Specifies a block of data to be used by all subsequent config functions, which you have already loaded from disk (eg.
al_override_config_file
Specifies a file containing config overrides.
al_push_config_state
Pushes the current configuration state (filename, variable values, etc).
al_set_config_string
Writes a string variable to the current config file, replacing any existing value it may have, or removes the variable if val is empty.
PROCEDURE al_set_config_data (CONST data: AL_POINTER; lng: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_data';

Specifies a block of data to be used by all subsequent config functions, which you have already loaded from disk (eg. as part of some more complicated format of your own, or in a grabber datafile). This routine makes a copy of the information, so you can safely free the data after calling it.

See also
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
al_override_config_data
Version of al_override_config_file which uses a block of data that has already been read into memory.
al_push_config_state
Pushes the current configuration state (filename, variable values, etc).
al_set_config_string
Writes a string variable to the current config file, replacing any existing value it may have, or removes the variable if val is empty.
PROCEDURE al_override_config_file (CONST filename: AL_STR); INLINE;

Specifies a file containing config overrides. These settings will be used in addition to the parameters in the main config file, and where a variable is present in both files this version will take priority. This can be used by application programmers to override some of the config settings from their code, while still leaving the main config file free for the end user to customise. For example, you could specify a particular sample frequency and IBK instrument file, but the user could still use an allegro.cfg file to specify the port settings and irq numbers.

The override config file will not only take precedence when reading, but will also be used for storing values. When you are done with using the override config file, you can call al_override_config_file with an empty string as parameter, so config data will be directly read from the current config file again.

Note: The override file is completely independent from the current configuration. You can e.g. call al_set_config_file, and the override file will still be active. Also the al_flush_config_file function will only affect the current config file (which can be changed with al_set_config_file), never the overriding one specified with this function. The modified override config is written back to disk whenever you call al_override_config_file.

Note that this function and al_override_config_data are mutually exclusive, i.e. calling one will cancel the effects of the other.

PROCEDURE al_override_config_data (CONST data: AL_POINTER; lng: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'override_config_data';

Version of al_override_config_file which uses a block of data that has already been read into memory. The length of the block has to be specified in bytes.

Note that this function and al_override_config_file are mutually exclusive, i.e. calling one will cancel the effects of the other.

PROCEDURE al_flush_config_file; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'flush_config_file';

Writes the current config file to disk if the contents have changed since it was loaded or since the latest call to the function.

See also
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
al_override_config_file
Specifies a file containing config overrides.
al_push_config_state
Pushes the current configuration state (filename, variable values, etc).
PROCEDURE al_push_config_state; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'push_config_state';

Pushes the current configuration state (filename, variable values, etc). onto an internal stack, allowing you to select some other config source and later restore the current settings by calling al_pop_config_state. This function is mostly intended for internal use by other library functions, for example when you specify a config filename to the al_save_joystick_data function, it pushes the config state before switching to the file you specified.

See also
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
PROCEDURE al_pop_config_state; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pop_config_state';

Pops a configuration state previously stored by al_push_config_state, replacing the current config source with it.

FUNCTION al_get_config_string (CONST section, name, def: AL_STR): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_string';

Retrieves a string variable from the current config file. Example:

VAR
  Lang: STRING;
  ...
  Lang := al_get_config_string ('system', 'language', 'EN');
  

Parameters
section
Set to an empty string to read variables from the root of the file, or used to control which set of parameters (eg. sound or joystick) you are interested in reading.
name
Name of the variable to read.
def
Default value.
Returns

The string string found in the configuration file. If the named variable cannot be found, or its entry in the config file is empty, the value of def is returned.

See also
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
al_set_config_string
Writes a string variable to the current config file, replacing any existing value it may have, or removes the variable if val is empty.
al_get_config_int
Reads an integer variable from the current config file.
al_get_config_hex
Reads an integer variable from the current config file, in hexadecimal.
al_get_config_float
Reads a floating point variable from the current config file.
FUNCTION al_get_config_int (CONST section, name: AL_STR; def: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_int';

Reads an integer variable from the current config file. See the comments about al_get_config_string.

FUNCTION al_get_config_hex (CONST section, name: AL_STR; def: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_hex';

Reads an integer variable from the current config file, in hexadecimal. See the comments about al_get_config_string.

FUNCTION al_get_config_float (CONST section, name: AL_STR; def: AL_FLOAT): AL_FLOAT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_float';

Reads a floating point variable from the current config file. See the comments about al_get_config_string.

FUNCTION al_get_config_id (CONST section, name: AL_STR; def: AL_INT32): AL_INT32; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_config_id';

Reads a 4-letter driver ID variable from the current config file. See the comments about al_get_config_string.

PROCEDURE al_set_config_string (CONST section, name, val: AL_STR); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_string';

Writes a string variable to the current config file, replacing any existing value it may have, or removes the variable if val is empty. The section name may be set to a empty string to write the variable to the root of the file, or used to control which section the variable is inserted into. The altered file will be cached in memory, and not actually written to disk until you call al_exit. Note that you can only write to files in this way, so the function will have no effect if the current config source was specified with al_set_config_data rather than al_set_config_file.

As a special case, variable or section names that begin with a '#' character are treated specially and will not be read from or written to the disk. Addon packages can use this to store version info or other status information into the config module, from where it can be read with the al_get_config_string function.

See also
al_set_config_file
Sets the configuration file to be used by all subsequent config functions.
al_get_config_string
Retrieves a string variable from the current config file.
al_set_config_int
Writes an integer variable to the current config file.
al_set_config_hex
Writes an integer variable to the current config file, in hexadecimal format.
al_set_config_float
Writes a floating point variable to the current config file.
al_flush_config_file
Writes the current config file to disk if the contents have changed since it was loaded or since the latest call to the function.
PROCEDURE al_set_config_int (CONST section, name: AL_STR; val: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_int';

Writes an integer variable to the current config file. See the comments about al_set_config_string.

PROCEDURE al_set_config_hex (CONST section, name: AL_STR; val: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_hex';

Writes an integer variable to the current config file, in hexadecimal format. See the comments about al_set_config_string.

PROCEDURE al_set_config_float (CONST section, name: AL_STR; val: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_float';

Writes a floating point variable to the current config file. See the comments about al_set_config_string.

PROCEDURE al_set_config_id (CONST section, name: AL_STR; val: AL_INT32); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_config_id';

Writes a 4-letter driver ID variable to the current config file. See the comments about al_set_config_string.

FUNCTION al_install_timer: AL_BOOL; INLINE;

Installs the Allegro timer interrupt handler. You must do this before installing any user timer routines, and also before displaying a mouse pointer and playing FLI animations or MIDI music.

Returns

True on success, or False on failure (but you may decide not to check the return value as this function is very unlikely to fail).

See also
al_remove_timer
Removes the Allegro timer handler.
al_install_int
Installs a user timer handler, with the speed given as the number of milliseconds between ticks.
PROCEDURE al_remove_timer; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_timer';

Removes the Allegro timer handler. You don't normally need to bother calling this, because al_exit will do it for you.

See also
al_install_timer
Installs the Allegro timer interrupt handler.
FUNCTION al_install_int_ex (proc: AL_SIMPLE_PROC; speed: AL_LONG): AL_BOOL; INLINE;

Adds a function to the list of user timer handlers or, if it is already installed, retroactively adjusts its speed (i.e makes as though the speed change occurred precisely at the last tick). The speed is given in hardware clock ticks, of which there are 1193181 a second. You can convert from other time formats to hardware clock ticks with the functions AL_SECS_TO_TIMER, AL_MSEC_TO_TIMER, AL_BPS_TO_TIMER and AL_BPM_TO_TIMER.

There can only be sixteen timers in use at a time, and some other parts of Allegro (the mouse pointer display routines, al_rest, the FLI player, and the MIDI player) need to install handlers of their own, so you should avoid using too many at the same time. If you call this routine without having first installed the timer module, al_install_timer will be called automatically.

Your function will be called by the Allegro interrupt handler and not directly by the processor, so it can be a normal CDECL function. You should be aware, however, that it will be called in an interrupt context, which imposes a lot of restrictions on what you can do in it. It should not use large amounts of stack, it must not make any calls to the operating system, use the run-time library functions, or contain any floating point code, and it must execute very quickly. Don't try to do lots of complicated code in a timer handler: as a general rule you should just set some flags and respond to these later in your main control loop.

Returns

True on success, or False if there is no room to add a new user timer.

See also
al_remove_int
Removes a function from the list of user interrupt routines.
al_install_int
Installs a user timer handler, with the speed given as the number of milliseconds between ticks.
al_install_param_int_ex
Like al_install_int_ex, but the callback routine will be passed a copy of the specified void pointer parameter.
FUNCTION al_install_int (proc: AL_SIMPLE_PROC; speed: AL_LONG): AL_BOOL; INLINE;

Installs a user timer handler, with the speed given as the number of milliseconds between ticks. This is the same thing as al_install_int_ex (@proc, AL_MSEC_TO_TIMER (speed)). If you call this routine without having first installed the timer module, al_install_timer will be called automatically. Calling again this routine with the same timer handler as parameter allows you to adjust its speed.

Returns

True on success, or False if there is no room to add a new user timer.

See also
al_remove_int
Removes a function from the list of user interrupt routines.
al_install_int_ex
Adds a function to the list of user timer handlers or, if it is already installed, retroactively adjusts its speed (i.e makes as though the speed change occurred precisely at the last tick).
al_install_param_int
Like al_install_int, but the callback routine will be passed a copy of the specified void pointer parameter.
PROCEDURE al_remove_int (proc: AL_SIMPLE_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_int';

Removes a function from the list of user interrupt routines. al_exit does this automatically.

See also
al_install_int
Installs a user timer handler, with the speed given as the number of milliseconds between ticks.
al_remove_param_int
Like al_remove_int, but for use with timer callbacks that have parameter values.
FUNCTION al_install_param_int_ex (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): AL_BOOL; INLINE;

Like al_install_int_ex, but the callback routine will be passed a copy of the specified void pointer parameter. To disable the handler, use al_remove_param_int instead of al_remove_int.

FUNCTION al_install_param_int (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): AL_BOOL; INLINE;

Like al_install_int, but the callback routine will be passed a copy of the specified void pointer parameter. To disable the handler, use al_remove_param_int instead of al_remove_int.

PROCEDURE al_remove_param_int (proc: AL_PARAM_PROC; param: AL_VOIDptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_param_int';

Like al_remove_int, but for use with timer callbacks that have parameter values. If there is more than one copy of the same callback active at a time, it identifies which one to remove by checking the parameter value (so you can't have more than one copy of a handler using an identical parameter).

See also
al_install_param_int
Like al_install_int, but the callback routine will be passed a copy of the specified void pointer parameter.
al_remove_int
Removes a function from the list of user interrupt routines.
FUNCTION AL_SECS_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;

Give the number of seconds between each tick to al_install_int_ex.

FUNCTION AL_MSEC_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;

Give the number of milliseconds between each tick to al_install_int_ex.

FUNCTION AL_BPS_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;

Give the number of ticks each second to al_install_int_ex.

FUNCTION AL_BPM_TO_TIMER (CONST x: AL_LONG): AL_LONG; INLINE;

Give the number of ticks each minute to al_install_int_ex.

PROCEDURE al_rest (mseconds: AL_UINT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest';

This function waits for the specified number of milliseconds.

Passing 0 as parameter will not wait, but just yield. This can be useful in order to "play nice" with other processes. Other values will cause CPU time to be dropped on most platforms. This will look better to users, and also does things like saving battery power and making fans less noisy.

Note that calling this inside your active game loop is a bad idea, as you never know when the OS will give you the CPU back, so you could end up missing the vertical retrace and skipping frames. On the other hand, on multitasking operating systems it is good form to give up the CPU for a while if you will not be using it.

PROCEDURE al_rest_callback (mseconds: AL_UINT; callback: AL_PARAM_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest_callback';

Like al_rest, but for non-zero values continually calls the specified function while it is waiting for the required time to elapse. If the provided callback parameter is Nil, this function does exactly the same thing as calling al_rest.

FUNCTION al_install_keyboard: AL_BOOL; INLINE;

Installs the Allegro keyboard interrupt handler. You must call this before using any of the keyboard input routines. Once you have set up the Allegro handler, you can no longer use operating system calls or the run-time library functions to access the keyboard.

Note that on some platforms the keyboard won't work unless you have set a graphics mode, even if this function returns a success value before calling al_set_gfx_mode. This can happen in environments with graphic windowed modes, since Allegro usually reads the keyboard through the graphical window (which appears after the al_set_gfx_mode call).

Returns

True on success, or False on failure (but you may decide not to check the return value as this function is very unlikely to fail).

See also
al_remove_keyboard
Removes the keyboard handler, returning control to the operating system.
al_poll_keyboard
Wherever possible, Allegro will read the keyboard input asynchronously (ie.
al_key
Array of flags indicating the state of each key, ordered by scancode.
al_keypressed
Returns True if there are keypresses waiting in the input buffer.
al_readkey
Returns the next character from the keyboard buffer, in ASCII format.
al_ureadkey
Returns the next character from the keyboard buffer, in Unicode format.
al_keyboard_lowlevel_callback
If set, this function is called by the keyboard handler in response to every keyboard event, both presses (including keyboard repeat rate) and releases.
al_three_finger_flag
The DJGPP keyboard handler provides an 'emergency exit' sequence which you can use to kill off your program.
al_key_led_flag
By default, the capslock, numlock, and scroll-lock keys toggle the keyboard LED indicators when they are pressed.
al_set_leds
Overrides the state of the keyboard LED indicators.
al_set_keyboard_rate
Sets the keyboard repeat rate.
PROCEDURE al_remove_keyboard; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_keyboard';

Removes the keyboard handler, returning control to the operating system. You don't normally need to bother calling this, because al_exit will do it for you. However, you might want to call this during runtime if you want to change the keyboard mapping on those platforms were keyboard mappings are needed. You would first modify the configuration variable holding the keyboard mapping and then reinstall the keyboard handler.

FUNCTION al_poll_keyboard: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_keyboard';

Wherever possible, Allegro will read the keyboard input asynchronously (ie. from inside an interrupt handler), but on some platforms that may not be possible, in which case you must call this routine at regular intervals to update the keyboard state variables.

To help you test your keyboard polling code even if you are programming on a platform that doesn't require it, after the first time that you call this function Allegro will switch into polling mode, so from that point onwards you will have to call this routine in order to get any keyboard input at all, regardless of whether the current driver actually needs to be polled or not.

The al_keypressed, al_readkey, and al_ureadkey functions call al_poll_keyboard automatically, so you only need to use this function when accessing the al_key array and al_key_shifts variable.

Returns

False on success or True on failure (ie. no keyboard driver installed).

FUNCTION al_keyboard_needs_poll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keyboard_needs_poll';

Returns True if the current keyboard driver is operating in polling mode.

FUNCTION al_keypressed: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keypressed';

Returns True if there are keypresses waiting in the input buffer. You can use this to see if the next call to al_readkey is going to block or to simply wait for the user to press a key while you still update the screen possibly drawing some animation. Example:

  REPEAT
    AnimateLogo (al_screen)
  UNTIL al_keypressed;
   

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_readkey
Returns the next character from the keyboard buffer, in ASCII format.
al_simulate_keypress
Stuffs a key into the keyboard buffer, just as if the user had pressed it.
al_clear_keybuf
Empties the keyboard buffer.
FUNCTION al_readkey: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'readkey';

Returns the next character from the keyboard buffer, in ASCII format. If the buffer is empty, it waits until a key is pressed. You can see if there are queued keypresses with al_keypressed.

The low byte of the return value contains the ASCII code of the key, and the high byte the scancode. The scancode remains the same whatever the state of the shift, ctrl and alt keys, while the ASCII code is affected by shift and ctrl in the normal way (shift changes case, ctrl+letter gives the position of that letter in the alphabet, eg. ctrl+A = 1, ctrl+B = 2, etc). Pressing alt+key returns only the scancode, with a zero ASCII code in the low byte. For example:

VAR
  val: LONGINT;
  ...
  val := al_readkey;

  IF (val AND $ff) = ORD ('d') THEN
    al_message ('You pressed "d"');

  IF (val SHR 8) = AL_KEY_SPACE THEN
    al_message ('You pressed Space');

  IF (val AND $ff) = 3 THEN
    al_message ('You pressed Control+C');

  IF val = (AL_KEY_X SHL 8) THEN
    al_message ('You pressed Alt+X');
   

This function cannot return character values greater than 255. If you need to read Unicode input, use al_ureadkey instead.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_ureadkey
Returns the next character from the keyboard buffer, in Unicode format.
al_key
Array of flags indicating the state of each key, ordered by scancode.
al_clear_keybuf
Empties the keyboard buffer.
al_simulate_keypress
Stuffs a key into the keyboard buffer, just as if the user had pressed it.
FUNCTION al_ureadkey (OUT scancode: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'ureadkey';

Returns the next character from the keyboard buffer, in Unicode format. If the buffer is empty, it waits until a key is pressed. You can see if there are queued keypresses with al_keypressed. The return value contains the Unicode value of the key, and the argument will be set to the scancode. Unlike al_readkey, this function is able to return character values greater than 255. Example:

VAR
  val, scancode: LONGINT;
  ...
  val := al_ureadkey (scancode);
  IF val = $00F1 THEN
    al_message ('You pressed n with tilde');

  IF val = $00DF THEN
    al_message ('You pressed sharp s');
   

You should be able to find Unicode character maps at http://www.unicode.org/.

See also
al_readkey
Returns the next character from the keyboard buffer, in ASCII format.
PROCEDURE al_simulate_keypress (keycode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'simulate_keypress';

Stuffs a key into the keyboard buffer, just as if the user had pressed it. The parameter is in the same format returned by al_readkey.

See also
al_simulate_ukeypress
Stuffs a key into the keyboard buffer, just as if the user had pressed it.
PROCEDURE al_simulate_ukeypress (keycode, scancode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'simulate_ukeypress';

Stuffs a key into the keyboard buffer, just as if the user had pressed it. The parameter is in the same format returned by al_ureadkey.

See also
al_simulate_ukeypress
Stuffs a key into the keyboard buffer, just as if the user had pressed it.
PROCEDURE al_clear_keybuf; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'clear_keybuf';

Empties the keyboard buffer. Usually you want to use this in your program before reading keys to avoid previously buffered keys to be returned by calls to al_readkey or al_ureadkey.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
PROCEDURE al_set_leds (leds: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_leds';

Overrides the state of the keyboard LED indicators. The parameter is a bitmask containing any of the values AL_KB_SCROLOCK_FLAG, AL_KB_NUMLOCK_FLAG, and AL_KB_CAPSLOCK_FLAG, or -1 to restore the default behavior.

Note that the led behaviour cannot be guaranteed on some platforms, some leds might not react, or none at all. Therefore you shouldn't rely only on them to communicate information to the user, just in case it doesn't get through.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_key_led_flag
By default, the capslock, numlock, and scroll-lock keys toggle the keyboard LED indicators when they are pressed.
PROCEDURE al_set_keyboard_rate (key_delay, key_repeat: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_keyboard_rate';

Sets the keyboard repeat rate. Times are given in milliseconds. Passing zero times will disable the key repeat.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_readkey
Returns the next character from the keyboard buffer, in ASCII format.
FUNCTION al_scancode_to_ascii (scancode: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scancode_to_ascii';

Converts the given scancode to an ASCII character for that key (mangling Unicode values), returning the unshifted uncapslocked result of pressing the key, or zero if the key isn't a character-generating key or the lookup can't be done. The lookup cannot be done for keys like the F1-F12 keys or the cursor keys, and some drivers will only return approximate values. Generally, if you want to display the name of a key to the user, you should use the al_scancode_to_name function.

FUNCTION al_scancode_to_name (scancode: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scancode_to_name';

This function returns a string pointer containing the name of they key with the given scancode. This is useful if you e.g. let the user choose a key for some action, and want to display something more meaningful than just the scancode.

See also
al_scancode_to_ascii
Converts the given scancode to an ASCII character for that key (mangling Unicode values), returning the unshifted uncapslocked result of pressing the key, or zero if the key isn't a character-generating key or the lookup can't be done.
FUNCTION al_install_joystick (CONST atype: AL_INT): AL_BOOL; INLINE;

Installs Allegro's joystick handler, and calibrates the centre position values. The type parameter should usually be AL_JOY_TYPE_AUTODETECT, or see the platform specific documentation for a list of the available drivers. You must call this routine before using any other joystick functions, and you should make sure that all joysticks are in the middle position at the time. Example:

  al_textout_centre_ex (al_screen, al_font,
			'Center the joystick and press a key.',
			AL_SCREEN_W DIV 2, SCREEN_H DIV 2, red_color, -1);
  al_readkey;
  IF NOT al_install_joystick (AL_JOY_TYPE_AUTODETECT) THEN
    abort_on_error ('Error initialising joystick!');
   

Returns

True on success. As soon as you have installed the joystick module, you will be able to read the button state and digital (on/off toggle) direction information, which may be enough for some games. If you want to get full analogue input, though, you need to use the al_calibrate_joystick functions to measure the exact range of the inputs.

See also
al_remove_joystick
Removes the joystick handler.
al_num_joysticks
Global variable containing the number of active joystick devices.
al_load_joystick_data
Restores calibration data previously stored by al_save_joystick_data or the setup utility.
al_poll_joystick
The joystick handler is not interrupt driven, so you need to call this function every now and again to update the global position values.
AL_JOY_TYPE_AUTODETECT
Attempts to autodetect your joystick hardware.
alWin
Windows specific stuff.
alUNIX
UNIX and Linux specific stuff.
PROCEDURE al_remove_joystick; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_joystick';

Removes the joystick handler. You don't normally need to bother calling this, because al_exit will do it for you.

See also
al_install_joystick
Installs Allegro's joystick handler, and calibrates the centre position values.
FUNCTION al_calibrate_joystick_name (CONST n: AL_INT): AL_STRptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'calibrate_joystick_name';

Pass the number of the joystick you want to calibrate as the parameter.

Returns

a text description for the next type of calibration that will be done on the specified joystick, or Nil if no more calibration is required.

See also
al_calibrate_joystick
Most joysticks need to be calibrated before they can provide full analogue input.
al_num_joysticks
Global variable containing the number of active joystick devices.
FUNCTION al_calibrate_joystick (n: AL_INT): AL_BOOL; INLINE;

Most joysticks need to be calibrated before they can provide full analogue input. This function performs the next operation in the calibration series for the specified stick, assuming that the joystick has been positioned in the manner described by a previous call to al_calibrate_joystick_name, returning True on success. For example, a simple routine to fully calibrate all the joysticks might look like:

FUNCTION CalibrateJoysticks: BOOLEAN
VAR
  Cnt: INTEGER;
BEGIN
  FOR Cnt := 1 TO al_num_joysticks DO
  BEGIN
    WHILE (al_joy[Cnt - 1].flags AND AL_JOYFLAG_CALIBRATE) <> 0 DO
    BEGIN
      al_textout_ex (..., al_calibrate_joystick_name (Cnt - 1) + ', and press a key', ...);
      al_readkey;
      IF NOT al_calibrate_joystick (i - 1) THEN
      BEGIN
        al_textout_ex (..., 'oops!', ...);
	al_readkey;
	RESULT := FALSE;
	EXIT;
      END;
    END;
  END;
  RESULT := TRUE;
END;
   

Returns

True on success, False if the calibration could not be performed successfully.

See also
al_num_joysticks
Global variable containing the number of active joystick devices.
FUNCTION al_save_joystick_data (CONST filename: AL_STR): AL_BOOL; INLINE;

After all the headache of calibrating the joystick, you may not want to make your poor users repeat the process every time they run your program. Call this function to save the joystick calibration data into the specified configuration file, from which it can later be read by al_load_joystick_data. Pass a Nil filename to write the data to the currently selected configuration file.

Returns

True on success, False if the data could not be saved.

See also
al_calibrate_joystick
Most joysticks need to be calibrated before they can provide full analogue input.
FUNCTION al_load_joystick_data (CONST filename: AL_STR): AL_BOOL;

Restores calibration data previously stored by al_save_joystick_data or the setup utility. This sets up all aspects of the joystick code: you don't even need to call al_install_joystick if you are using this function. Pass an empty filename to read the data from the currently selected configuration file.

Returns

True on success: if it fails the joystick state is undefined and you must reinitialise it from scratch.

See also
al_calibrate_joystick
Most joysticks need to be calibrated before they can provide full analogue input.
FUNCTION al_poll_joystick: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_joystick';

The joystick handler is not interrupt driven, so you need to call this function every now and again to update the global position values.

Returns

False on success or True on failure (usually because no joystick driver was installed).

See also
al_install_joystick
Installs Allegro's joystick handler, and calibrates the centre position values.
al_joy
Global array of joystick state information, which is updated by the al_poll_joystick function.
PROCEDURE al_set_color (idx: AL_INT; VAR p: AL_RGB); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color';

Sets the specified palette entry to the specified AL_RGB triplet. Unlike the other palette functions this doesn't do any retrace synchronisation, so you should call al_vsync before it to prevent snow problems.

See also
al_set_palette
Sets the entire palette of 256 colors.
al_get_color
Retrieves the specified palette entry.
PROCEDURE al_set_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette';

Sets the entire palette of 256 colors. You should provide an array of 256 RGB structures. Unlike al_set_color, there is no need to call al_vsync before this function.

See also
al_get_palette
Retrieves the entire palette of 256 colors.
al_set_color
Sets the specified palette entry to the specified AL_RGB triplet.
al_set_palette_range
Sets the palette entries between aFrom and aTo (inclusive: pass 0 and 255 to set the entire palette).
PROCEDURE al_set_palette_range (VAR p: AL_PALETTE; aFrom, aTo: AL_INT; vsync: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette_range';

Sets the palette entries between aFrom and aTo (inclusive: pass 0 and 255 to set the entire palette). If vsync is True it waits for the vertical retrace, otherwise it sets the colors immediately.

See also
al_set_color
Sets the specified palette entry to the specified AL_RGB triplet.
al_set_palette
Sets the entire palette of 256 colors.
PROCEDURE al_get_color (idx: AL_INT; OUT p: AL_RGB); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color';

Retrieves the specified palette entry.

See also
al_get_palette
Retrieves the entire palette of 256 colors.
al_set_color
Sets the specified palette entry to the specified AL_RGB triplet.
PROCEDURE al_get_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_palette';

Retrieves the entire palette of 256 colors.

See also
al_get_palette_range
Retrieves the palette entries between aFrom and aTo (inclusive: pass 0 and 255 to set the entire palette).
PROCEDURE al_get_palette_range (VAR p: AL_PALETTE; aFrom, aTo: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_palette_range';

Retrieves the palette entries between aFrom and aTo (inclusive: pass 0 and 255 to set the entire palette).

See also
al_get_palette
Retrieves the entire palette of 256 colors.
PROCEDURE al_fade_interpolate (VAR source, dest, aOutput: AL_PALETTE; aPos, aFrom, aTo: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_interpolate';

Calculates a temporary palette part way between source and dest, returning it in the aOutput parameter. The position between the two extremes is specified by the pos value: 0 returns an exact copy of source, 64 returns dest, 32 returns a palette half way between the two, etc. This routine only affects colors between aFrom and aTo (inclusive: pass 0 and 255 to interpolate the entire palette).

See also
al_fade_in
Gradually fades from a black screen to the specified palette.
al_fade_out
Gradually fades from the current palette to a black screen.
al_fade_from
Gradually fades from the source palette to the dest palette.
PROCEDURE al_fade_from_range (VAR source, dest: AL_PALETTE; speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from_range';

Gradually fades a part of the palette from the source palette to the dest palette. The speed is from 1 (the slowest) up to 64 (instantaneous). This routine only affects colors between from and ato (inclusive: pass 0 and 255 to fade the entire palette).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_from
Gradually fades from the source palette to the dest palette.
PROCEDURE al_fade_in_range (VAR p: AL_PALETTE; speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_in_range';

Gradually fades a part of the palette from a black screen to the specified palette. The speed is from 1 (the slowest) up to 64 (instantaneous). This routine only affects colors between from and ato (inclusive: pass 0 and 255 to fade the entire palette).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_in
Gradually fades from a black screen to the specified palette.
PROCEDURE al_fade_out_range (speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_out_range';

Gradually fades a part of the current palette to the dest palette. The speed is from 1 (the slowest) up to 64 (instantaneous). This routine only affects colors between from and ato (inclusive: pass 0 and 255 to fade the entire palette).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_out
Gradually fades from the current palette to a black screen.
PROCEDURE al_fade_from (VAR source, dest: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from';

Gradually fades from the source palette to the dest palette. The speed is from 1 (the slowest) up to 64 (instantaneous).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_in
Gradually fades from a black screen to the specified palette.
al_fade_out
Gradually fades from the current palette to a black screen.
al_fade_interpolate
Calculates a temporary palette part way between source and dest, returning it in the aOutput parameter.
al_fade_from_range
Gradually fades a part of the palette from the source palette to the dest palette.
PROCEDURE al_fade_in (VAR p: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_in';

Gradually fades from a black screen to the specified palette. The speed is from 1 (the slowest) up to 64 (instantaneous).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_from
Gradually fades from the source palette to the dest palette.
al_fade_out
Gradually fades from the current palette to a black screen.
al_fade_interpolate
Calculates a temporary palette part way between source and dest, returning it in the aOutput parameter.
al_fade_in_range
Gradually fades a part of the palette from a black screen to the specified palette.
PROCEDURE al_fade_out (speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_out';

Gradually fades from the current palette to a black screen. The speed is from 1 (the slowest) up to 64 (instantaneous).

Note that this function will block your game while the fade is in effect, and it won't work right visually if you are not in an 8 bit color depth resolution.

See also
al_fade_from
Gradually fades from the source palette to the dest palette.
al_fade_in
Gradually fades from a black screen to the specified palette.
al_fade_interpolate
Calculates a temporary palette part way between source and dest, returning it in the aOutput parameter.
al_fade_out_range
Gradually fades a part of the current palette to the dest palette.
PROCEDURE al_select_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'select_palette';

Ugly hack for use in various dodgy situations where you need to convert between paletted and truecolor image formats. Sets the internal palette table in the same way as the al_set_palette function, so the conversion will use the specified palette, but without affecting the display hardware in any way. The previous palette settings are stored in an internal buffer, and can be restored by calling al_unselect_palette. If you call al_select_palette again, however, the internal buffer will be overwritten.

PROCEDURE al_unselect_palette; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'unselect_palette';

Restores the palette tables that were in use before the last call to al_select_palette.

PROCEDURE al_generate_332_palette (VAR p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'generate_332_palette';

Constructs a fake truecolor palette, using three bits for red and green and two for the blue. The al_load_bitmap function fills the palette parameter with this if the file does not contain a palette itself (ie. you are reading a truecolor bitmap).

See also
al_generate_optimized_palette
Generates a 256-color palette suitable for making a reduced color version of the specified truecolor image.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
FUNCTION al_generate_optimized_palette (image: AL_BITMAPptr; VAR pal: AL_PALETTE; VAR rsvdcols: ARRAY OF AL_CHAR): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'generate_optimized_palette';

Generates a 256-color palette suitable for making a reduced color version of the specified truecolor image.

Parameters
image
The trucolor image to convert.
pal
The generated palette.
rsvdcols
points to a table indicating which colors it is allowed to modify: zero for free colors which may be set to whatever the optimiser likes, negative values for reserved colors which cannot be used, and positive values for fixed palette entries that must not be changed, but can be used in the optimisation.
Returns

the number of different colors recognised in the provided bitmap, zero if the bitmap is not a truecolor image or there wasn't enough memory to perform the operation, and negative if there was any internal error in the color reduction code.

See also
al_generate_332_palette
Constructs a fake truecolor palette, using three bits for red and green and two for the blue.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
PROCEDURE al_create_rgb_table (VAR table: AL_RGB_MAP; VAR pal: AL_PALETTE; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_rgb_table';

Fills the specified RGB mapping table with lookup data for the specified palette. If the callback function is not Nil, it will be called 256 times during the calculation, allowing you to display a progress indicator.

PROCEDURE al_hsv_to_rgb (h, s, v: AL_FLOAT; OUT r, g, b: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'hsv_to_rgb';

Convert color values between the HSV and RGB color spaces. The RGB values range from 0 to 255, hue is from 0 to 360, and saturation and value are from 0 to 1.

See also
al_rgb_to_hsv
Convert color values between the HSV and RGB color spaces.
PROCEDURE al_rgb_to_hsv (r, g, b: AL_INT; OUT h, s, v: AL_FLOAT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rgb_to_hsv';

Convert color values between the HSV and RGB color spaces. The RGB values range from 0 to 255, hue is from 0 to 360, and saturation and value are from 0 to 1.

See also
al_hsv_to_rgb
Convert color values between the HSV and RGB color spaces.
FUNCTION al_bestfit_color (VAR pal: AL_PALETTE; r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'bestfit_color';

Searches the specified palette for the closest match to the requested color, which are specified in the VGA hardware 0-63 format. Normally you should call al_makecol_depth instead, but this lower level function may be useful if you need to use a palette other than the currently selected one, or specifically don't want to use the al_rgb_map lookup table.

Returns

the index of the palette for the closest match to the requested color.

See also
al_makecol8
Converts colors from a hardware independent form (red, green, and blue values ranging 0-255) into 8-bit color index.
FUNCTION al_makecol (r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol';

Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.

Returns

the requested RGB triplet in the current color depth.

See also
al_makeacol
Convert RGBA colors into display dependent pixel formats.
al_makecol8
Converts colors from a hardware independent form (red, green, and blue values ranging 0-255) into 8-bit color index.
al_makecol_depth
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the specified color depth.
AL_RGB_MAP
Stores an rgb map to accelerate conversions.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
FUNCTION al_makecol8 (r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol8';

Converts colors from a hardware independent form (red, green, and blue values ranging 0-255) into 8-bit color index. Converting to an 8-bit color involves searching the palette to find the closest match, which is quite slow unless you have set up an RGB mapping table.

Returns

the requested RGB triplet in the specified color depth.

See also
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
al_makecol_depth
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the specified color depth.
AL_RGB_MAP
Stores an rgb map to accelerate conversions.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
FUNCTION al_makecol_depth (color_depth, r, g, b: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makecol_depth';

Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the specified color depth.

Returns

the requested RGB triplet in the specified color depth.

See also
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
al_makecol_depth
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the specified color depth.
AL_RGB_MAP
Stores an rgb map to accelerate conversions.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
FUNCTION al_makeacol (r, g, b, a: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makeacol';

Convert RGBA colors into display dependent pixel formats. In anything less than a 32-bit mode, these are the same as calling al_makecol or al_makecol_depth, but by using these routines it is possible to create 32-bit color values that contain a true 8 bit alpha channel along with the red, green, and blue components. You should only use RGBA format colors as the input to al_draw_trans_sprite or al_draw_trans_rle_sprite after calling al_set_alpha_blender, rather than drawing them directly to the screen.

Returns

the requested RGBA quadruplet.

FUNCTION al_makeacol_depth (color_depth, r, g, b, a: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'makeacol_depth';

Convert RGBA colors into display dependent pixel formats. In anything less than a 32-bit mode, these are the same as calling al_makecol or al_makecol_depth, but by using these routines it is possible to create 32-bit color values that contain a true 8 bit alpha channel along with the red, green, and blue components. You should only use RGBA format colors as the input to al_draw_trans_sprite or al_draw_trans_rle_sprite after calling al_set_alpha_blender, rather than drawing them directly to the screen.

Returns

the requested RGBA quadruplet.

FUNCTION al_getr (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getr';

Given a color in the format being used by the current video mode, this function extracts the red component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.

See also
al_getr_depth
Given a color in the format being used by the specified color depth, this functions extract the red component (ranging 0-255).
al_getg
Given a color in the format being used by the current video mode, this function extracts the green component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getb
Given a color in the format being used by the current video mode, this function extracts the blue component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_geta
Given a color in the format being used by the current video mode, this function extracts the alpha chanel value (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
FUNCTION al_getg (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getg';

Given a color in the format being used by the current video mode, this function extracts the green component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.

See also
al_getg_depth
Given a color in the format being used by the specified color depth, this functions extract the green component (ranging 0-255).
al_getr
Given a color in the format being used by the current video mode, this function extracts the red component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getb
Given a color in the format being used by the current video mode, this function extracts the blue component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_geta
Given a color in the format being used by the current video mode, this function extracts the alpha chanel value (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
FUNCTION al_getb (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getb';

Given a color in the format being used by the current video mode, this function extracts the blue component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.

See also
al_getb_depth
Given a color in the format being used by the specified color depth, this functions extract the blue component (ranging 0-255).
al_getr
Given a color in the format being used by the current video mode, this function extracts the red component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getg
Given a color in the format being used by the current video mode, this function extracts the green component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_geta
Given a color in the format being used by the current video mode, this function extracts the alpha chanel value (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
FUNCTION al_geta (c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'geta';

Given a color in the format being used by the current video mode, this function extracts the alpha chanel value (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate. The alpha part is only meaningful for 32-bit pixels.

See also
al_geta_depth
Given a color in the format being used by the specified color depth, this functions extract the alpha channel value (ranging 0-255).
al_getr
Given a color in the format being used by the current video mode, this function extracts the red component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getg
Given a color in the format being used by the current video mode, this function extracts the green component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getb
Given a color in the format being used by the current video mode, this function extracts the blue component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
FUNCTION al_getr_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getr_depth';

Given a color in the format being used by the specified color depth, this functions extract the red component (ranging 0-255).

See also
al_getr
Given a color in the format being used by the current video mode, this function extracts the red component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getg_depth
Given a color in the format being used by the specified color depth, this functions extract the green component (ranging 0-255).
al_getb_depth
Given a color in the format being used by the specified color depth, this functions extract the blue component (ranging 0-255).
al_geta_depth
Given a color in the format being used by the specified color depth, this functions extract the alpha channel value (ranging 0-255).
FUNCTION al_getg_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getg_depth';

Given a color in the format being used by the specified color depth, this functions extract the green component (ranging 0-255).

See also
al_getg
Given a color in the format being used by the current video mode, this function extracts the green component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getr_depth
Given a color in the format being used by the specified color depth, this functions extract the red component (ranging 0-255).
al_getb_depth
Given a color in the format being used by the specified color depth, this functions extract the blue component (ranging 0-255).
al_geta_depth
Given a color in the format being used by the specified color depth, this functions extract the alpha channel value (ranging 0-255).
FUNCTION al_getb_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'getb_depth';

Given a color in the format being used by the specified color depth, this functions extract the blue component (ranging 0-255).

See also
al_getb
Given a color in the format being used by the current video mode, this function extracts the blue component (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getr_depth
Given a color in the format being used by the specified color depth, this functions extract the red component (ranging 0-255).
al_getg_depth
Given a color in the format being used by the specified color depth, this functions extract the green component (ranging 0-255).
al_geta_depth
Given a color in the format being used by the specified color depth, this functions extract the alpha channel value (ranging 0-255).
FUNCTION al_geta_depth (color_depth, c: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'geta_depth';

Given a color in the format being used by the specified color depth, this functions extract the alpha channel value (ranging 0-255). The alpha part is only meaningful for 32-bit pixels.

See also
al_geta
Given a color in the format being used by the current video mode, this function extracts the alpha chanel value (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get functions as appropriate.
al_getr_depth
Given a color in the format being used by the specified color depth, this functions extract the red component (ranging 0-255).
al_getg_depth
Given a color in the format being used by the specified color depth, this functions extract the green component (ranging 0-255).
al_getb_depth
Given a color in the format being used by the specified color depth, this functions extract the blue component (ranging 0-255).
FUNCTION al_get_gfx_mode_list (card: AL_INT): AL_GFX_MODE_LISTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode_list';

Attempts to create a list of all the supported video modes for a certain graphics driver, made up from the AL_GFX_MODE_LIST structure. This list of video modes is terminated with an [ 0, 0, 0 ] entry. Note that the card parameter must refer to a real driver. This function fails if you pass AL_GFX_SAFE, AL_GFX_AUTODETECT, or any other "magic" driver.

Returns

A pointer to a list structure of the type AL_GFX_MODE_LIST or Nil if the request could not be satisfied.

See also
al_destroy_gfx_mode_list
Removes the mode list created by al_get_gfx_mode_list from memory.
al_set_gfx_mode
Switches into graphics mode.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
PROCEDURE al_destroy_gfx_mode_list (gfx_mode_list: AL_GFX_MODE_LISTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_gfx_mode_list';

Removes the mode list created by al_get_gfx_mode_list from memory. Use this once you are done with the generated mode list to avoid memory leaks in your program.

See also
al_get_gfx_mode_list
Attempts to create a list of all the supported video modes for a certain graphics driver, made up from the AL_GFX_MODE_LIST structure.
al_set_gfx_mode
Switches into graphics mode.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
PROCEDURE al_set_color_depth (depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color_depth';

Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap. Valid depths are 8 (the default), 15, 16, 24, and 32 bits.

Note that the screen color depth won't change until the next successful call to al_set_gfx_mode.

See also
al_get_color_depth
Returns the current pixel format.
al_set_color_conversion
Specifies how to convert images between the various color depths when reading graphics from external bitmap files or datafiles.
al_desktop_color_depth
Finds out the currently selected desktop color depth.
FUNCTION al_get_color_depth: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color_depth';

Returns the current pixel format. This can be very useful to know in order to write generic functions which select a different code path internally depending on the color depth being used.

Note that the function returns whatever value you may have set previously with al_set_color_depth, which can be different from the current color depth of the al_screen global variable. If you really need to know the color depth of the screen, use al_bitmap_color_depth.

PROCEDURE al_set_color_conversion (mode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color_conversion';

Specifies how to convert images between the various color depths when reading graphics from external bitmap files or datafiles. The mode is a bitmask specifying which types of conversion are allowed. If the appropriate bit is set, data will be converted into the current pixel format (selected by calling the al_set_color_depth function), otherwise it will be left in the same format as the disk file, leaving you to convert it manually before the graphic can be displayed. The default mode is total conversion, so that all images will be loaded in the appropriate format for the current video mode. Valid bit flags are:

          AL_COLORCONV_NONE                // disable all format
                                           // conversions
          AL_COLORCONV_8_TO_15             // expand 8-bit to 15-bit
          AL_COLORCONV_8_TO_16             // expand 8-bit to 16-bit
          AL_COLORCONV_8_TO_24             // expand 8-bit to 24-bit
          AL_COLORCONV_8_TO_32             // expand 8-bit to 32-bit
          AL_COLORCONV_15_TO_8             // reduce 15-bit to 8-bit
          AL_COLORCONV_15_TO_16            // expand 15-bit to 16-bit
          AL_COLORCONV_15_TO_24            // expand 15-bit to 24-bit
          AL_COLORCONV_15_TO_32            // expand 15-bit to 32-bit
          AL_COLORCONV_16_TO_8             // reduce 16-bit to 8-bit
          AL_COLORCONV_16_TO_15            // reduce 16-bit to 15-bit
          AL_COLORCONV_16_TO_24            // expand 16-bit to 24-bit
          AL_COLORCONV_16_TO_32            // expand 16-bit to 32-bit
          AL_COLORCONV_24_TO_8             // reduce 24-bit to 8-bit
          AL_COLORCONV_24_TO_15            // reduce 24-bit to 15-bit
          AL_COLORCONV_24_TO_16            // reduce 24-bit to 16-bit
          AL_COLORCONV_24_TO_32            // expand 24-bit to 32-bit
          AL_COLORCONV_32_TO_8             // reduce 32-bit RGB to 8-bit
          AL_COLORCONV_32_TO_15            // reduce 32-bit RGB to 15-bit
          AL_COLORCONV_32_TO_16            // reduce 32-bit RGB to 16-bit
          AL_COLORCONV_32_TO_24            // reduce 32-bit RGB to 24-bit
          AL_COLORCONV_32A_TO_8            // reduce 32-bit RGBA to 8-bit
          AL_COLORCONV_32A_TO_15           // reduce 32-bit RGBA to 15-bit
          AL_COLORCONV_32A_TO_16           // reduce 32-bit RGBA to 16-bit
          AL_COLORCONV_32A_TO_24           // reduce 32-bit RGBA to 24-bit
          AL_COLORCONV_DITHER_PAL          // dither when reducing to 8-bit
          AL_COLORCONV_DITHER_HI           // dither when reducing to
                                           // hicolor
          AL_COLORCONV_KEEP_TRANS          // keep original transparency
   

For convenience, the following macros can be used to select common combinations of these flags:

          AL_COLORCONV_EXPAND_256          // expand 256-color to hi/truecolor
          AL_COLORCONV_REDUCE_TO_256       // reduce hi/truecolor to 256-color
          AL_COLORCONV_EXPAND_15_TO_16     // expand 15-bit hicolor to 16-bit
          AL_COLORCONV_REDUCE_16_TO_15     // reduce 16-bit hicolor to 15-bit
          AL_COLORCONV_EXPAND_HI_TO_TRUE   // expand 15/16-bit to 24/32-bit
          AL_COLORCONV_REDUCE_TRUE_TO_HI   // reduce 24/32-bit to 15/16-bit
          AL_COLORCONV_24_EQUALS_32        // convert between 24- and 32-bit
          AL_COLORCONV_TOTAL               // everything to current format
          AL_COLORCONV_PARTIAL             // convert 15 <-> 16-bit and
                                           // 24 <-> 32-bit
          AL_COLORCONV_MOST                // all but hi/truecolor <-> 256
          AL_COLORCONV_DITHER              // dither during all color reductions
          AL_COLORCONV_KEEP_ALPHA          // convert everything to current format
                                           // unless it would lose alpha information
   

If you enable the AL_COLORCONV_DITHER flag, dithering will be performed whenever truecolor graphics are converted into a hicolor or paletted format, including by the al_blit function, and any automatic conversions that take place while reading graphics from disk. This can produce much better looking results, but is obviously slower than a direct conversion.

If you intend using converted bitmaps with functions like al_masked_blit or al_draw_sprite, you should specify the AL_COLORCONV_KEEP_TRANS flag. It will ensure that the masked areas in the bitmap before and after the conversion stay exactly the same, by mapping transparent colors to each other and adjusting colors which would be converted to the transparent color otherwise. It affects every al_blit operation between distinct pixel formats and every automatic conversion.

See also
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_load_bitmap
Loads a bitmap from a file.
al_load_datafile
Loads a datafile into memory in one go.
al_get_color_conversion
Returns the current color conversion mode.
FUNCTION al_get_color_conversion: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_color_conversion';

Returns the current color conversion mode.

See also
al_set_color_conversion
Specifies how to convert images between the various color depths when reading graphics from external bitmap files or datafiles.
PROCEDURE al_request_refresh_rate (rate: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'request_refresh_rate';

Requests that the next call to al_set_gfx_mode try to use the specified refresh rate, if possible. Not all drivers are able to control this at all, and even when they can, not all rates will be possible on all hardware, so the actual settings may differ from what you requested. After you call al_set_gfx_mode, you can use al_get_refresh_rate to find out what was actually selected. At the moment only some Windows DirectX drivers support this function. The speed is specified in Hz, eg. 60, 70. To return to the normal default selection, pass a rate value of zero.

Example:

     al_request_refresh_rate(60);
     IF  NOT al_set_gfx_mode (AL_GFX_AUTODETECT, 640, 480, 0, 0) THEN
       abort_on_error ('Couldn''t set graphic mode!');
     IF al_get_refresh_rate <> 60 THEN
       abort_on_error ('Couldn''t set refresh rate to 60Hz!

See also
al_set_gfx_mode
Switches into graphics mode.
al_get_refresh_rate
Returns the current refresh rate, if known (not all drivers are able to report this information).
FUNCTION al_get_refresh_rate: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_refresh_rate';

Returns the current refresh rate, if known (not all drivers are able to report this information). Returns zero if the actual rate is unknown.

See also
al_request_refresh_rate
Requests that the next call to al_set_gfx_mode try to use the specified refresh rate, if possible.
FUNCTION al_set_gfx_mode (card, w, h, v_w, v_h: AL_INT): AL_BOOL;

Switches into graphics mode. The card parameter should usually be one of the Allegro magic drivers (read introduction of this unit) or see the platform specific documentation for a list of the available drivers. The w and h parameters specify what screen resolution you want. The color depth of the graphic mode has to be specified before calling this function with al_set_color_depth.

The v_w and v_h parameters specify the minimum virtual screen size, in case you need a large virtual screen for hardware scrolling or page flipping. You should set them to zero if you don't care about the virtual screen size.

When you call al_set_gfx_mode, the v_w and v_h parameters represent the minimum size of virtual screen that is acceptable for your program. The range of possible sizes is usually very restricted, and Allegro may end up creating a virtual screen much larger than the one you request. Allowed sizes are driver dependent and some drivers do not allow virtual screens that are larger than the visible screen at all: don't assume that whatever you pass will always work.

Currently, using a big virtual screen for page flipping is considered bad practice. There are platforms which don't support virtual screens bigger than the physical screen but can create different video pages to flip back and forth. This means that, if you want page flipping and aren't going to use hardware scrolling, you should call al_set_gfx_mode with (0,0) as the virtual screen size and later create the different video pages with al_create_video_bitmap. Otherwise your program will be limited to the platforms supporting hardware scrolling.

After you select a graphics mode, the physical and virtual screen sizes can be checked with the variables AL_SCREEN_W, AL_SCREEN_H, AL_VIRTUAL_W, and AL_VIRTUAL_H.

Returns

True on success. On failure returns False and stores a description of the problem in al_error.

See also
AL_GFX_AUTODETECT
Allegro will try to set the specified resolution with the current color depth in fullscreen mode.
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
al_get_desktop_resolution
Finds out the currently selected desktop resolution.
alUNIX
UNIX and Linux specific stuff.
alWin
Windows specific stuff.
FUNCTION al_scroll_screen (x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scroll_screen';

Requests a hardware scroll request. Attempts to scroll the hardware screen to display a different part of the virtual screen (initially it will be positioned at 0, 0, which is the top left corner). You can use this to move the screen display around in a large virtual screen space, or to page flip back and forth between two non-overlapping areas of the virtual screen. Note that to draw outside the original position in the screen bitmap you will have to alter the clipping rectangle with al_set_clip_rect.

Mode-X scrolling is reliable and will work on any card, other drivers may not work or not work reliably. See the platform-specific section of the docs for more information.

Allegro will handle any necessary vertical retrace synchronisation when scrolling the screen, so you don't need to call al_vsync before it. This means that al_scroll_screen has the same time delay effects as al_vsync.

Returns

False on success, True if the graphics driver can't handle hardware scrolling or the virtual screen is not large enough.

See also
al_set_gfx_mode
Switches into graphics mode.
al_show_video_bitmap
Attempts to page flip the hardware screen to display the specified video bitmap object, which must be the same size as the physical screen, and should have been obtained by calling the al_create_video_bitmap function.
al_request_scroll
Queues a hardware scroll request with triple buffering.
al_request_video_bitmap
Requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace.
FUNCTION al_request_scroll (x, y: AL_INT): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'requests_scroll';

Queues a hardware scroll request with triple buffering. It requests a hardware scroll to the specified position, but returns immediately rather than waiting for a retrace. The scroll will then take place during the next vertical retrace, but you can carry on running other code in the meantime and use the al_poll_scroll routine to detect when the flip has actually taken place.

Triple buffering is only possible with certain drivers: you can look at the AL_GFX_CAN_TRIPLE_BUFFER bit in the al_gfx_capabilities flag to see if it will work with the current driver.

Returns

False on success, True Otherwise.

See also
al_request_video_bitmap
Requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace.
al_scroll_screen
Requests a hardware scroll request.
FUNCTION al_poll_scroll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_scroll';

Checks the status of a scroll request with triple buffering.

Returns

True if it is still waiting to take place, or False if the requested scroll has already happened.

See also
al_request_scroll
Queues a hardware scroll request with triple buffering.
al_request_video_bitmap
Requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace.
FUNCTION al_show_video_bitmap (bmp: AL_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'show_video_bitmap';

Attempts to page flip the hardware screen to display the specified video bitmap object, which must be the same size as the physical screen, and should have been obtained by calling the al_create_video_bitmap function.

Allegro will handle any necessary vertical retrace synchronisation when page flipping, so you don't need to call al_vsync before it. This means that al_show_video_bitmap has the same time delay effects as al_vsync by default. This can be adjusted with the "disable_vsync" config key in the graphics section of allegro.cfg.

Returns

False on success and True on failure.

FUNCTION al_request_video_bitmap (bitmap: AL_BITMAPptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'request_video_bitmap';

Requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace. The flip will then take place during the next vertical retrace, but you can carry on running other code in the meantime and use the al_poll_scroll routine to detect when the flip has actually taken place. Triple buffering is only possible on certain hardware: see the comments about al_request_scroll. Example:

VAR
  CurrentPage: INTEGER;
  VideoPage: ARRAY [0..2] OF AL_BITMAPptr;
BEGIN
  ...
// Create pages for page flipping
  FOR CurrentPage := Low (VideoPage) TO High (VideoPage) DO
    VideoPage[CurrentPage] := al_create_video_bitmap (SCREEN_W, SCREEN_H);
  CurrentPage := Low (VideoPage);
  ...
// draw the screen and flip pages
  DrawScreen (VideoPage[CurrentPage]);
  WHILE al_poll_scroll DO
    ;
  al_request_video_bitmap (VideoPage[CurrentPage]);
  CurrentPage := (CurrentPage + 1) MOD 3;
  ...
END.

Returns

False on success or True on failure.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
al_create_video_bitmap
Allocates a video memory bitmap of the specified size.
al_scroll_screen
Requests a hardware scroll request.
FUNCTION al_enable_triple_buffer: AL_BOOL; INLINE;

Enables triple buffering. If the AL_GFX_CAN_TRIPLE_BUFFER bit of the al_gfx_capabilities field is not set, you can attempt to enable it by calling this function. In particular if you are running in mode-X in a clean DOS environment, this routine will enable the timer retrace simulator, which will activate the triple buffering functions.

Returns

True if triple buffering is enabled, False otherwise.

See also
al_request_scroll
Queues a hardware scroll request with triple buffering.
al_request_video_bitmap
Requests a page flip to display the specified video bitmap object, but returns immediately rather than waiting for a retrace.
FUNCTION al_create_bitmap (w, h: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_bitmap';

Creates a memory bitmap sized w by h. The bitmap will have clipping turned on, and the clipping rectangle set to the full size of the bitmap. The image memory will not be cleared, so it will probably contain garbage: you should clear the bitmap before using it. This routine always uses the global pixel format, as specified by calling al_set_color_depth. The minimum height of the bitmap must be 1 and width can't be negative.

Returns

a pointer to the created bitmap, or Nil if the bitmap could not be created . Remember to free this bitmap later to avoid memory leaks.

See also
al_create_bitmap_ex
Creates a bitmap in a specific color depth (8, 15, 16, 24 or 32 bits per pixel).
al_create_sub_bitmap
Creates a sub-bitmap, ie.
al_create_video_bitmap
Allocates a video memory bitmap of the specified size.
al_create_system_bitmap
Allocates a system memory bitmap of the specified size.
al_destroy_bitmap
Destroys a memory bitmap, sub-bitmap, video memory bitmap, or system bitmap when you are finished with it.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_is_memory_bitmap
Returns True if bmp is a memory bitmap, ie.
al_clear_bitmap
Clears the bitmap to color 0.
FUNCTION al_create_bitmap_ex (bpp, width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_bitmap_ex';

Creates a bitmap in a specific color depth (8, 15, 16, 24 or 32 bits per pixel).

Returns

a pointer to the created bitmap, or Nil if the bitmap could not be created . Remember to free this bitmap later to avoid memory leaks.

See also
al_create_bitmap
Creates a memory bitmap sized w by h.
FUNCTION al_create_sub_bitmap (parent: AL_BITMAPptr; x, y, w, h: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_sub_bitmap';

Creates a sub-bitmap, ie. a bitmap sharing drawing memory with a pre-existing bitmap, but possibly with a different size and clipping settings. When creating a sub-bitmap of the mode-X screen, the x position must be a multiple of four. The sub-bitmap width and height can extend beyond the right and bottom edges of the parent (they will be clipped), but the origin point must lie within the parent region.

Remember to free the sub bitmap before freeing the parent bitmap to avoid memory leaks and potential crashes accessing memory which has been freed.

Returns

a pointer to the created sub bitmap, or Nil if the sub bitmap could not be created.

See also
al_create_bitmap
Creates a memory bitmap sized w by h.
FUNCTION al_create_video_bitmap (width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_video_bitmap';

Allocates a video memory bitmap of the specified size. This can be used to allocate offscreen video memory for storing source graphics ready for a hardware accelerated blitting operation, or to create multiple video memory pages which can then be displayed by calling al_show_video_bitmap. Read the introduction of this chapter for a comparison with other types of bitmaps and other specific details.

Warning: video memory bitmaps are usually allocated from the same space as the screen bitmap, so they may overlap with it; it is therefore not a good idea to use the global screen at the same time as any surfaces returned by this function.

Remember to destroy this bitmap before any subsequent call to al_set_gfx_mode.

Returns

a pointer to the bitmap on success, or Nil if you have run out of video ram.

See also
al_create_bitmap
Creates a memory bitmap sized w by h.
al_screen
Screen bitmap
al_show_video_bitmap
Attempts to page flip the hardware screen to display the specified video bitmap object, which must be the same size as the physical screen, and should have been obtained by calling the al_create_video_bitmap function.
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
al_is_video_bitmap
Returns True if bmp is the screen bitmap, a video memory bitmap, or a sub-bitmap of either.
FUNCTION al_create_system_bitmap (width, height: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_system_bitmap';

Allocates a system memory bitmap of the specified size. Read the introduction of this chapter for a comparison with other types of bitmaps and other specific details.

Remember to destroy this bitmap before any subsequent call to al_set_gfx_mode.

Returns

a pointer to the bitmap on success, Nil otherwise.

See also
al_create_bitmap
Creates a memory bitmap sized w by h.
al_is_system_bitmap
Returns True if bmp is a system bitmap object, or a sub-bitmap of one.
PROCEDURE al_destroy_bitmap (bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_bitmap';

Destroys a memory bitmap, sub-bitmap, video memory bitmap, or system bitmap when you are finished with it. If you pass a Nil pointer this function won't do anything.

The bitmap must not have a mouse cursor shown on it at the time it is destroyed.

See also
al_create_bitmap
Creates a memory bitmap sized w by h.
al_load_bitmap
Loads a bitmap from a file.
al_show_mouse
Tells Allegro to display a mouse pointer on the screen.
PROCEDURE al_set_clip_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_clip_rect';

Each bitmap has an associated clipping rectangle, which is the area of the image that it is OK to draw onto. Nothing will be drawn to positions outside this space. This function sets the clipping rectangle for the specified bitmap. Pass the coordinates of the top-left and bottom-right corners of the clipping rectangle in this order; these are both inclusive, i.e. al_set_clip_rect (bitmap, 16, 16, 32, 32) will allow drawing to (16, 16) and (32, 32), but not to (15, 15) and (33, 33).

Drawing operations will be performed (at least partially) on the bitmap as long as the first coordinates of its clipping rectangle are not greater than the second coordinates and its intersection with the actual image is non-empty. If either condition is not fulfilled, drawing will be turned off for the bitmap, e.g.: al_set_clip_rect (bmp, 0, 0, -1, -1) will disable drawing on bmp.

Note that passing "out-of-bitmap" coordinates is allowed, but they are likely to be altered (and so the coordinates returned by al_get_clip_rect will be different). However, such modifications are guaranteed to preserve the external effect of the clipping rectangle, that is not to modify the actual area of the image that it is OK to draw onto.

See also
al_add_clip_rect
Sets the clipping rectangle of the specified bitmap as the intersection of its current clipping rectangle and the rectangle described by the four coordinates.
al_set_clip_state
Turns on (if state is True) or off (if state is False) clipping for the specified bitmap.
al_get_clip_state
Returns the clipping state.
PROCEDURE al_add_clip_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'add_clip_rect';

Sets the clipping rectangle of the specified bitmap as the intersection of its current clipping rectangle and the rectangle described by the four coordinates.

PROCEDURE al_clear_bitmap (bitmap: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'clear_bitmap';

Clears the bitmap to color 0.

See also
al_clear_to_color
Clears the bitmap to the specified color.
PROCEDURE al_vsync; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'vsync';

Waits for a vertical retrace to begin. The retrace happens when the electron beam in your monitor has reached the bottom of the screen and is moving back to the top ready for another scan. During this short period the graphics card isn't sending any data to the monitor, so you can do things to it that aren't possible at other times, such as altering the palette without causing flickering (snow). Allegro will automatically wait for a retrace before altering the palette or doing any hardware scrolling, though, so you don't normally need to bother with this function.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
al_create_video_bitmap
Allocates a video memory bitmap of the specified size.
FUNCTION al_get_gfx_mode_type (graphics_card: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode_type';

Lets you determine the types of operating modes that a specific graphics card driver operates in. It will tell you whether it is a windowed, fullscreen, definitely windowed or fullscreen, and/or a magic driver.

The value returned is a bitfield consisting of these fields:

  • AL_GFX_TYPE_UNKNOWN

  • AL_GFX_TYPE_WINDOWED

  • AL_GFX_TYPE_FULLSCREEN

  • AL_GFX_TYPE_DEFINITE

  • AL_GFX_TYPE_MAGIC

The return value will only be equivalent to AL_GFX_TYPE_UNKNOWN when it is a driver unrecognized on that platform, or it is a bogus value. Test for the other types by using a bitwise AND. If the driver is windowed or fullscreen, it will also have the definite flag set. For example,

  aGfxType := al_get_gfx_mode_type (AL_GFX_AUTODETECT_WINDOWED);

aGfxType would have the AL_GFX_TYPE_WINDOWED, AL_GFX_TYPE_DEFINITE, and AL_GFX_TYPE_MAGIC flags set.

Allegro needs to be initialized first. Example:

// Accept the use of only windowed drivers in our selection dialog.
  FUNCTION AcceptWindowed (CardId, w, h, ColorDepth: AL_INT): AL_INT;
  BEGIN
    IF (al_get_gfx_mode_type (CardId) AND AL_GFX_TYPE_WINDOWED) <> 0 THEN
      EXIT (0);
    RESULT := -1;
  END;

// In program:
  al_gfx_mode_select_filter (Card, w, h, ColorDepth, @AcceptWindowed);

Parameters
graphics_card
Identifier of the graphics card to check.
Returns

a bitfield describing the graphics mode type.

See also
al_gfx_mode_select_filter
Even more extended version of the graphics mode selection dialog, which allows the programmer to customize the contents of the dialog and the user to select the color depth as well as the resolution and hardware driver.
al_get_gfx_mode
Lets you determine which graphics driver is currently set by allegro.
al_set_gfx_mode
Switches into graphics mode.
al_is_windowed_mode
Tells if you are running in windowed mode.
FUNCTION al_get_gfx_mode: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_gfx_mode';

Lets you determine which graphics driver is currently set by allegro. If no graphics driver is set, it will return AL_GFX_NONE.

Returns

the id of the current graphics driver if there is one, or AL_GFX_NONE if none is set.

See also
al_set_gfx_mode
Switches into graphics mode.
al_is_windowed_mode
Tells if you are running in windowed mode.
FUNCTION al_set_display_switch_mode (mode: AL_INT): AL_BOOL; INLINE;

Sets how the program should handle being switched into the background, if the user tabs away from it. Not all of the possible modes will be supported by every graphics driver on every platform. The available modes are:

  • AL_SWITCH_NONE Disables switching. This is the default in single-tasking systems like DOS. It may be supported on other platforms, but you should use it with caution, because your users won't be impressed if they want to switch away from your program, but you don't let them!

  • AL_SWITCH_PAUSE Pauses the program whenever it is in the background. Execution will be resumed as soon as the user switches back to it. This is the default in most fullscreen multitasking environments, for example the Linux console, but not under Windows.

  • AL_SWITCH_AMNESIA Like AL_SWITCH_PAUSE, but this mode doesn't bother to remember the contents of video memory, so the screen, and any video bitmaps that you have created, will be erased after the user switches away and then back to your program. This is not a terribly useful mode to have, but it is the default for the fullscreen drivers under Windows because DirectDraw is too dumb to implement anything better.

  • AL_SWITCH_BACKGROUND The program will carry on running in the background, with the screen bitmap temporarily being pointed at a memory buffer for the fullscreen drivers. You must take special care when using this mode, because bad things will happen if the screen bitmap gets changed around when your program isn't expecting it (see below).

  • AL_SWITCH_BACKAMNESIA Like SWITCH_BACKGROUND, but this mode doesn't bother to remember the contents of video memory (see AL_SWITCH_AMNESIA). It is again the only mode supported by the fullscreen drivers under Windows that lets the program keep running in the background.

Note that you should be very careful when you are using graphics routines in the switching context: you must always call al_acquire_screen before the start of any drawing code onto the screen and not release it until you are completely finished, because the automatic locking mechanism may not be good enough to work when the program runs in the background or has just been raised in the foreground.

Parameters
mode
The switching mode.
Returns

True on success, invalidating at the same time all callbacks previously registered with al_set_display_switch_callback. False if the requested mode is not currently possible.

See also
al_set_display_switch_callback
Installs a notification callback for the switching mode that was previously selected by calling al_set_display_switch_mode.
al_get_display_switch_mode
Returns the current display switching mode, in the same format passed to al_set_display_switch_mode.
FUNCTION al_get_display_switch_mode: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_display_switch_mode';

Returns the current display switching mode, in the same format passed to al_set_display_switch_mode.

See also
al_set_display_switch_mode
Sets how the program should handle being switched into the background, if the user tabs away from it.
FUNCTION al_set_display_switch_callback (dir: AL_INT; cb: AL_SIMPLE_PROC): AL_BOOL; INLINE;

Installs a notification callback for the switching mode that was previously selected by calling al_set_display_switch_mode. The direction parameter can either be AL_SWITCH_IN or AL_SWITCH_OUT, depending whether you want to be notified about switches away from your program or back to your program. You can sometimes install callbacks for both directions at the same time, but not every platform supports this. You can install several switch callbacks, but no more than eight on any platform.

Parameters
dir
Direction of the notification.
cb
Callback procedure.
Returns

True on success, decreasing the number of empty callback slots by one. False if the request is impossible for the current platform or you have reached the maximum number of allowed callbacks.

See also
al_remove_display_switch_callback
Removes a notification callback that was previously installed by calling al_set_display_switch_callback.
al_set_display_switch_mode
Sets how the program should handle being switched into the background, if the user tabs away from it.
PROCEDURE al_remove_display_switch_callback (cb: AL_SIMPLE_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_display_switch_callback';

Removes a notification callback that was previously installed by calling al_set_display_switch_callback. All the callbacks will automatically be removed when you call al_set_display_switch_mode. You can safely call this function even if the callback you want to remove is not installed.

Parameters
cb
Callback procedure to remove.
See also
al_set_display_switch_callback
Installs a notification callback for the switching mode that was previously selected by calling al_set_display_switch_mode.
FUNCTION al_is_windowed_mode: AL_BOOL; INLINE;

Tells if you are running in windowed mode. You should not call this function if you are not in graphics mode.

Example:

  IF NOT al_set_gfx_mode (AL_GFX_AUTODETECT, 640, 480, 0, 0) THEN
    abort_on_error ('Couldn''t set graphic mode!

Returns

True if the current graphics mode is a windowed mode, or False if it is a fullscreen mode.

See also
al_set_gfx_mode
Switches into graphics mode.
PROCEDURE al_clear_to_color (bitmap: AL_BITMAPptr; CONST color: AL_INT); INLINE;

Clears the bitmap to the specified color.

See also
al_clear_bitmap
Clears the bitmap to color 0.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
FUNCTION al_bitmap_color_depth (CONST bmp: AL_BITMAPptr): AL_INT; INLINE;

Returns the color depth of the specified bitmap (8, 15, 16, 24, or 32).

See also
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_bitmap_mask_color
Returns the mask color for the specified bitmap (the value which is skipped when drawing sprites).
FUNCTION al_bitmap_mask_color (CONST bmp: AL_BITMAPptr): AL_INT; INLINE;

Returns the mask color for the specified bitmap (the value which is skipped when drawing sprites). For 256-color bitmaps this is zero, and for truecolor bitmaps it is bright pink (maximum red and blue, zero green). A frequent use of this function is to clear a bitmap with the mask color so you can later use this bitmap with al_draw_sprite after drawing other stuff on it.

See also
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_bitmap_color_depth
Returns the color depth of the specified bitmap (8, 15, 16, 24, or 32).
FUNCTION al_is_same_bitmap (CONST bmp1, bmp2: AL_BITMAPptr): AL_BOOL;

Returns True if the two bitmaps describe the same drawing surface, ie. the pointers are equal, one is a sub-bitmap of the other, or they are both sub-bitmaps of a common parent.

See also
al_create_sub_bitmap
Creates a sub-bitmap, ie.
FUNCTION al_is_memory_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns True if bmp is a memory bitmap, ie. it was created by calling al_create_bitmap or loaded from a grabber datafile or image file.

FUNCTION al_is_screen_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns True if bmp is the screen bitmap, or a sub-bitmap of the screen.

See also
al_screen
Screen bitmap
al_create_sub_bitmap
Creates a sub-bitmap, ie.
FUNCTION al_is_video_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns True if bmp is the screen bitmap, a video memory bitmap, or a sub-bitmap of either.

See also
al_screen
Screen bitmap
al_create_video_bitmap
Allocates a video memory bitmap of the specified size.
al_create_sub_bitmap
Creates a sub-bitmap, ie.
FUNCTION al_is_system_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns True if bmp is a system bitmap object, or a sub-bitmap of one.

See also
al_create_system_bitmap
Allocates a system memory bitmap of the specified size.
al_create_sub_bitmap
Creates a sub-bitmap, ie.
FUNCTION al_is_sub_bitmap (CONST bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns True if bmp is a sub-bitmap.

See also
al_create_sub_bitmap
Creates a sub-bitmap, ie.
PROCEDURE al_acquire_bitmap (bmp: AL_BITMAPptr); INLINE;

Acquires the specified video bitmap prior to drawing onto it. You never need to call the function explicitly as it is low level, and will only give you a speed up if you know what you are doing. Using it wrongly may cause slowdown, or even lock up your program.

Note: You do never need to use al_acquire_bitmap on a memory bitmap, i.e. a normal bitmap created with al_create_bitmap. It will simply do nothing in that case.

It still can be useful, because e.g. under the current DirectDraw driver of Allegro, most drawing functions need to lock a video bitmap before drawing to it. But doing this is very slow, so you will get much better performance if you acquire the screen just once at the start of your main redraw function, then call multiple drawing operations which need the bitmap locked, and only release it when done.

Multiple acquire calls may be nested, but you must make sure to match up the acquire_bitmap and al_release_bitmap calls. Be warned that DirectX and X11 programs activate a mutex lock whenever a surface is locked, which prevents them from getting any input messages, so you must be sure to release all your bitmaps before using any timer, keyboard, or other non-graphics routines!

Note that if you are using hardware accelerated VRAM->VRAM functions, you should not call al_acquire_bitmap. Such functions need an unlocked target bitmap under DirectX, so there is now just the opposite case from before - if the bitmap is already locked with al_acquire_bitmap, the drawing operation has to unlock it.

Note: For backwards compatibility, the unlocking behavior of such functions is permanent. That is, if you call al_acquire_bitmap first, then call e.g. an accelerated blit, the DirectX bitmap will be unlocked internally (it won't affect the nesting counter of acquire/release calls).

There is no clear cross-platform way in this Allegro version to know which drawing operations need a locked/unlocked state. For example a normal rectfill most probably is accelerated under DirectX, and therefore needs the screen unlocked, but an XOR rectfill, or one with blending activated, most probably is not, and therefore locks the screen. And while the DirectX driver will do automatic unlocking, there is no such thing under X11, where the function is used to synchronize X11 calls from different threads. Your best bet is to never use al_acquire_bitmap - changes are you are doing something in the wrong way if you think you need it.

Warning: This function can be very dangerous to use, since the whole program may get locked while the bitmap is locked. So the lock should only be held for a short time, and you should not call anything but drawing operations onto the locked video bitmap while a lock is in place. Especially don't call things like al_show_mouse (or al_scare_mouse which calls that) or al_readkey, since it will most likely deadlock your entire program.

See also
al_acquire_screen
Shortcut version of al_acquire_bitmap (screen);
al_release_screen
Shortcut version of al_release_bitmap (screen);
PROCEDURE al_release_bitmap (bmp: AL_BITMAPptr); INLINE;

Releases a bitmap that was previously locked by calling al_acquire_bitmap. If the bitmap was locked multiple times, you must release it the same number of times before it will truly be unlocked.

See also
al_acquire_screen
Shortcut version of al_acquire_bitmap (screen);
al_release_screen
Shortcut version of al_release_bitmap (screen);
PROCEDURE al_acquire_screen; INLINE;

Shortcut version of al_acquire_bitmap (screen);

See also
al_acquire_bitmap
Acquires the specified video bitmap prior to drawing onto it.
PROCEDURE al_release_screen; INLINE;

Shortcut version of al_release_bitmap (screen);

See also
al_release_bitmap
Releases a bitmap that was previously locked by calling al_acquire_bitmap.
PROCEDURE al_get_clip_rect (bmp: AL_BITMAPptr; VAR x1, y1, x2, y2: AL_INT); INLINE;

Returns the clipping rectangle for the specified bitmap.

See also
al_set_clip_rect
Each bitmap has an associated clipping rectangle, which is the area of the image that it is OK to draw onto.
al_add_clip_rect
Sets the clipping rectangle of the specified bitmap as the intersection of its current clipping rectangle and the rectangle described by the four coordinates.
al_get_clip_state
Returns the clipping state.
PROCEDURE al_set_clip_state (bmp: AL_BITMAPptr; state: AL_BOOL); INLINE;

Turns on (if state is True) or off (if state is False) clipping for the specified bitmap. Turning clipping off may slightly speed up some drawing operations (usually a negligible difference, although every little helps) but will result in your program dying a horrible death if you try to draw beyond the edges of the bitmap.

See also
al_set_clip_rect
Each bitmap has an associated clipping rectangle, which is the area of the image that it is OK to draw onto.
al_get_clip_rect
Returns the clipping rectangle for the specified bitmap.
al_add_clip_rect
Sets the clipping rectangle of the specified bitmap as the intersection of its current clipping rectangle and the rectangle described by the four coordinates.
al_get_clip_state
Returns the clipping state.
FUNCTION al_get_clip_state (bmp: AL_BITMAPptr): AL_BOOL; INLINE;

Returns the clipping state.

See also
al_get_clip_rect
Returns the clipping rectangle for the specified bitmap.
al_add_clip_rect
Sets the clipping rectangle of the specified bitmap as the intersection of its current clipping rectangle and the rectangle described by the four coordinates.
al_set_clip_state
Turns on (if state is True) or off (if state is False) clipping for the specified bitmap.
FUNCTION al_load_bitmap (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bitmap';

Loads a bitmap from a file. The palette data will be stored in the second parameter, which should be an AL_PALETTE structure. At present this function supports BMP, LBM, PCX, and TGA files, determining the type from the file extension.

If the file contains a truecolor image, you must set the video mode or call al_set_color_conversion before loading it. In this case, if the destination color depth is 8-bit, the palette will be generated by calling al_generate_optimized_palette on the bitmap; otherwise, the returned palette will be generated by calling al_generate_332_palette

The pal argument may be Nil. In this case, the palette data are simply not returned. Additionally, if the file is a truecolor image and the destination color depth is 8-bit, the color conversion process will use the current palette instead of generating an optimized one.

Example:

VAR
  bmp: AL_BITMAPptr;
  palette: AL_PALETTE;
          ...
  bmp := al_load_bitmap ('image.pcx', @palette);
  IF bmp = NIL THEN
    abort_on_error ('Could not load image.pcx!');
          ...
 al_destroy_bitmap (bmp);

See also
al_load_bmp
Loads an 8-bit, 16-bit, 24-bit or 32-bit Windows or OS/2 BMP file.
al_load_pcx
Loads a 256-color or 24-bit truecolor PCX file.
al_load_tga
Loads a 256-color, 15-bit hicolor, 24-bit truecolor, or 32-bit truecolor+alpha TGA file.
al_load_lbm
Loads a 256-color IFF ILBM/PBM file.
al_save_bitmap
Writes a bitmap into a file, using the specified palette, which should be an AL_PALETTE structure.
FUNCTION al_load_bmp (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bmp';

Loads an 8-bit, 16-bit, 24-bit or 32-bit Windows or OS/2 BMP file. Remember that you are responsible for destroying the bitmap when you are finished with it to avoid memory leaks.

Returns

a pointer to the bitmap or Nil on error.

See also
al_load_bitmap
Loads a bitmap from a file.
al_load_bmp_pf
A version of al_load_bmp which reads a BMP file from a packfile.
FUNCTION al_load_lbm (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_lbm';

Loads a 256-color IFF ILBM/PBM file. Remember that you are responsible for destroying the bitmap when you are finished with it to avoid memory leaks.

Returns

a pointer to the bitmap or Nil on error.

See also
al_load_bitmap
Loads a bitmap from a file.
FUNCTION al_load_pcx (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_pcx';

Loads a 256-color or 24-bit truecolor PCX file. Remember that you are responsible for destroying the bitmap when you are finished with it to avoid memory leaks.

Returns

a pointer to the bitmap or Nil on error.

See also
al_load_bitmap
Loads a bitmap from a file.
al_load_pcx_pf
A version of al_load_pcx which reads a PCX file from a packfile.
FUNCTION al_load_tga (filename: AL_STR; pal: AL_PALETTEptr): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_tga';

Loads a 256-color, 15-bit hicolor, 24-bit truecolor, or 32-bit truecolor+alpha TGA file. Remember that you are responsible for destroying the bitmap when you are finished with it to avoid memory leaks.

Returns

a pointer to the bitmap or Nil on error.

See also
al_load_bitmap
Loads a bitmap from a file.
al_load_tga_pf
A version of al_load_tga which reads a TGA file from a packfile.
FUNCTION al_save_bitmap (filename: STRING; bmp: AL_BITMAPptr; pal: AL_PALETTEptr): AL_BOOL; INLINE;

Writes a bitmap into a file, using the specified palette, which should be an AL_PALETTE structure. The output format is determined from the filename extension: at present this function supports BMP, PCX and TGA formats.

Two things to watch out for: on some video cards it may be faster to copy the screen to a memory bitmap and save the latter, and if you use this to dump the screen into a file you may end up with an image much larger than you were expecting, because Allegro often creates virtual screens larger than the visible screen. You can get around this by using a sub-bitmap to specify which part of the screen to save, eg:

VAR
  bmp: AL_BITMAPptr;
  palette: AL_PALETTE;
          ...
  al_get_palette (palette);
  bmp := al_create_sub_bitmap (al_screen, 0, 0, AL_SCREEN_W, AL_SCREEN_H);
  al_save_bitmap ('dump.pcx', bmp, @palette);
  al_destroy_bitmap (bmp);

Parameters
filename
Where to save the bitmap.
bmp
Bitmap to be saved.
pal
Palette of bitmap or Nil if none is used (i.e. true color bitmap).
Returns

True on success, False on failure.

FUNCTION al_save_bmp (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;

Writes a bitmap into a 256-color or 24-bit truecolor BMP file.

Returns

non-zero on error.

See also
al_save_bitmap
Writes a bitmap into a file, using the specified palette, which should be an AL_PALETTE structure.
al_save_bmp_pf
A version of al_save_bmp which reads a BMP file from a packfile.
FUNCTION al_save_pcx (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;

Writes a bitmap into a 256-color or 24-bit truecolor PCX file.

See also
al_save_bitmap
Writes a bitmap into a file, using the specified palette, which should be an AL_PALETTE structure.
al_save_pcx_pf
A version of al_save_pcx which reads a PCX file from a packfile.
FUNCTION al_save_tga (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): AL_BOOL; INLINE;

Writes a bitmap into a 256-color, 15-bit hicolor, 24-bit truecolor, or 32-bit truecolor+alpha TGA file.

See also
al_save_bitmap
Writes a bitmap into a file, using the specified palette, which should be an AL_PALETTE structure.
al_save_tga_pf
A version of al_save_tga which reads a TGA file from a packfile.
FUNCTION al_install_mouse: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'install_mouse';

Installs the Allegro mouse handler. You must do this before using any other mouse functions.

Returns

-1 on failure, zero if the mouse handler is already installed (in which case this function does nothing) or the number of buttons on the mouse if the mouse handler has successfully been installed (ie. this is the first time a handler is installed or you have removed the previous one).

Note that the number of mouse buttons returned by this function is more an indication than a physical reality. With most devices there is no way of telling how many buttons there are, and any user can override the number of mouse buttons returned by this function with a custom configuration file and the variable num_buttons. Even if this value is overridden by the user, the global mouse variables will still report whatever the hardware is sending.

PROCEDURE al_remove_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_mouse';

Removes the mouse handler. You don't normally need to bother calling this, because al_exit will do it for you.

FUNCTION al_poll_mouse: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_mouse';

Wherever possible, Allegro will read the mouse input asynchronously (ie. from inside an interrupt handler), but on some platforms that may not be possible, in which case you must call this routine at regular intervals to update the mouse state variables. To help you test your mouse polling code even if you are programming on a platform that doesn't require it, after the first time that you call this function Allegro will switch into polling mode, so from that point onwards you will have to call this routine in order to get any mouse input at all, regardless of whether the current driver actually needs to be polled or not.

Returns

False on success, or True on failure (ie. no mouse driver installed).

See also
al_mouse_needs_poll
Returns True if the current mouse driver is operating in polling mode.
al_install_mouse
Installs the Allegro mouse handler.
FUNCTION al_mouse_needs_poll: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_needs_poll';

Returns True if the current mouse driver is operating in polling mode.

See also
al_poll_mouse
Wherever possible, Allegro will read the mouse input asynchronously (ie.
al_install_mouse
Installs the Allegro mouse handler.
PROCEDURE al_enable_hardware_cursor; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'enable_hardware_cursor';

After calling this function, Allegro will let the operating system draw the mouse cursor instead of doing it itself. This is not possible with all graphics drivers though: you'll need to check the al_gfx_capabilities flags after calling al_show_mouse to see if this works. On some platforms, enabling the hardware cursor causes al_get_mouse_mickeys to return only a limited range of values, so you should not call this function if you need mouse mickeys.

See also
al_set_mouse_sprite
You don't like Allegro's mouse pointer? No problem.
al_disable_hardware_cursor
After calling this function, Allegro will be responsible for drawing the mouse cursor rather than the operating system.
al_show_mouse
Tells Allegro to display a mouse pointer on the screen.
PROCEDURE al_disable_hardware_cursor; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'disable_hardware_cursor';

After calling this function, Allegro will be responsible for drawing the mouse cursor rather than the operating system. On some platforms calling al_enable_hardware_cursor makes the return values of al_get_mouse_mickeys unreliable. After calling this function, al_get_mouse_mickeys returns reliable results again.

PROCEDURE al_show_mouse (bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'show_mouse';

Tells Allegro to display a mouse pointer on the screen. This will only work if the timer module has been installed. The mouse pointer will be drawn onto the specified bitmap, which should normally be al_screen (see later for information about bitmaps). To hide the mouse pointer, call al_show_mouse (Nil).

Warning: if you draw anything onto the screen while the pointer is visible, a mouse movement interrupt could occur in the middle of your drawing operation. If this happens the mouse buffering and graphics drawing code will get confused and will leave 'mouse droppings' all over the screen. To prevent this, you must make sure you turn off the mouse pointer whenever you draw onto the screen. This is not needed if you are using a hardware cursor.

Note: you must not be showing a mouse pointer on a bitmap at the time that the bitmap is destroyed with al_destroy_bitmap, e.g. call al_show_mouse (Nil); before destroying the bitmap. This does not apply to al_screen since you never destroy al_screen with al_destroy_bitmap.

See also
al_scare_mouse
Helper for hiding the mouse pointer prior to a drawing operation.
PROCEDURE al_scare_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scare_mouse';

Helper for hiding the mouse pointer prior to a drawing operation. This will temporarily get rid of the pointer, but only if that is really required (ie. the mouse is visible, and is displayed on the physical screen rather than some other memory surface, and it is not a hardware or OS cursor). The previous mouse state is stored for subsequent calls to al_unscare_mouse.

See also
al_show_mouse
Tells Allegro to display a mouse pointer on the screen.
al_scare_mouse_area
Like al_scare_mouse, but will only hide the cursor if it is inside the specified rectangle.
PROCEDURE al_scare_mouse_area (x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'scare_mouse_area';

Like al_scare_mouse, but will only hide the cursor if it is inside the specified rectangle. Otherwise the cursor will simply be frozen in place until you call al_unscare_mouse, so it cannot interfere with your drawing.

PROCEDURE al_unscare_mouse; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'unscare_mouse';

Undoes the effect of a previous call to al_scare_mouse or al_scare_mouse_area, restoring the original pointer state.

See also
al_show_mouse
Tells Allegro to display a mouse pointer on the screen.
PROCEDURE al_position_mouse (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse';

Moves the mouse to the specified screen position. It is safe to call even when a mouse pointer is being displayed.

See also
al_position_mouse_z
Sets the mouse wheel position variable to the specified value.
al_position_mouse_w
Sets the horizontal mouse wheel position variable to the specified value.
PROCEDURE al_position_mouse_z (z: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse_z';

Sets the mouse wheel position variable to the specified value.

See also
al_position_mouse
Moves the mouse to the specified screen position.
PROCEDURE al_position_mouse_w (w: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'position_mouse_w';

Sets the horizontal mouse wheel position variable to the specified value.

See also
al_position_mouse
Moves the mouse to the specified screen position.
PROCEDURE al_select_mouse_cursor (cursor: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'select_mouse_cursor';

This function allows you to use the operating system's native mouse cursors rather than some custom cursor. You will need to enable this functionality by calling al_enable_hardware_cursor beforehand. If the operating system does not support this functionality, or if it has not been enabled, then Allegro will substitute its own cursor images. You can change these substitute images using al_set_mouse_cursor_bitmap.

Note that the effects of this function are not apparent until al_show_mouse is called.

To know whether the operating system's native cursor is being used, or if Allegro has made a substitution, you can check the AL_GFX_SYSTEM_CURSOR flag in al_gfx_capabilities after calling al_show_mouse.

The cursor argument selects the type of cursor to be displayed: AL_MOUSE_CURSOR_NONE, AL_MOUSE_CURSOR_ALLEGRO, AL_MOUSE_CURSOR_ARROW, AL_MOUSE_CURSOR_BUSY, AL_MOUSE_CURSOR_QUESTION, AL_MOUSE_CURSOR_EDIT

PROCEDURE al_set_mouse_cursor_bitmap (cursor: AL_INT; bmp: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_cursor_bitmap';

This function changes the cursor image Allegro uses if al_select_mouse_cursor is called but no native operating system cursor can be used, e.g. because you did not call al_enable_hardware_cursor.

The effect of this function will not be apparent until al_show_mouse is called.

Parameters
cursor
one of: AL_MOUSE_CURSOR_ALLEGRO, AL_MOUSE_CURSOR_ARROW, AL_MOUSE_CURSOR_BUSY, AL_MOUSE_CURSOR_QUESTION, AL_MOUSE_CURSOR_EDIT but not AL_MOUSE_CURSOR_NONE.
bmp
can either point to a valid bitmap or it can be Nil. Passing a bitmap makes Allegro use that image in place of its own default substitution (should the operating system's native cursor be unavailable). The bitmap must remain available for the duration in which it could be used. Passing Nil lets Allegro revert to its default substitutions.
PROCEDURE al_set_mouse_sprite_focus (x, y: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_sprite_focus';

The mouse focus is the bit of the pointer that represents the actual mouse position, ie. the (al_mouse_x, al_mouse_y) position. By default this is the top left corner of the arrow, but if you are using a different mouse pointer you might need to alter it.

See also
al_set_mouse_sprite
You don't like Allegro's mouse pointer? No problem.
PROCEDURE al_get_mouse_mickeys (OUT mickeyx, mickeyy: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mouse_mickeys';

Measures how far the mouse has moved since the last call to this function. The values of mickeyx and mickeyy will become negative if the mouse is moved left or up, respectively. The mouse will continue to generate movement mickeys even when it reaches the edge of the screen, so this form of input can be useful for games that require an infinite range of mouse movement.

Note that the infinite movement may not work in windowed mode, since under some platforms the mouse would leave the window, and may not work at all if the hardware cursor is in use.

PROCEDURE al_set_mouse_sprite (sprite: AL_BITMAPptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mouse_sprite';

You don't like Allegro's mouse pointer? No problem. Use this function to supply an alternative of your own. If you change the pointer and then want to get Allegro's lovely arrow back again, call al_set_mouse_sprite (Nil).

As a bonus, al_set_mouse_sprite (Nil) uses the current palette in choosing colors for the arrow. So if your arrow mouse sprite looks ugly after changing the palette, call al_set_mouse_sprite (Nil).

See also
al_show_mouse
Tells Allegro to display a mouse pointer on the screen.
al_set_mouse_sprite_focus
The mouse focus is the bit of the pointer that represents the actual mouse position, ie.
FUNCTION al_show_os_cursor (cursor: AL_INT): AL_BOOL; INLINE;

In case you do not need Allegro's mouse cursor API, which automatically emulates a cursor in software if no other cursor is available, you can use this low level function to try to display or hide the system cursor directly. The cursor parameter takes the same values as al_select_mouse_cursor. This function is very similar to calling al_enable_hardware_cursor, al_select_mouse_cursor and al_show_mouse, but will not try to do anything if no system cursor is available.

The most common use for this function is to just call it once at the beginning of the program to tell it to display the system cursor inside the Allegro window. The return value can be used to see if this succeeded or not. On some systems (e.g. DirectX fullscreen) this is not supported and the function will always fail, and in other cases only some of the cursors will work, or in the case of AL_MOUSE_CURSOR_ALLEGRO, only certain bitmap sizes may be supported.

You never should use al_show_os_cursor together with the function al_show_mouse and other functions affecting it (al_select_mouse_cursor, al_enable_hardware_cursor, al_disable_hardware_cursor, al_scare_mouse, al_unscare_mouse). They implement the standard high level mouse API, and don't work together with this low level function.

Returns

True if a system cursor is being displayed after the function returns, or False otherwise.

FUNCTION al_mouse_on_screen: AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_on_screen';

Tells you whether the mouse pointer is currently on screen.

This function can be useful to prevent having two mouse pointers on the screen at the same time when running your program in windowed mode and drawing the mouse pointer yourself. Other possible uses include the ability to pause your game when the mouse goes off of the window, or only scrolling the view when the pointer is near the edge of the window, but not while off of the window.

PROCEDURE al_drawing_mode (mode: AL_INT; pattern: AL_BITMAPptr; x_anchor, y_anchor: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'drawing_mode';

Sets the graphics drawing mode. This only affects the geometric routines like al_putpixel, lines, rectangles, circles, polygons, floodfill, etc, not the text output, blitting, or sprite drawing functions. The mode should be one of the following constants:

With the patterned modes, you provide a pattern bitmap which is tiled across the surface of the shape. Allegro stores a pointer to this bitmap rather than copying it, so you must not destroy the bitmap while it is still selected as the pattern. The width and height of the pattern must be powers of two, but they can be different, eg. a 64x16 pattern is fine, but a 17x3 one is not. The pattern is tiled in a grid starting at point (x_anchor, y_anchor). Normally you should just pass zero for these values, which lets you draw several adjacent shapes and have the patterns meet up exactly along the shared edges. Zero alignment may look peculiar if you are moving a patterned shape around the screen, however, because the shape will move but the pattern alignment will not, so in some situations you may wish to alter the anchor position.

See also
al_xor_mode
This is a shortcut for toggling xor drawing mode on and off.
al_solid_mode
This is a shortcut for selecting solid drawing mode.
al_set_trans_blender
Enables a linear interpolator blender mode for combining translucent or lit truecolor pixels.
al_color_table
Pointer to the color mapping table.
PROCEDURE al_xor_mode (aOn: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'xor_mode';

This is a shortcut for toggling xor drawing mode on and off. Calling al_xor_mode (True) is equivalent to al_drawing_mode (AL_DRAW_MODE_XOR, Nil, 0, 0). Calling al_xor_mode (False) is equivalent to al_drawing_mode (A_DRAW_MODE_SOLID, Nil, 0, 0).

See also
al_drawing_mode
Sets the graphics drawing mode.
PROCEDURE al_solid_mode; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'solid_mode';

This is a shortcut for selecting solid drawing mode. It is equivalent to calling al_drawing_mode (AL_DRAW_MODE_XOR, NIL, 0, 0).

See also
al_drawing_mode
Sets the graphics drawing mode.
PROCEDURE al_do_line (bmp: AL_BITMAPptr; x1, y1, x2, y2, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_line';

Calculates all the points along a line from point (x1, y1) to (x2, y2), calling the supplied function for each one. This will be passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter. Example:

PROCEDURE DrawDustParticle (bmp: AL_BITMAPptr; x, y, d: AL_INT); CDECL;
BEGIN
   ...
END;

  al_do_line (al_screen, 0, 0, AL_SCREEN_W-1, AL_SCREEN_H-2,
              DustStrength, @DrawDustParticle);

See also
al_do_circle
Calculates all the points in a circle around point (x, y) with radius r, calling the supplied function for each one.
al_do_ellipse
Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one.
al_do_arc
Calculates all the points in a circular arc around point (x, y) with radius r, calling the supplied function for each one.
PROCEDURE al_do_circle (bmp: AL_BITMAPptr; x, y, radius, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_circle';

Calculates all the points in a circle around point (x, y) with radius r, calling the supplied function for each one. This will be passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter. Example:

PROCEDURE DrawExplosionRing (bmp: AL_BITMAPptr; x, y, d: AL_INT); CDECL;
BEGIN
   ...
END;

  al_do_circle (al_screen, AL_SCREEN_W DIV 2, AL_SCREEN_H DIV 2,
                AL_SCREEN_H DIV 16, FlameColor, @DrawExplosionRing);

See also
al_do_line
Calculates all the points along a line from point (x1, y1) to (x2, y2), calling the supplied function for each one.
al_do_ellipse
Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one.
al_do_arc
Calculates all the points in a circular arc around point (x, y) with radius r, calling the supplied function for each one.
PROCEDURE al_do_ellipse (bmp: AL_BITMAPptr; x, y, rx, ry, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_ellipse';

Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one. This will be passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter. Example:

PROCEDURE DrawExplosionRing (bmp: AL_BITMAPptr; x, y, d: AL_INT); CDECL;
BEGIN
   ...
END;

  al_do_ellipse (al_screen, AL_SCREEN_W DIV 2, AL_SCREEN_H DIV 2,
                AL_SCREEN_H DIV 16, FlameColor, @DrawExplosionRing);

See also
al_do_line
Calculates all the points along a line from point (x1, y1) to (x2, y2), calling the supplied function for each one.
al_do_circle
Calculates all the points in a circle around point (x, y) with radius r, calling the supplied function for each one.
al_do_arc
Calculates all the points in a circular arc around point (x, y) with radius r, calling the supplied function for each one.
PROCEDURE al_do_arc (bmp: AL_BITMAPptr; x, y: AL_INT; ang1, ang2: AL_FIXED; r, d: AL_INT; proc: AL_POINT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'do_arc';

Calculates all the points in a circular arc around point (x, y) with radius r, calling the supplied function for each one. This will be passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter. The arc will be plotted in an anticlockwise direction starting from the angle a1 and ending when it reaches a2. These values are specified in 16.16 fixed point format, with 256 equal to a full circle, 64 a right angle, etc. Zero is to the right of the centre point, and larger values rotate anticlockwise from there. Example:

PROCEDURE DrawExplosionRing (bmp: AL_BITMAPptr; x, y, d: AL_INT); CDECL;
BEGIN
   ...
END;

  al_do_arc (al_screen, AL_SCREEN_W DIV 2, AL_SCREEN_H DIV 2,
                AL_SCREEN_H DIV 16, FlameColor, @DrawExplosionRing);

See also
al_do_line
Calculates all the points along a line from point (x1, y1) to (x2, y2), calling the supplied function for each one.
al_do_circle
Calculates all the points in a circle around point (x, y) with radius r, calling the supplied function for each one.
al_do_ellipse
Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one.
PROCEDURE al_calc_spline (VAR points: ARRAY OF AL_INT; npts: AL_INT; VAR x, y: ARRAY OF AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'calc_spline';

Calculates a series of npts values along a Bezier spline, storing them in the output x and y arrays.

The Bezier curve is specified by the four x/y control points in the points array: points[0] and points[1] contain the coordinates of the first control point, points[2] and points[3] are the second point, etc. Control points 0 and 3 are the ends of the spline, and points 1 and 2 are guides. The curve probably won't pass through points 1 and 2, but they affect the shape of the curve between points 0 and 3 (the lines p0-p1 and p2-p3 are tangents to the spline). The easiest way to think of it is that the curve starts at p0, heading in the direction of p1, but curves round so that it arrives at p3 from the direction of p2.

In addition to their role as graphics primitives, spline curves can be useful for constructing smooth paths around a series of control points, as in exspline.pp.

See also
al_spline
Draws a Bezier spline using the four control points specified in the points array.
PROCEDURE al_blit (source, dest: AL_BITMAPptr; source_x, source_y, dest_x, dest_y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'blit';

Copies a rectangular area of the source bitmap to the destination bitmap. The source_x and source_y parameters are the top left corner of the area to copy from the source bitmap, and dest_x and dest_y are the corresponding position in the destination bitmap. This routine respects the destination clipping rectangle, and it will also clip if you try to blit from areas outside the source bitmap.

You can blit between any parts of any two bitmaps, even if the two memory areas overlap (ie. source and dest are the same, or one is sub-bitmap of the other). You should be aware, however, that a lot of SVGA cards don't provide separate read and write banks, which means that blitting from one part of the screen to another requires the use of a temporary bitmap in memory, and is therefore extremely slow. As a general rule you should avoid blitting from the screen onto itself in SVGA modes.

If the AL_GFX_HW_VRAM_BLIT bit in the al_gfx_capabilities flag is set, the current driver supports hardware accelerated blits from one part of the screen onto another. This is extremely fast, so when this flag is set it may be worth storing some of your more frequently used graphics in an offscreen portion of the video memory.

Unlike most of the graphics routines, al_blit allows the source and destination bitmaps to be of different color depths, so it can be used to convert images from one pixel format to another. In this case, the behavior is affected by the AL_COLORCONV_KEEP_TRANS and AL_COLORCONV_DITHER* flags of the current color conversion mode.

See also
al_masked_blit
Like al_blit, but skips transparent pixels, which are marked by a zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green), and requires the source and destination bitmaps to be of the same color depth.
al_stretch_blit
Like al_blit, except it can scale images (so the source and destination rectangles don't need to be the same size) and requires the source and destination bitmaps to be of the same color depth.
al_set_color_conversion
Specifies how to convert images between the various color depths when reading graphics from external bitmap files or datafiles.
PROCEDURE al_masked_blit (source, dest: AL_BITMAPptr; source_x, source_y, dest_x, dest_y, width, height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'masked_blit';

Like al_blit, but skips transparent pixels, which are marked by a zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green), and requires the source and destination bitmaps to be of the same color depth. The source and destination regions must not overlap.

If the AL_GFX_HW_VRAM_BLIT_MASKED bit in the al_gfx_capabilities flag is set, the current driver supports hardware accelerated masked blits from one part of the screen onto another. This is extremely fast, so when this flag is set it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.

Warning: if the hardware acceleration flag is not set, al_masked_blit will not work correctly when used with a source image in system or video memory so the latter must be a memory bitmap.

See also
al_masked_stretch_blit
Like al_masked_blit, except it can scale images (so the source and destination rectangles don't need to be the same size).
al_draw_sprite
Draws a copy of the sprite bitmap onto the destination bitmap at the specified position.
al_bitmap_mask_color
Returns the mask color for the specified bitmap (the value which is skipped when drawing sprites).
PROCEDURE al_stretch_blit (source, dest: AL_BITMAPptr; source_x, source_y, source_width, source_height, dest_x, dest_y, dest_width, dest_height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stretch_blit';

Like al_blit, except it can scale images (so the source and destination rectangles don't need to be the same size) and requires the source and destination bitmaps to be of the same color depth. This routine doesn't do as much safety checking as the regular al_blit: in particular you must take care not to copy from areas outside the source bitmap, and you cannot blit between overlapping regions, ie. you must use different bitmaps for the source and the destination. Moreover, the source must be a memory bitmap.

See also
al_masked_stretch_blit
Like al_masked_blit, except it can scale images (so the source and destination rectangles don't need to be the same size).
al_stretch_sprite
Like al_draw_sprite, except it can stretch the sprite image to the specified width and height and requires the sprite image and destination bitmap to be of the same color depth.
PROCEDURE al_masked_stretch_blit (source, dest: AL_BITMAPptr; source_x, source_y, source_width, source_height, dest_x, dest_y, dest_width, dest_height: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'masked_stretch_blit';

Like al_masked_blit, except it can scale images (so the source and destination rectangles don't need to be the same size). This routine doesn't do as much safety checking as the regular al_masked_blit: in particular you must take care not to copy from areas outside the source bitmap. Moreover, the source must be a memory bitmap.

See also
al_blit
Copies a rectangular area of the source bitmap to the destination bitmap.
al_stretch_sprite
Like al_draw_sprite, except it can stretch the sprite image to the specified width and height and requires the sprite image and destination bitmap to be of the same color depth.
PROCEDURE al_stretch_sprite (bmp, sprite: AL_BITMAPptr; x, y, w, h: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stretch_sprite';

Like al_draw_sprite, except it can stretch the sprite image to the specified width and height and requires the sprite image and destination bitmap to be of the same color depth. Moreover, the sprite image must be a memory bitmap.

See also
al_stretch_blit
Like al_blit, except it can scale images (so the source and destination rectangles don't need to be the same size) and requires the source and destination bitmaps to be of the same color depth.
al_bitmap_mask_color
Returns the mask color for the specified bitmap (the value which is skipped when drawing sprites).
PROCEDURE al_rotate_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_trans';

Rotates a sprite.

Draws the sprite image onto the bitmap. It is placed with its top left corner at the specified position, then rotated by the specified angle around its centre. The angle is a fixed point 16.16 number in the same format used by the fixed point trig routines, with 256 equal to a full circle, 64 a right angle, etc. All rotation functions can draw between any two bitmaps, even screen bitmaps or bitmaps of different color depth.

Positive increments of the angle will make the sprite rotate clockwise on the screen, as demonstrated by the Allegro example.

See also
al_draw_trans_sprite
Uses the global al_color_table table or truecolor blender functions to overlay the sprite on top of the existing image.
al_rotate_scaled_sprite_trans
Rotates and stretches a sprite.
al_rotate_sprite_v_flip_trans
Rotates and flips a sprite.
al_rotate_scaled_sprite_v_flip_trans
Rotates and stretches a sprite.
PROCEDURE al_rotate_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_v_flip_trans';

Rotates and flips a sprite.

Like al_rotate_sprite_trans, but flips the image vertically before rotating it. To flip horizontally, use this routine but add al_itofix (128) to the angle. To flip in both directions, use and add al_itofix (128) to its angle.

See also
al_rotate_sprite
Draws the sprite image onto the bitmap.
PROCEDURE al_rotate_scaled_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_trans';

Rotates and stretches a sprite.

Like al_rotate_sprite_trans, but stretches or shrinks the image at the same time as rotating it.

PROCEDURE al_rotate_scaled_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_v_flip_trans';

Rotates and stretches a sprite.

Like al_rotate_scaled_sprite_trans, except that it flips the sprite vertically first.

PROCEDURE al_pivot_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_trans';

Rotates a sprite around a specified point.

Like al_rotate_sprite_trans, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates around this point.

PROCEDURE al_pivot_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_v_flip_trans';

Rotates and flips a sprite around a specified point.

Like al_rotate_sprite_trans, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates around this point.

PROCEDURE al_pivot_scaled_sprite_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_trans';

Rotates and stretches a sprite.

Like al_rotate_scaled_sprite_trans, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates and scales around this point.

PROCEDURE al_pivot_scaled_sprite_v_flip_trans (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_v_flip_trans';

Rotates and stretches a sprite.

Like al_rotate_scaled_sprite_v_flip_trans, but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates and scales around this point.

PROCEDURE al_rotate_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_lit';

Rotates a sprite.

Draws the sprite image onto the bitmap. It is placed with its top left corner at the specified position, then rotated by the specified angle around its centre. The angle is a fixed point 16.16 number in the same format used by the fixed point trig routines, with 256 equal to a full circle, 64 a right angle, etc. All rotation functions can draw between any two bitmaps, even screen bitmaps or bitmaps of different color depth.

PROCEDURE al_rotate_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_sprite_v_flip_lit';

Rotates a sprite.

Like , but flips the image vertically before rotating it. To flip horizontally, use this routine but add al_itofix(128) to the angle. To flip in both directions, use al_rotate_sprite_lit and add al_itofix(128) to its angle.

See also
al_rotate_sprite_lit
Rotates a sprite.
PROCEDURE al_rotate_scaled_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_lit';

Rotates and stretches a sprite.

Like al_rotate_sprite_lit, but stretches or shrinks the image at the same time as rotating it.

PROCEDURE al_rotate_scaled_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rotate_scaled_sprite_v_flip_lit';

Rotates and stretches a sprite.

Draws the sprite, similar to al_rotate_scaled_sprite_lit except that it flips the sprite vertically first.

PROCEDURE al_pivot_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_lit';

Rotates a sprite.

Like al_rotate_sprite_lit, but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates around this point.

PROCEDURE al_pivot_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_sprite_v_flip_lit';

Rotates a sprite.

Like al_rotate_sprite_v_flip_lit, but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates around this point.

PROCEDURE al_pivot_scaled_sprite_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_lit';

Rotates and stretches a sprite.

Like al_rotate_scaled_sprite_lit, but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates and scales around this point.

PROCEDURE al_pivot_scaled_sprite_v_flip_lit (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED; color: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'pivot_scaled_sprite_v_flip_lit';

Rotates and stretches a sprite.

Like al_rotate_scaled_sprite_v_flip_lit, but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates and scales around this point.

FUNCTION al_getpixel (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Reads a pixel from point (x, y) in the bitmap.

Returns

-1 if the point lies outside the bitmap (ignoring the clipping rectangle), otherwise the value of the pixel in the color format of the bitmap.

Warning: -1 is also a valid value for pixels contained in 32-bit bitmaps with alpha channel (when R,G,B,A are all equal to 255) so you can't use the test against -1 as a predicate for such bitmaps. In this cases, the only reliable predicate is check if it is inside the bitmap.

To extract the individual color components, use the al_getr / al_getg / al_getb / al_geta family of functions

See also
al_putpixel
Writes a pixel to the specified position in the bitmap, using the current drawing mode and the bitmap's clipping rectangle.
_al_getpixel
Faster inline version of al_getpixel.
PROCEDURE al_putpixel (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Writes a pixel to the specified position in the bitmap, using the current drawing mode and the bitmap's clipping rectangle.

See also
al_getpixel
Reads a pixel from point (x, y) in the bitmap.
_al_putpixel
Like the regular al_putpixel, but much faster because it's implemented as an inline functions for specific 8 bits color depth.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_vline (bmp: AL_BITMAPptr; x, y1, y2, color: AL_INT); INLINE;

Draws a vertical line onto the bitmap, from point (x, y1) to (x, y2).

See also
al_hline
Draws a horizontal line onto the bitmap, from point (x1, y) to (x2, y).
al_line
Draws a line onto the bitmap, from point (x1, y1) to (x2, y2).
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_hline (bmp: AL_BITMAPptr; x1, y, x2, color: AL_INT); INLINE;

Draws a horizontal line onto the bitmap, from point (x1, y) to (x2, y).

See also
al_vline
Draws a vertical line onto the bitmap, from point (x, y1) to (x, y2).
al_line
Draws a line onto the bitmap, from point (x1, y1) to (x2, y2).
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_line (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT);

Draws a line onto the bitmap, from point (x1, y1) to (x2, y2). .

See also
al_fastline
Faster version of the previous function.
al_polygon
Draws a filled polygon with an arbitrary number of corners.
al_do_line
Calculates all the points along a line from point (x1, y1) to (x2, y2), calling the supplied function for each one.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_fastline (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;

Faster version of the previous function. Note that pixel correctness is not guaranteed for this function.

See also
al_line
Draws a line onto the bitmap, from point (x1, y1) to (x2, y2).
PROCEDURE al_rectfill (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;

Draws a solid, filled rectangle with the two points as its opposite corners.

See also
al_triangle
Draws a filled triangle between the three points.
al_polygon
Draws a filled polygon with an arbitrary number of corners.
al_quad3d
Draw 3D quads, using fixed point vertex structures.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_triangle (bmp: AL_BITMAPptr; x1, y1, x2, y2, x3, y3, color: AL_INT); INLINE;

Draws a filled triangle between the three points.

See also
al_polygon
Draws a filled polygon with an arbitrary number of corners.
al_triangle3d
Draw 3D triangles, using fixed point vertex structures.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_polygon (bmp: AL_BITMAPptr; vertices: AL_INT; CONST points: ARRAY OF AL_INT; color: AL_INT);

Draws a filled polygon with an arbitrary number of corners. Pass the number of vertices and an array containing a series of x, y points (a total of vertices*2 values).

See also
al_triangle
Draws a filled triangle between the three points.
al_polygon3d
Draw 3d polygons onto the specified bitmap, using the specified rendering mode.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2, color: AL_INT); INLINE;

Draws an outline rectangle with the two points as its opposite corners.

See also
al_rectfill
Draws a solid, filled rectangle with the two points as its opposite corners.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_circle (bmp: AL_BITMAPptr; x, y, r, color: AL_INT); INLINE;

Draws a circle with the specified centre and radius.

See also
al_ellipse
Draws an ellipse with the specified centre and radius.
al_circlefill
Draws a filled circle with the specified centre and radius.
al_do_circle
Calculates all the points in a circle around point (x, y) with radius r, calling the supplied function for each one.
al_arc
Draws a circular arc.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_circlefill (bmp: AL_BITMAPptr; x, y, r, color: AL_INT); INLINE;

Draws a filled circle with the specified centre and radius.

See also
al_circle
Draws a circle with the specified centre and radius.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_ellipse (bmp: AL_BITMAPptr; x, y, rx, ry, color: AL_INT); INLINE;

Draws an ellipse with the specified centre and radius.

See also
al_circle
Draws a circle with the specified centre and radius.
al_ellipsefill
Draws a filled ellipse with the specified centre and radius.
al_arc
Draws a circular arc.
al_do_ellipse
Calculates all the points in an ellipse around point (x, y) with radius rx and ry, calling the supplied function for each one.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_ellipsefill (bmp: AL_BITMAPptr; x, y, rx, ry, color: AL_INT); INLINE;

Draws a filled ellipse with the specified centre and radius.

See also
al_ellipse
Draws an ellipse with the specified centre and radius.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_arc (bmp: AL_BITMAPptr; x, y: AL_INT; ang1, ang2: AL_FIXED; r, color: AL_INT); INLINE;

Draws a circular arc.

Draws a circular arc with centre x, y and radius r, in an anticlockwise direction starting from the angle a1 and ending when it reaches a2. These values are specified in 16.16 fixed point format, with 256 equal to a full circle, 64 a right angle, etc. Zero is to the right of the centre point, and larger values rotate anticlockwise from there.

See also
al_circle
Draws a circle with the specified centre and radius.
al_do_arc
Calculates all the points in a circular arc around point (x, y) with radius r, calling the supplied function for each one.
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_spline (bmp: AL_BITMAPptr; CONST points: ARRAY OF AL_INT; color: AL_INT);

Draws a Bezier spline using the four control points specified in the points array. Read the description of al_calc_spline for information on how to build the points array.

See also
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_floodfill (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Floodfills an enclosed area, starting at point (x, y), with the specified color.

See also
al_drawing_mode
Sets the graphics drawing mode.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
PROCEDURE al_draw_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;

Draws a copy of the sprite bitmap onto the destination bitmap at the specified position. This is almost the same as al_blit (sprite, bmp, 0, 0, x, y, spriteˆ.w, spriteˆ.h), but it uses a masked drawing mode where transparent pixels are skipped, so the background image will show through the masked parts of the sprite. Transparent pixels are marked by a zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green). Example:

VAR
  SpaceShip: AL_BITMAPptr;

          ...
  al_draw_sprite (al_screen, SpaceShip, x, y);
  

If the AL_GFX_HW_VRAM_BLIT_MASKED bit in the al_gfx_capabilities flag is set, the current driver supports hardware accelerated sprite drawing when the source image is a video memory bitmap or a sub-bitmap of the screen. This is extremely fast, so when this flag is set it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.

Warning: if the hardware acceleration flag is not set, al_draw_sprite will not work correctly when used with a sprite image in system or video memory so the latter must be a memory bitmap.

Although generally not supporting graphics of mixed color depths, as a special case this function can be used to draw 256-color source images onto truecolor destination bitmaps, so you can use palette effects on specific sprites within a truecolor program.

See also
al_draw_sprite_v_flip
This is like al_draw_sprite, but it additionally flip the image vertically.
al_draw_trans_sprite
Uses the global al_color_table table or truecolor blender functions to overlay the sprite on top of the existing image.
al_draw_lit_sprite
In 256-color modes, uses the global al_color_table table to tint the sprite image to the specified color or to light it to the level specified by 'color', depending on the function which was used to build the table (al_create_trans_table or al_create_light_table), and draws the resulting image to the destination bitmap.
al_draw_gouraud_sprite
More sophisticated version of al_draw_lit_sprite: the color parameter is not constant across the sprite image anymore but interpolated between the four specified corner colors.
al_rotate_sprite
Draws the sprite image onto the bitmap.
al_draw_rle_sprite
Draws an RLE sprite onto a bitmap at the specified position.
PROCEDURE al_draw_sprite_ex (bmp, sprite: AL_BITMAPptr; x, y, mode, flip: AL_INT); INLINE;

Draws the sprite image onto the destination bitmap using the specified mode argument, optionally flipping the sprite in the orientation specified by flip argument.

Parameters
mode
defines how is sprite going to be drawn on the destination bitmap:

flip
defines the flipping orientation:

  • AL_DRAW_SPRITE_NO_FLIP do not perform flipping.

  • AL_DRAW_SPRITE_H_FLIP flip horizontally.

  • AL_DRAW_SPRITE_V_FLIP flip vertically.

  • AL_DRAW_SPRITE_VH_FLIP flip both vertically and horizontally-

PROCEDURE al_draw_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;

This is like al_draw_sprite, but it additionally flip the image vertically. Flipping vertically means that the y-axis is reversed, between the source and the destination. This produces exact mirror images, which is not the same as rotating the sprite (and it is a lot faster than the rotation routine). The sprite must be a memory bitmap.

PROCEDURE al_draw_sprite_h_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;

This is like al_draw_sprite, but it additionally flip the image horizontally. Flipping horizontally means that the x-axis is reversed, between the source and the destination. This produces exact mirror images, which is not the same as rotating the sprite (and it is a lot faster than the rotation routine). The sprite must be a memory bitmap.

PROCEDURE al_draw_sprite_vh_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;

This is like al_draw_sprite, but it additionally flip the image vertically and horizontally. Flipping vertically means that the y-axis is reversed, while flipping horizontally means that de x-axis is reversed, between the source and the destination. This produces exact mirror images, which is not the same as rotating the sprite (and it is a lot faster than the rotation routine). The sprite must be a memory bitmap.

PROCEDURE al_draw_trans_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT); INLINE;

Uses the global al_color_table table or truecolor blender functions to overlay the sprite on top of the existing image. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes). Because it involves reading as well as writing the bitmap memory, translucent drawing is very slow if you draw directly to video RAM, so wherever possible you should use a memory bitmap instead. Example:

VAR
  global_trans_table: AL_COLOR_MAP;

    ...
  al_create_trans_table (@global_trans_table, my_palette,
                             128, 128, 128, NIL);
    ...
  IF al_get_color_depth = 8
    al_color_table := @global_trans_table
  ELSE
    al_set_trans_blender (128, 128, 128, 128);
  al_draw_trans_sprite (buffer, ghost_sprite, x, y);

The bitmap and sprite must normally be in the same color depth, but as a special case you can draw 32 bit RGBA format sprites onto any hicolor or truecolor bitmap, as long as you call al_set_alpha_blender first, and you can draw 8-bit alpha images onto a 32-bit RGBA destination, as long as you call al_set_write_alpha_blender first. As al_draw_sprite this function skips transparent pixels, except if the source sprite is an 8-bit image; if this is the case, you should pay attention to properly set up your color map table for index 0.

See also
al_draw_lit_sprite
In 256-color modes, uses the global al_color_table table to tint the sprite image to the specified color or to light it to the level specified by 'color', depending on the function which was used to build the table (al_create_trans_table or al_create_light_table), and draws the resulting image to the destination bitmap.
al_color_table
Pointer to the color mapping table.
PROCEDURE al_draw_lit_sprite (bmp, sprite: AL_BITMAPptr; x, y, c: AL_INT); INLINE;

In 256-color modes, uses the global al_color_table table to tint the sprite image to the specified color or to light it to the level specified by 'color', depending on the function which was used to build the table (al_create_trans_table or al_create_light_table), and draws the resulting image to the destination bitmap. In truecolor modes, uses the blender functions to light the sprite image using the alpha level specified by 'color' (the alpha level which was passed to the blender functions is ignored) and draws the resulting image to the destination bitmap.

Parameters
c
must be in the range [0..255] whatever its actual meaning is. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes).
See also
al_draw_sprite
Draws a copy of the sprite bitmap onto the destination bitmap at the specified position.
al_draw_gouraud_sprite
More sophisticated version of al_draw_lit_sprite: the color parameter is not constant across the sprite image anymore but interpolated between the four specified corner colors.
al_color_table
Pointer to the color mapping table.
PROCEDURE al_draw_gouraud_sprite (bmp, sprite: AL_BITMAPptr; x, y, c1, c2, c3, c4: AL_INT); INLINE;

More sophisticated version of al_draw_lit_sprite: the color parameter is not constant across the sprite image anymore but interpolated between the four specified corner colors. The corner values passed to this function indicate the strength of the color applied on them, ranging from 0 (no strength) to 255 (full strength).

See also
al_draw_sprite
Draws a copy of the sprite bitmap onto the destination bitmap at the specified position.
al_color_table
Pointer to the color mapping table.
PROCEDURE al_rotate_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); INLINE;

Draws the sprite image onto the bitmap. It is placed with its top left corner at the specified position, then rotated by the specified angle around its centre. The angle is a fixed point 16.16 number in the same format used by the fixed point trig routines, with 256 equal to a full circle, 64 a right angle, etc. All rotation functions can draw between any two bitmaps, even screen bitmaps or bitmaps of different color depth.

Positive increments of the angle will make the sprite rotate clockwise.

PROCEDURE al_rotate_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle: AL_FIXED); INLINE;

Like al_rotate_sprite, but flips the image vertically before rotating it. To flip horizontally, use this routine but add al_itofix (128) to the angle. To flip in both directions, use al_rotate_sprite and add al_itofix (128) to its angle.

PROCEDURE al_rotate_scaled_sprite (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); INLINE;

Like al_rotate_sprite, but stretches or shrinks the image at the same time as rotating it.

PROCEDURE al_rotate_scaled_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y: AL_INT; angle, scale: AL_FIXED); INLINE;

Draws the sprite, similar to al_rotate_scaled_sprite except that it flips the sprite vertically first.

PROCEDURE al_pivot_sprite (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); INLINE;

Like al_rotate_sprite, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates around this point.

PROCEDURE al_pivot_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle: AL_FIXED); INLINE;

Like al_rotate_sprite_v_flip, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates around this point.

PROCEDURE al_pivot_scaled_sprite (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); INLINE;

Like al_rotate_scaled_sprite, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates around this point.

PROCEDURE al_pivot_scaled_sprite_v_flip (bmp, sprite: AL_BITMAPptr; x, y, cx, cy: AL_INT; angle, scale: AL_FIXED); INLINE;

Like al_rotate_scaled_sprite_v_flip, but aligns the point in the sprite given by cx, cy to x, y in the bitmap, then rotates and scales around this point.

PROCEDURE _al_putpixel (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Like the regular al_putpixel, but much faster because it's implemented as an inline functions for specific 8 bits color depth. It don't perform any clipping (they will crash if you try to draw outside the bitmap!), and ignore the drawing mode.

FUNCTION _al_getpixel (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Faster inline version of al_getpixel. This is specific for 8 bits color depth and don't do any clipping, so you must make sure the point lies inside the bitmap.

Returns

the value of the pixel in 8bpp

PROCEDURE _al_putpixel15 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Like the regular al_putpixel, but much faster because it's implemented as an inline function for specific 15 bits color depth. It don't perform any clipping (it may crash if you try to draw outside the bitmap!), and ignore the drawing mode.

FUNCTION _al_getpixel15 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Faster inline version of al_getpixel. This is specific for 15 bits color depth and don't do any clipping, so you must make sure the point lies inside the bitmap.

Returns

the value of the pixel in 15bpp

PROCEDURE _al_putpixel16 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Like the regular al_putpixel, but much faster because it's implemented as an inline function for specific 16 bits color depth. It don't perform any clipping (it may crash if you try to draw outside the bitmap!), and ignore the drawing mode.

FUNCTION _al_getpixel16 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Faster inline version of al_getpixel. This is specific for 16 bits color depth and don't do any clipping, so you must make sure the point lies inside the bitmap.

Returns

the value of the pixel in 16bpp

PROCEDURE _al_putpixel24 (bmp: AL_BITMAPptr; x, y, color: AL_INT);

Like the regular al_putpixel, but much faster because it's implemented as an inline function for specific 24 bits color depth. It don't perform any clipping (it may crash if you try to draw outside the bitmap!), and ignore the drawing mode.

FUNCTION _al_getpixel24 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Faster inline version of al_getpixel. This is specific for 24 bits color depth and don't do any clipping, so you must make sure the point lies inside the bitmap.

Returns

the value of the pixel in 24bpp

PROCEDURE _al_putpixel32 (bmp: AL_BITMAPptr; x, y, color: AL_INT); INLINE;

Like the regular al_putpixel, but much faster because it's implemented as an inline function for specific 32 bits color depth. It don't perform any clipping (it may crash if you try to draw outside the bitmap!), and ignore the drawing mode.

FUNCTION _al_getpixel32 (bmp: AL_BITMAPptr; x, y: AL_INT): AL_INT; INLINE;

Faster inline version of al_getpixel. This is specific for 32 bits color depth and don't do any clipping, so you must make sure the point lies inside the bitmap.

Returns

the value of the pixel in 32bpp

FUNCTION al_font_has_alpha (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'font_has_alpha';

Search all pixels of a font for alpha values.

See also
al_is_trans_font
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.
PROCEDURE al_make_trans_font (f: AL_FONTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'make_trans_font';

Makes a font use transparency. That is, each glyph in the font will be drawn with , so you can use the same blenders as with al_draw_trans_sprite to draw the font. One common use of this is to load a bitmap font with an alpha channel, and therefore get anti-aliased text output by using Allegro's alpha blender. Here's an example how to do that:

VAR
  f: AL_FONTptr;
BEGIN
  f := al_load_font ('alphafont.tga', NIL, NIL);
  al_make_trans_font (f);
  al_set_alpha_blender;
  al_textout_centre_ex (al_screen, f, 'Anti-aliased Font!', 320, 240, -1, -1);
  al_destroy_font (f);
END;

See also
al_draw_trans_sprite
Uses the global al_color_table table or truecolor blender functions to overlay the sprite on top of the existing image.
al_is_trans_font
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.
al_set_alpha_blender
Enables the special alpha-channel blending mode, which is used for drawing 32-bit RGBA sprites.
al_load_font
Loads a font from a file.
FUNCTION al_is_trans_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_trans_font';

This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.

See also
al_make_trans_font
Makes a font use transparency.
al_is_color_font
This function checks if the given font is a color font, as opposed to a monochrome font.
al_is_mono_font
This function checks if the given font is a mono font, as opposed to a color font.
FUNCTION al_is_color_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_color_font';

This function checks if the given font is a color font, as opposed to a monochrome font.

Returns

True if the font is a color font, False if it is not.

See also
al_is_mono_font
This function checks if the given font is a mono font, as opposed to a color font.
al_is_trans_font
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.
FUNCTION al_is_mono_font (f: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_mono_font';

This function checks if the given font is a mono font, as opposed to a color font.

Returns

True if the font is a monochrome font, False if it is not.

See also
al_is_color_font
This function checks if the given font is a color font, as opposed to a monochrome font.
al_is_trans_font
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.
FUNCTION al_is_compatible_font (f1, f2: AL_FONTptr): AL_BOOL; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'is_compatible_font';

This function compares the two fonts, which you can use to find out if Allegro is capable of merging them.

Returns

True if the two fonts are of the same general type (both are color fonts or both are monochrome fonts, for instance).

FUNCTION al_load_font (filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_font';

Loads a font from a file. At present, this supports loading fonts from a GRX format .fnt file, a 8x8 or 8x16 BIOS format .fnt file, a datafile or any bitmap format that can be loaded by al_load_bitmap.

If the font contains palette information, then the palette is returned in the second parameter, which should be a pointer to an AL_PALETTE. The palette argument may be Nil. In this case, the palette data, if present, is simply not returned.

The third parameter can be used to pass specific information to a custom loader routine. Normally, you can just leave this as Nil. Note that another way of loading fonts is embedding them into a datafile and using the datafile related functions.

Returns

a pointer to the font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_load_bitmap_font
Tries to grab a font from a bitmap.
al_grab_font_from_bitmap
This function is the work-horse of al_load_bitmap_font, and can be used to grab a font from a bitmap in memory.
alfile
Data files and low-level packed file.
al_destroy_font
Frees the memory being used by a font structure.
FUNCTION al_load_bitmap_font (filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_bitmap_font';

Tries to grab a font from a bitmap. The bitmap can be in any format that al_load_bitmap understands.

The size of each character is determined by the layout of the image, which should be a rectangular grid containing all the ASCII characters from space (32) up to the tilde (126). The way the characters are separated depends on the color depth of the image file:

  • paletted (8 bit) image file Use color 0 for the transparent portions of the characters and fill the spaces between each letter with color 255.

  • High (15/16 bit) and true (24/32 bit) color image file use bright pink (maximum red and blue, zero green) for the transparent portions of the characters and fill the spaces between each letter with bright yellow (maximum red and green, zero blue).

Note that in each horizontal row the bounding boxes around the characters should align and have the same height.

Probably the easiest way to get to grips with how this works is to load up the demo.dat file and export the TITLE_FONT into a PCX file. Have a look at the resulting picture in your paint program: that is the format a font should be in.

Take care with high and true color fonts: Allegro will convert these to the current color depth when you load the font. If you try to use a font on a bitmap with a different color depth Allegro will do color conversions on the fly, which will be rather slow. For optimal performance you should set the color depth to the color depth you want to use before loading any fonts.

Returns

a pointer to the font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_load_font
Loads a font from a file.
al_destroy_font
Frees the memory being used by a font structure.
FUNCTION al_load_txt_font (CONST filename: AL_STR; pal: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_txt_font';

Loads a font script. The script file contains a number of lines in the format filename start end, which specify the source file for that range of characters, the Unicode value of the first character in the range, and the end character in the range (optional, if left out, the entire input file will be grabbed). If the filename is replaced by a hyphen, more characters will be grabbed from the previous input file. For example, the script:

          ascii.fnt 0x20 0x7F
          - 0xA0 0xFF
          dingbats.fnt 0x1000

would import the first 96 characters from ascii.fnt as the range 0x20-0x7F, the next 96 characters from ascii.fnt as the range 0xA0-0xFF, and the entire contents of dingbats.fnt starting at Unicode position 0x1000.

Returns

A pointer to the font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_load_font
Loads a font from a file.
al_destroy_font
Frees the memory being used by a font structure.
FUNCTION al_grab_font_from_bitmap (bmp: AL_BITMAPptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'grab_font_from_bitmap';

This function is the work-horse of al_load_bitmap_font, and can be used to grab a font from a bitmap in memory. You can use this if you want to generate or modify a font at runtime. The bitmap should follow the layout described for al_load_bitmap_font.

Returns

a pointer to the font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_destroy_font
Frees the memory being used by a font structure.
FUNCTION al_get_font_ranges (f: AL_FONTptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_ranges';

Returns the number of character ranges in a font. You should query each of these ranges with al_get_font_range_begin and al_get_font_range_end to find out what characters are available in the font. Example:

VAR
  f: AL_FONTptr;
  Range, n: INTEGER;
BEGIN
  ...
  Range := al_get_font_ranges (f);
  WriteLn ('The font has ', Range, ' character ranges:');
  FOR N := 0 TO Range - 1 DO
    WriteLn ('Range ',n
      ' from 0x', IntToHex (al_get_font_range_begin (f, n), 3),
      ' to 0x', IntToHex (al_get_font_range_end (f, n), 3));
END;

Returns

the number of continuous character ranges in a font, or -1 if that information is not available.

See also
al_transpose_font
Transposes all characters in a font.
FUNCTION al_get_font_range_begin (f: AL_FONTptr; range: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_range_begin';

Returns the start of a character range in a font. You can pass -1 for the range parameter if you want to know the start of the whole font range, or a number from 0 to (but not including) al_get_font_ranges (f) to get the start of a specific character range in the font.

See also
al_get_font_range_end
Returns the last character of a character range in a font.
al_transpose_font
Transposes all characters in a font.
FUNCTION al_get_font_range_end (f: AL_FONTptr; range: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_font_range_end';

Returns the last character of a character range in a font. You can pass -1 for the range parameter if you want to know the start of the whole font range, or a number from 0 to (but not including) al_get_font_ranges (f) to get the start of a specific character range in the font. You should check the start and end of all font ranges to see if a specific character is actually available in the font. Not all characters in the range returned by al_get_font_range_begin (f, -1) and al_get_font_range_end (f, -1) need to be available!

See also
al_get_font_range_begin
Returns the start of a character range in a font.
al_transpose_font
Transposes all characters in a font.
FUNCTION al_extract_font_range (f: AL_FONTptr; start, finish: AL_INT): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'extract_font_range';

Extracts a range of characters from a font. This function extracts a character range from a font and returns a new font that contains only the range of characters selected by this function. You can pass -1 for either the lower or upper bound if you want to select all characters from the start or to the end of the font. Example:

VAR
  MyFont, Capitals, FontCopy: AL_FONTptr;
...
  Capitals := al_extract_font_range (MyFont, Ord ('A'), Ord ('Z'));
  FontCopy := al_extract_font_range (MyFont, -1, -1);
...
  al_destroy_font (Capitals);
  al_destroy_font (FontCopy);

Returns

a pointer to the new font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_get_font_range_begin
Returns the start of a character range in a font.
al_get_font_range_end
Returns the last character of a character range in a font.
al_merge_fonts
Merges two fonts into one font.
al_transpose_font
Transposes all characters in a font.
FUNCTION al_merge_fonts (f1, f2: AL_FONTptr): AL_FONTptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'merge_fonts';

Merges two fonts into one font. This function merges the character ranges from two fonts and returns a new font containing all characters in the old fonts. In general, you cannot merge fonts of different types (eg, TrueType fonts and bitmapped fonts), but as a special case, this function can promote a monochrome bitmapped font to a color font and merge those. Example:

VAR
  MyFont, MyFancyFont: AL_FONTptr;
  LowerRange, UpperRange, Capitals, TmpFont: AL_FONTptr;
  CombinedFont: AL_FONTptr;
BEGIN
...
// Create a font that contains the capitals from
// the fancy font but other characters from MyFont.
  LowerRange := al_extract_font_range (MyFont, -1, Ord ('A') - 1);
  UpperRange := al_extract_font_range (MyFont, Ord ('Z') + 1, -1);
  Capitals   := al_extract_font_range (MyFancyFont, Ord ('A'), Ord ('Z'));

  TmpFont := al_merge_fonts (LowerRange, Capitals);
  CombinedFont := al_merge_fonts (TmpFont, UpperRange);

// Clean up temporary fonts.
  al_destroy_font (LowerRange);
  al_destroy_font (UpperRange);
  al_destroy_font (Capitals);
  al_destroy_font (TmpFont);
END;

Returns

a pointer to the new font or Nil on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks.

See also
al_extract_font_range
Extracts a range of characters from a font.
al_is_trans_font
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs.
al_is_color_font
This function checks if the given font is a color font, as opposed to a monochrome font.
al_is_mono_font
This function checks if the given font is a mono font, as opposed to a color font.
FUNCTION al_transpose_font (f: AL_FONTptr; drange: AL_INT): AL_BOOL; INLINE;

Transposes all characters in a font. Example: VAR MyFont, Capitals: AL_FONTptr; BEGIN ... // Create a font of only capital letters. Capitals := al_extract_font_range (MyFont, Ord ('A'), Ord ('Z'));

// Now transpose the characters in the font so that they will be used // for the lower case letters a-z. al_transpose_font (Capitals, Ord ('a') - Ord ('A')); al_textout_ex (al_screen, Capitals, 'allcaps', 100, 100, al_makecol (255,255,25), 0); END; #)

Returns

True on success, False on failure.

See also
al_get_font_range_begin
Returns the start of a character range in a font.
al_get_font_range_end
Returns the last character of a character range in a font.
al_merge_fonts
Merges two fonts into one font.
al_extract_font_range
Extracts a range of characters from a font.
PROCEDURE al_textout_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_ex';

Writes the string onto the bitmap at given position, using the specified font, foreground color and background color. If the background color is -1, then the text is written transparently. If the foreground color is -1 and a color font is in use, it will be drawn using the colors from the original font bitmap (the one you imported into the grabber program), which allows multicolored text output. For high and true color fonts, the foreground color is ignored and always treated as -1. (al_text_length)

Parameters
bmp
The output bitmap.
f
The font to render.
str
The text to draw.
x
Horizontal position.
y
Vertical position.
color
Foreground color. Set to -1 to use multicolor fonts.
bg
Background color. Set to -1 to use transparent background.
See also
al_textprintf_ex
Formatted text output, using a Format style format string.
al_textout_centre_ex
Like al_textout_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
al_textout_right_ex
Like al_textout_ex, but interprets the x coordinate as the right rather than the left edge of the string.
al_textout_justify_ex
Draws justified text within the region x1-x2.
al_text_height
Returns the height (in pixels) of the specified font.
PROCEDURE al_textout_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_centre_ex';

Like al_textout_ex, but interprets the x coordinate as the centre rather than the left edge of the string.

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textout_right_ex
Like al_textout_ex, but interprets the x coordinate as the right rather than the left edge of the string.
al_textout_justify_ex
Draws justified text within the region x1-x2.
PROCEDURE al_textout_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x, y, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_right_ex';

Like al_textout_ex, but interprets the x coordinate as the right rather than the left edge of the string.

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textout_centre_ex
Like al_textout_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
al_textout_justify_ex
Draws justified text within the region x1-x2.
PROCEDURE al_textout_justify_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: AL_STR; x1, x2, y, diff, color, bg: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'textout_justify_ex';

Draws justified text within the region x1-x2. If the amount of spare space is greater than the diff value, it will give up and draw regular left justified text instead.

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textout_centre_ex
Like al_textout_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
al_textout_right_ex
Like al_textout_ex, but interprets the x coordinate as the right rather than the left edge of the string.
PROCEDURE al_textprintf_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);

Formatted text output, using a Format style format string. Example:

  VAR
    PlayerScore: INTEGER;
  BEGIN
  ...
    al_textprintf_ex (al_screen, al_font, 10, 10, al_makecol (255, 100, 200), -1, 'Score: %d', [PlayerScore]);
  ...
  END;
  

Parameters
bmp
The output bitmap.
f
The font to render.
x
Horizontal position.
y
Vertical position.
color
Foreground color. Set to -1 to use multicolor fonts.
bg
Background color. Set to -1 to use transparent background.
aFormat
The format string.
Params
The list of parameters.
See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textprintf_centre_ex
Like al_textprintf_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
al_textprintf_right_ex
Like al_textprintf_ex, but interprets the x coordinate as the right rather than the left edge of the string.
PROCEDURE al_textprintf_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);

Like al_textprintf_ex, but interprets the x coordinate as the centre rather than the left edge of the string. Example:

  al_textprintf_centre_ex (al_screen, al_font, AL_SCREEN_W DIV 2, 120,
			   al_makecol (0, 100, 243), -1,
			   'Your best score so far was %d!',
			   [TotalMaxPoints]);
  

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textout_centre_ex
Like al_textout_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
al_textprintf_ex
Formatted text output, using a Format style format string.
al_textprintf_right_ex
Like al_textprintf_ex, but interprets the x coordinate as the right rather than the left edge of the string.
PROCEDURE al_textprintf_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST x, y, color, bg: AL_INT; CONST aFormat: STRING; Params: ARRAY OF CONST);

Like al_textprintf_ex, but interprets the x coordinate as the right rather than the left edge of the string. Example:

  al_textprintf_right_ex (al_screen, al_font, AL_SCREEN_W -10, 10,
			  al_makecol (200, 200, 20), -1,
			  '%d bullets left', [PlayerAmmo]);
  

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_textout_right_ex
Like al_textout_ex, but interprets the x coordinate as the right rather than the left edge of the string.
al_textprintf_ex
Formatted text output, using a Format style format string.
al_textprintf_centre_ex
Like al_textprintf_ex, but interprets the x coordinate as the centre rather than the left edge of the string.
FUNCTION al_text_length (CONST f: AL_FONTptr; CONST str: AL_STR): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'text_length';

Returns the length (in pixels) of a string in the specified font.

See also
al_text_height
Returns the height (in pixels) of the specified font.
FUNCTION al_text_height (CONST f: AL_FONTptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'text_height';

Returns the height (in pixels) of the specified font.

See also
al_text_length
Returns the length (in pixels) of a string in the specified font.
PROCEDURE al_destroy_font (f: AL_FONTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_font';

Frees the memory being used by a font structure. Don't use this on the default global Allegro font or any text routines using it could crash. You should use this only on fonts you have loaded manually after you are done with them, to prevent memory leaks in your program.

See also
al_load_font
Loads a font from a file.
FUNCTION al_get_rle_sprite (bitmap: AL_BITMAPptr): AL_RLE_SPRITEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_rle_sprite';

Creates an RLE sprite based on the specified bitmap (which must be a memory bitmap). Remember to free this RLE sprite later to avoid memory leaks.

Parameters
bitmap
Pointer to the bitmap used to create the sprite.
Returns

A pointer to the created RLE sprite, or Nil if it could not be created. Remember to free this RLE sprite later to avoid memory leaks.

See also
al_destroy_rle_sprite
Destroys an RLE sprite structure previously returned by al_get_rle_sprite.
al_draw_rle_sprite
Draws an RLE sprite onto a bitmap at the specified position.
PROCEDURE al_destroy_rle_sprite (sprite: AL_RLE_SPRITEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_rle_sprite';

Destroys an RLE sprite structure previously returned by al_get_rle_sprite. If you pass a Nil pointer this function won't do anything. Use this once you are done with an RLE sprite to avoid memory leaks in your program.

Parameters
sprite
The RLE sprite to destroy.
PROCEDURE al_draw_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y: AL_INT); INLINE;

Draws an RLE sprite onto a bitmap at the specified position.

Parameters
bmp
Bitmap where the sprite will be draw.
spr
Sprite to draw.
x
Horizontal coordinate.
y
Vertical coordinate.
See also
al_draw_sprite
Draws a copy of the sprite bitmap onto the destination bitmap at the specified position.
al_get_rle_sprite
Creates an RLE sprite based on the specified bitmap (which must be a memory bitmap).
PROCEDURE al_draw_trans_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y: AL_INT); INLINE;

Translucent version of al_draw_rle_sprite. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes). The bitmap and sprite must normally be in the same color depth, but as a special case you can draw 32-bit RGBA format sprites onto any hicolor or truecolor bitmap, as long as you call al_set_alpha_blender first.

Parameters
bmp
Bitmap where the sprite will be draw.
spr
Sprite to draw.
x
Horizontal coordinate.
y
Vertical coordinate.
See also
al_color_table
Pointer to the color mapping table.
al_set_trans_blender
Enables a linear interpolator blender mode for combining translucent or lit truecolor pixels.
PROCEDURE al_draw_lit_rle_sprite (bmp: AL_BITMAPptr; CONST spr: AL_RLE_SPRITEptr; x, y, color: AL_INT); INLINE;

Tinted version of al_draw_rle_sprite. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes).

Parameters
bmp
Bitmap where the sprite will be draw.
spr
Sprite to draw.
x
Horizontal coordinate.
y
Vertical coordinate.
color
Tint color.
See also
al_color_table
Pointer to the color mapping table.
PROCEDURE al_reserve_voices (digi_voices, midi_voices: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'reserve_voices';

Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively. This must be done before calling al_install_sound. If you reserve too many voices, subsequent calls to al_install_sound will fail. How many voices are available depends on the driver, and in some cases you will actually get more than you reserve (eg. the FM synth drivers will always provide 9 voices on an OPL2 and 18 on an OPL3, and the SB digital driver will round the number of voices up to the nearest power of two). Pass negative values to restore the default settings. You should be aware that the sound quality is usually inversely related to how many voices you use, so don't reserve any more than you really need.

See also
al_set_volume_per_voice
By default, Allegro will play a centered sample at half volume on both the left and right channel.
al_get_mixer_voices
Returns the number of voices allocated to the mixer.
PROCEDURE al_set_volume_per_voice (scale: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_volume_per_voice';

By default, Allegro will play a centered sample at half volume on both the left and right channel. A sample panned to the far right or left will be played at maximum volume on that channel only. This is done so you can play a single panned sample without distortion. If you play multiple samples at full volume, the mixing process can result in clipping, a noticeable form of distortion. The more samples, the more likely clipping is to occur, and the more clipping, the worse the output will sound.

If clipping is a problem - or if the output is too quiet - this function can be used to adjust the volume of each voice. You should first check that your speakers are at a reasonable volume, Allegro's global volume is at maximum (see al_set_volume), and any other mixers such as the Volume Control are set reasonably. Once you are sure that Allegro's output level is unsuitable for your application, use this function to adjust it.

Each time you increase the parameter by one, the volume of each voice will halve. For example, if you pass 4, you can play up to 16 centred samples at maximum volume without distortion.

If you pass 0 to this function, each centred sample will play at the maximum volume possible without distortion, as will all samples played through a mono driver. Samples at the extreme left and right will distort if played at full volume. If you wish to play panned samples at full volume without distortion, you should pass 1 to this function.

Of course this function does not override the volume you specify with al_play_sample or al_set_volume. It simply alters the overall output of the program. If you play samples at lower volumes, or if they are not normalised, then you can play more of them without distortion.

It is recommended that you hard-code the parameter into your program, rather than offering it to the user. The user can alter the volume with the configuration file instead, or you can provide for this with al_set_volume.

See also
al_reserve_voices
Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively.
al_install_sound
Initialises the sound module.
FUNCTION al_install_sound (digi, midi: AL_INT): AL_BOOL; INLINE;

Initialises the sound module. You should normally pass AL_DIGI_AUTODETECT and AL_MIDI_AUTODETECT as the driver parameters to this function, in which case Allegro will read hardware settings from the current configuration file. This allows the user to select different values with the setup utility: see the configuration section for details.

Returns

True if the sound is successfully installed, and False on failure. If it fails it will store a description of the problem in al_error.

See also
al_remove_sound
Cleans up after you are finished with the sound routines.
al_reserve_voices
Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively.
al_set_volume
Alters the global sound output volume.
al_play_sample
Triggers a sample at the specified volume, pan position, and frequency.
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_set_mixer_quality
Sets the resampling quality of the mixer.
alWin
Windows specific stuff.
alUNIX
UNIX and Linux specific stuff.
PROCEDURE al_remove_sound; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_sound';

Cleans up after you are finished with the sound routines. You don't normally need to call this, because al_exit will do it for you.

See also
al_install_sound
Initialises the sound module.
PROCEDURE al_set_volume (digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_volume';

Alters the global sound output volume. Specify volumes for both digital samples and MIDI playback, as integers from 0 to 255, or pass a negative value to leave one of the settings unchanged. Values bigger than 255 will be reduced to 255. This routine will not alter the volume of the hardware mixer if it exists (i.e. only your application will be affected).

See also
al_install_sound
Initialises the sound module.
al_set_hardware_volume
Alters the hardware sound output volume.
PROCEDURE al_set_hardware_volume (digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_hardware_volume';

Alters the hardware sound output volume. Specify volumes for both digital samples and MIDI playback, as integers from 0 to 255, or pass a negative value to leave one of the settings unchanged. Values bigger than 255 will be reduced to 255. This routine will use the hardware mixer to control the volume if it exists (i.e. the volume of all the applications on your machine will be affected), otherwise do nothing.

See also
al_install_sound
Initialises the sound module.
al_set_volume
Alters the global sound output volume.
PROCEDURE al_get_volume (OUT digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_volume';

Retrieves the global sound output volume, both for digital samples and MIDI playback, as integers from 0 to 255.

See also
al_set_volume
Alters the global sound output volume.
al_get_hardware_volume
Retrieves the hardware sound output volume, both for digital samples and MIDI playback, as integers from 0 to 255, or -1 if the information is not available.
PROCEDURE al_get_hardware_volume (OUT digi, midi: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_hardware_volume';

Retrieves the hardware sound output volume, both for digital samples and MIDI playback, as integers from 0 to 255, or -1 if the information is not available.

See also
al_set_hardware_volume
Alters the hardware sound output volume.
al_get_volume
Retrieves the global sound output volume, both for digital samples and MIDI playback, as integers from 0 to 255.
PROCEDURE al_set_mixer_quality (quality: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_mixer_quality';

Sets the resampling quality of the mixer. Valid values are the same as the quality config variable. Please read chapter "Standard config variables" for details. You can call this function at any point in your program, even before al_init.

See also
al_get_mixer_quality
Returns the current mixing quality, as specified by the quality config variable, or a previous call to al_set_mixer_quality.
FUNCTION al_get_mixer_quality: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_quality';

Returns the current mixing quality, as specified by the quality config variable, or a previous call to al_set_mixer_quality.

FUNCTION al_get_mixer_frequency: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_frequency';

Returns the mixer frequency, in Hz.

FUNCTION al_get_mixer_bits: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_bits';

Returns the mixer bit depth (8 or 16).

FUNCTION al_get_mixer_channels: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_channels';

Returns the number of output channels. 2 for stereo, 1 for mono, 0 if the mixer isn't active.

FUNCTION al_get_mixer_voices: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_voices';

Returns the number of voices allocated to the mixer.

See also
al_reserve_voices
Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively.
FUNCTION al_get_mixer_buffer_length: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_mixer_buffer_length';

Returns the number of samples per channel in the mixer buffer.

FUNCTION al_detect_midi_driver (driver_id: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'detect_midi_driver';

Detects whether the specified MIDI sound device is available. This function must be called before al_install_sound.

Returns

The maximum number of voices that the driver can provide, or zero if the hardware is not present.

There are two special-case return values that you should watch out for: if this function returns -1 it is a note-stealing driver (eg. DIGMID) that shares voices with the current digital sound driver, and if it returns $FFFF it is an external device like an MPU-401 where there is no way to determine how many voices are available.

See also
al_install_sound
Initialises the sound module.
al_reserve_voices
Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively.
FUNCTION al_load_midi (CONST filename: AL_STR): AL_MIDIptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_midi';

Loads a MIDI file (handles both format 0 and format 1).

Returns

a pointer to a AL_MIDI structure, or Nil on error. Remember to free this MIDI file later to avoid memory leaks.

See also
al_destroy_midi
Destroys a AL_MIDI structure when you are done with it.
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_get_midi_length
This function will simulate playing the given MIDI, from start to end, to determine how long it takes to play.
PROCEDURE al_destroy_midi (midi: AL_MIDIptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_midi';

Destroys a AL_MIDI structure when you are done with it. It is safe to call this even when the MIDI file might be playing, because it checks and will kill it off if it is active. Use this to avoid memory leaks in your program.

See also
al_load_midi
Loads a MIDI file (handles both format 0 and format 1).
FUNCTION al_play_midi (midi: AL_MIDIptr; loop: AL_BOOL): AL_BOOL; INLINE;

Starts playing the specified MIDI file, first stopping whatever music was previously playing. If the loop flag is set to True, the data will be repeated until replaced with something else, otherwise it will stop at the end of the file. Passing a Nil pointer will stop whatever music is currently playing.

Returns

False if an error occurs (this may happen if a patch-caching wavetable driver is unable to load the required samples, or at least it might in the future when somebody writes some patch-caching wavetable drivers :-)

See also
al_install_sound
Initialises the sound module.
al_load_midi
Loads a MIDI file (handles both format 0 and format 1).
al_stop_midi
Stops whatever music is currently playing.
al_play_looped_midi
Starts playing a MIDI file with a user-defined loop position.
al_midi_pause
Pauses the MIDI player.
al_midi_seek
Seeks to the given al_midi_pos in the current MIDI file.
al_midi_pos
Stores the current position (beat number) in the MIDI file, or contains a negative number if no music is currently playing.
al_midi_time
Contains the position in seconds in the currently playing midi.
al_midi_msg_callback
Hook function allowing you to intercept MIDI player events.
FUNCTION al_play_looped_midi (midi: AL_MIDIptr; loop_start, loop_end: AL_INT): AL_BOOL; INLINE;

Starts playing a MIDI file with a user-defined loop position. When the player reaches the loop_end position or the end of the file (loop_end may be -1 to only loop at EOF), it will wind back to the loop_start point. Both positions are specified in the same beat number format as the al_midi_pos variable.

Returns

False if an error occurs, True otherwise.

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_midi_pos
Stores the current position (beat number) in the MIDI file, or contains a negative number if no music is currently playing.
al_midi_loop_start
The loop start point, set by the al_play_looped_midi function.
PROCEDURE al_stop_midi; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stop_midi';

Stops whatever music is currently playing. This is the same thing as calling al_play_midi (Nil, False).

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_midi_pause
Pauses the MIDI player.
PROCEDURE al_midi_pause; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_pause';

Pauses the MIDI player.

See also
al_stop_midi
Stops whatever music is currently playing.
al_midi_resume
Resumes playback of a paused MIDI file.
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
PROCEDURE al_midi_resume; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_resume';

Resumes playback of a paused MIDI file.

See also
al_midi_pause
Pauses the MIDI player.
FUNCTION al_midi_seek (target: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_seek';

Seeks to the given al_midi_pos in the current MIDI file. If the target is earlier in the file than the current al_midi_pos it seeks from the beginning; otherwise it seeks from the current position.

Returns

zero if it could successfully seek to the requested position. Otherwise, a return value of 1 means it stopped playing, and al_midi_pos is set to the negative length of the MIDI file (so you can use this function to determine the length of a MIDI file). A return value of 2 means the MIDI file looped back to the start.

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
FUNCTION al_get_midi_length (midi: AL_MIDIptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_midi_length';

This function will simulate playing the given MIDI, from start to end, to determine how long it takes to play. After calling this function, al_midi_pos will contain the negative number of beats, and al_midi_time the length of the midi, in seconds.

Note that any currently playing midi is stopped when you call this function. Usually you would call it before al_play_midi, to get the length of the midi to be played.

Returns

the value of al_midi_time, the length of the midi.

See also
al_load_midi
Loads a MIDI file (handles both format 0 and format 1).
PROCEDURE al_midi_out (data: AL_UCHARptr; length: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_out';

Streams a block of MIDI commands into the player in real-time, allowing you to trigger notes, jingles, etc, over the top of whatever MIDI file is currently playing.

See also
al_install_sound
Initialises the sound module.
al_load_midi_patches
Forces the MIDI driver to load the entire set of patches ready for use.
FUNCTION al_load_midi_patches: AL_BOOL; INLINE;

Forces the MIDI driver to load the entire set of patches ready for use. You will not normally need to call this, because Allegro automatically loads whatever data is required for the current MIDI file, but you must call it before sending any program change messages via the al_midi_out command.

Returns

False if an error occurred.

See also
al_install_sound
Initialises the sound module.
FUNCTION al_detect_digi_driver (driver_id: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'detect_digi_driver';

Detects whether the specified digital sound device is available. This function must be called before al_install_sound.

Returns

The maximum number of voices that the driver can provide, or zero if the hardware is not present.

See also
al_install_sound
Initialises the sound module.
al_reserve_voices
Call this function to specify the number of voices that are to be used by the digital and MIDI sound drivers respectively.
FUNCTION al_load_sample (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_sample';

Loads a sample from a file, supporting both mono and stereo WAV and mono VOC files, in 8 or 16-bit formats, as well as formats handled by functions registered using al_register_sample_file_type.

Remember to free this sample later to avoid memory leaks.

Returns

a pointer to the AL_SAMPLE or Nil on error.

See also
al_destroy_sample
Destroys a sample structure when you are done with it.
al_load_voc
Loads a sample from a Creative Labs VOC file.
al_load_wav
Loads a sample from a RIFF WAV file.
al_play_sample
Triggers a sample at the specified volume, pan position, and frequency.
al_save_sample
Writes a sample into a file.
FUNCTION al_load_wav (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_wav';

Loads a sample from a RIFF WAV file.

Remember to free this sample later to avoid memory leaks.

Returns

a pointer to the AL_SAMPLE or Nil on error.

See also
al_load_wav_pf
A version of al_load_wav which reads from a packfile.
FUNCTION al_load_voc (CONST filename: AL_STR): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'load_voc';

Loads a sample from a Creative Labs VOC file.

Remember to free this sample later to avoid memory leaks.

Returns

a pointer to the AL_SAMPLE or Nil on error.

See also
al_load_voc_pf
A version of al_load_voc which reads from a packfile.
FUNCTION al_save_sample (CONST filename: STRING; spl: AL_SAMPLEptr): AL_BOOL; INLINE;

Writes a sample into a file. The output format is determined from the filename extension. At present Allegro does not natively support the writing of any sample formats, so you must register a custom saver routine with al_register_sample_file_type.

Returns

True on success, False otherwise.

See also
al_create_sample
Constructs a new sample structure of the specified type.
al_destroy_sample
Destroys a sample structure when you are done with it.
FUNCTION al_create_sample (bits, stereo, freq, len: AL_INT): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_sample';

Constructs a new sample structure of the specified type.

Remember to free this sample later to avoid memory leaks.

Parameters
bits
can be 8 or 16.
stereo
can be zero for mono samples and non-zero for stereo samples
freq
is the frequency in hertz
len
is the number of samples you want to allocate for the full sound buffer.
Returns

a pointer to the created sample, or Nil if the sample could not be created.

See also
al_load_sample
Loads a sample from a file, supporting both mono and stereo WAV and mono VOC files, in 8 or 16-bit formats, as well as formats handled by functions registered using al_register_sample_file_type.
al_destroy_sample
Destroys a sample structure when you are done with it.
PROCEDURE al_destroy_sample (spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_sample';

Destroys a sample structure when you are done with it. It is safe to call this even when the sample might be playing, because it checks and will kill it off if it is active. Use this to avoid memory leaks in your program.

See also
al_load_sample
Loads a sample from a file, supporting both mono and stereo WAV and mono VOC files, in 8 or 16-bit formats, as well as formats handled by functions registered using al_register_sample_file_type.
al_create_sample
Constructs a new sample structure of the specified type.
FUNCTION al_play_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq: AL_INT; CONST loop: AL_BOOL): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'play_sample';

Triggers a sample at the specified volume, pan position, and frequency. The parameters vol and pan range from 0 (min/left) to 255 (max/right). Frequency is relative rather than absolute: 1000 represents the frequency that the sample was recorded at, 2000 is twice this, etc. If loop is True, the sample will repeat until you call al_stop_sample, and can be manipulated while it is playing by calling al_adjust_sample.

Returns

the voice number that was allocated for the sample or negative if no voices were available.

PROCEDURE al_stop_sample (CONST spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'stop_sample';

Stop a sample from playing, which is required if you have set a sample going in looped mode. If there are several copies of the sample playing, it will stop them all. You must still destroy the sample using al_destroy_sample.

See also
al_play_sample
Triggers a sample at the specified volume, pan position, and frequency.
PROCEDURE al_adjust_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq: AL_INT; CONST loop: AL_BOOL); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'adjust_sample';

Alters the parameters of a sample while it is playing (useful for manipulating looped sounds). You can alter the volume, pan, and frequency, and can also clear the loop flag, which will stop the sample when it next reaches the end of its loop. The values of the parameters are just like those of al_play_sample. If there are several copies of the same sample playing, this will adjust the first one it comes across. If the sample is not playing it has no effect.

FUNCTION al_allocate_voice (CONST spl: AL_SAMPLEptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allocate_voice';

Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping). When you are finished with the voice you must free it by calling al_deallocate_voice or al_release_voice. Allegro can manage up to 256 simultaneous voices, but that limit may be lower due to hardware reasons.

Returns

the voice number, or -1 if no voices are available.

See also
al_reallocate_voice
Switches an already-allocated voice to use a different sample.
al_load_sample
Loads a sample from a file, supporting both mono and stereo WAV and mono VOC files, in 8 or 16-bit formats, as well as formats handled by functions registered using al_register_sample_file_type.
PROCEDURE al_deallocate_voice (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'deallocate_voice';

Frees a soundcard voice, stopping it from playing and releasing whatever resources it is using.

See also
al_allocate_voice
Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping).
al_voice_stop
Stops a voice, storing the current position and state so that it may later be resumed by calling al_voice_start.
PROCEDURE al_reallocate_voice (voice: AL_INT; CONST spl: AL_SAMPLEptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'reallocate_voice';

Switches an already-allocated voice to use a different sample. Calling al_reallocate_voice (voice, sample) is equivalent to:

  al_deallocate_voice (Voice);
  Voice := al_allocate_voice (Sample);

See also
al_allocate_voice
Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping).
al_load_sample
Loads a sample from a file, supporting both mono and stereo WAV and mono VOC files, in 8 or 16-bit formats, as well as formats handled by functions registered using al_register_sample_file_type.
PROCEDURE al_release_voice (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'release_voice';

Releases a soundcard voice, indicating that you are no longer interested in manipulating it. The sound will continue to play, and any resources that it is using will automatically be freed when it finishes. This is essentially the same as al_deallocate_voice, but it waits for the sound to stop playing before taking effect.

See also
al_allocate_voice
Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping).
PROCEDURE al_voice_start (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_start';

Activates a voice, using whatever parameters have been set for it.

See also
al_allocate_voice
Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping).
al_voice_stop
Stops a voice, storing the current position and state so that it may later be resumed by calling al_voice_start.
PROCEDURE al_voice_stop (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop';

Stops a voice, storing the current position and state so that it may later be resumed by calling al_voice_start.

See also
al_deallocate_voice
Frees a soundcard voice, stopping it from playing and releasing whatever resources it is using.
al_release_voice
Releases a soundcard voice, indicating that you are no longer interested in manipulating it.
PROCEDURE al_voice_set_priority (voice, priority: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_priority';

Sets the priority of a voice (range 0-255). This is used to decide which voices should be chopped off, if you attempt to play more than the soundcard driver can handle.

FUNCTION al_voice_check (voice: AL_INT): AL_SAMPLEptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_check';

Checks whether a voice is currently allocated.

Returns

a pointer to the sample that the voice is using, or Nil if the voice is inactive (ie. it has been deallocated), or the al_release_voice function has been called and the sample has then finished playing.

See also
al_allocate_voice
Allocates a soundcard voice and prepares it for playing the specified sample, setting up sensible default parameters (maximum volume, centre pan, no change of pitch, no looping).
al_voice_start
Activates a voice, using whatever parameters have been set for it.
al_voice_get_position
Returns the current position of a voice, in sample units, or -1 if it has finished playing.
PROCEDURE al_voice_set_playmode (voice, playmode: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_playmode';

Adjusts the loop status of the specified voice. This can be done while the voice is playing, so you can start a sample in looped mode (having set the loop start and end positions to the appropriate values), and then clear the loop flag when you want to end the sound, which will cause it to continue past the loop end, play the subsequent part of the sample, and finish in the normal way. The mode parameter is a bitfield containing the following values: AL_PLAYMODE_PLAY, AL_PLAYMODE_LOOP, AL_PLAYMODE_FORWARD, AL_PLAYMODE_BACKWARD, AL_PLAYMODE_BIDIR

See also
AL_PLAYMODE_PLAY
Plays the sample a single time.
AL_PLAYMODE_LOOP
Loops repeatedly through the sample, jumping back to the loop start position upon reaching the loop end.
AL_PLAYMODE_FORWARD
Plays the sample from beginning to end.
AL_PLAYMODE_BACKWARD
Reverses the direction of the sample.
AL_PLAYMODE_BIDIR
When used in combination with the loop flag, causes the sample to change direction each time it reaches one of the loop points, so it alternates between playing forwards and in reverse.
FUNCTION al_voice_get_position (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_position';

Returns the current position of a voice, in sample units, or -1 if it has finished playing.

See also
al_voice_set_position
Sets the position of a voice, in sample units.
PROCEDURE al_voice_set_position (voice, position: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_position';

Sets the position of a voice, in sample units.

See also
al_voice_get_position
Returns the current position of a voice, in sample units, or -1 if it has finished playing.
al_voice_set_playmode
Adjusts the loop status of the specified voice.
FUNCTION al_voice_get_volume (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_volume';

Returns the current volume of the voice, range 0-255. Otherwise it returns -1 if that cannot be determined (because it has finished or been preempted by a different sound). .

See also
al_voice_set_volume
Sets the volume of the voice, range 0-255.
PROCEDURE al_voice_set_volume (voice, volume: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_volume';

Sets the volume of the voice, range 0-255.

See also
al_voice_get_volume
Returns the current volume of the voice, range 0-255.
al_voice_ramp_volume
Starts a volume ramp (crescendo or diminuendo) from the current volume to the specified ending volume, lasting for time milliseconds.
PROCEDURE al_voice_ramp_volume (voice, tyme, endvol: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_ramp_volume';

Starts a volume ramp (crescendo or diminuendo) from the current volume to the specified ending volume, lasting for time milliseconds. The volume is a value in the range 0-255.

See also
al_voice_set_volume
Sets the volume of the voice, range 0-255.
al_voice_stop_volumeramp
Interrupts a volume ramp operation.
PROCEDURE al_voice_stop_volumeramp (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_volumeramp';

Interrupts a volume ramp operation.

See also
al_voice_ramp_volume
Starts a volume ramp (crescendo or diminuendo) from the current volume to the specified ending volume, lasting for time milliseconds.
FUNCTION al_voice_get_frequency (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_frequency';

Returns the current pitch of the voice, in Hz.

See also
al_voice_set_frequency
Sets the pitch of the voice, in Hz.
PROCEDURE al_voice_set_frequency (voice, frequency: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_frequency';

Sets the pitch of the voice, in Hz.

See also
al_voice_get_frequency
Returns the current pitch of the voice, in Hz.
al_voice_sweep_frequency
Starts a frequency sweep (glissando) from the current pitch to the specified ending pitch, lasting for time milliseconds.
PROCEDURE al_voice_sweep_frequency (voice, tyme, endfreq: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_sweep_frequency';

Starts a frequency sweep (glissando) from the current pitch to the specified ending pitch, lasting for time milliseconds.

See also
al_voice_set_frequency
Sets the pitch of the voice, in Hz.
al_voice_stop_frequency_sweep
Interrupts a frequency sweep operation.
PROCEDURE al_voice_stop_frequency_sweep (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_frequency_sweep';

Interrupts a frequency sweep operation.

See also
al_voice_sweep_frequency
Starts a frequency sweep (glissando) from the current pitch to the specified ending pitch, lasting for time milliseconds.
FUNCTION al_voice_get_pan (voice: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_get_pan';

Returns the current pan position, from 0 (left) to 255 (right).

See also
al_voice_set_pan
Sets the pan position, ranging from 0 (left) to 255 (right).
PROCEDURE al_voice_set_pan (voice, pan: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_pan';

Sets the pan position, ranging from 0 (left) to 255 (right).

See also
al_voice_get_pan
Returns the current pan position, from 0 (left) to 255 (right).
al_voice_sweep_pan
Starts a pan sweep (left <-> right movement) from the current position to the specified ending position, lasting for time milliseconds.
PROCEDURE al_voice_sweep_pan (voice, tyme, endpan: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_sweep_pan';

Starts a pan sweep (left <-> right movement) from the current position to the specified ending position, lasting for time milliseconds.

See also
al_voice_stop_pan_sweep
Interrupts a pan sweep operation.
al_voice_set_pan
Sets the pan position, ranging from 0 (left) to 255 (right).
PROCEDURE al_voice_stop_pan_sweep (voice: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_stop_pan_sweep';

Interrupts a pan sweep operation.

See also
al_voice_sweep_pan
Starts a pan sweep (left <-> right movement) from the current position to the specified ending position, lasting for time milliseconds.
PROCEDURE al_voice_set_echo (voice, strength, delay: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_echo';

Sets the echo parameters for a voice (not currently implemented).

PROCEDURE al_voice_set_tremolo (voice, rate, depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_tremolo';

Sets the tremolo parameters for a voice (not currently implemented).

PROCEDURE al_voice_set_vibrato (voice, rate, depth: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'voice_set_vibrato';

Sets the vibrato parameters for a voice (not currently implemented).

PROCEDURE al_register_sample_file_type (CONST ext: AL_STR; load: AL_SAMPLE_LOAD_FUNC; save: AL_SAMPLE_SAVE_FUNC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'register_sample_file_type';

Informs the al_load_sample and the al_save_sample functions of a new sample file type, providing routines to read and write samples in this format (either function may be Nil). Example:

   FUNCTION LoadMP3 (CONST filename: AL_CHARptr): AL_SAMPLEptr; CDECL;
   BEGIN
     ...
   END;

   ...

   al_register_sample_file_type ('mp3', @LoadMPT, NIL);
   

Types

AL_JOYSTICK_INFOptr = ˆAL_JOYSTICK_INFO;

Pointer to AL_JOYSTICK_INFO.

AL_JOYSTICK_INFO_LIST = ARRAY [0..AL_UNKNOWN_SIZE] OF AL_JOYSTICK_INFO;

List of joysticks.

AL_RGBptr = ˆAL_RGB;

Pointer to AL_RGB.

AL_PALETTEptr = ˆAL_PALETTE;

Pointer to a AL_PALETTE.

AL_PALETTE = ARRAY [0..AL_PAL_SIZE-1] OF AL_RGB;

Color palette description for indexed modes (8bpp). Remember that color components are 0-63.

See also
AL_PAL_SIZE
To know the palette size.
al_set_palette
Sets the entire palette of 256 colors.
AL_RGB_MAPptr = ˆAL_RGB_MAP;

Pointer to a AL_RGB_MAP.

AL_PALETTE_DICTptr = ˆAL_PALETTE_DICT;

Pointer to AL_PALETTE_DICT.

AL_PALETTE_DICT = ARRAY [0..255] OF AL_INT;

To be used by al_palette_color.

AL_BITMAPptr = ˆAL_BITMAP;

Pointer to AL_BITMAP.

AL_POINT_PROC = PROCEDURE (bmp: AL_BITMAPptr; x, y, c: AL_INT); CDECL;

This is used to define call-back procedures for some drawing procedures.

AL_GFX_MODEptr = ˆAL_GFX_MODE;

Pointer to AL_GFX_MODE.

AL_GFX_MODE_LISTptr = ˆAL_GFX_MODE_LIST;

Pointer to AL_GFX_MODE_LIST.

AL_FONTptr = AL_POINTER;

A pointer to a structure holding an Allegro font, usually created beforehand with the grabber tool or Allegro's default font. Read introduction of text for a description on how to load/destroy fonts, and how to show text.

AL_RLE_SPRITEptr = ˆAL_RLE_SPRITE;

Ponter to AL_RLE_SPRITE.

AL_MIDIptr = ˆAL_MIDI;

Pointer to AL_MIDI.

AL_MIDI_MSG_CALLBACK_PROC = PROCEDURE (msg, b1, b2: AL_INT); CDECL;

Used by al_midi_msg_callback.

AL_SAMPLEptr = ˆAL_SAMPLE;

Pointer to AL_SAMPLE.

AL_SAMPLE_LOAD_FUNC = FUNCTION (CONST filename: AL_STR): AL_SAMPLEptr; CDECL;

Used by al_register_sample_file_type.

AL_SAMPLE_SAVE_FUNC = FUNCTION (CONST filename: AL_STR; spl: AL_SAMPLEptr): AL_INT; CDECL;

Used by al_register_sample_file_type. Should return zero on success or non-zero otherwise.

Constants

AL_VERSION = 4;

Defined to the major version of Allegro. From a version number like 4.1.16, this would be defined to the integer 4.

AL_SUB_VERSION = 4;

Defined to the middle version of Allegro. From a version number like 4.1.16, this would be defined to the integer 1.

AL_PAS_VERSION = 5;

Defined to the minor version of Allegro.pas. From a version number like 4.1.16, this would be defined to the integer 16.

AL_PAS_IS_BETA = TRUE;

Defined to TRUE if current version is a BETA version. A BETA version is a test version and may be uncomplete or untested.

AL_PAS_VERSION_STR = '4.4.5 SVN';

Defined to a text string containing all version numbers and maybe some additional text.

AL_OSTYPE_UNKNOWN = 0;

Identifies Operating System.

AL_OSTYPE_WIN3 = $57494E33;
 
AL_OSTYPE_WIN95 = $57393520;
 
AL_OSTYPE_WIN98 = $57393820;
 
AL_OSTYPE_WINME = $574D4520;
 
AL_OSTYPE_WINNT = $574E5420;
 
AL_OSTYPE_WIN2000 = $57324B20;
 
AL_OSTYPE_WINXP = $57585020;
 
AL_OSTYPE_WIN2003 = $57324B33;
 
AL_OSTYPE_WINVISTA = $57565354;
 
AL_OSTYPE_WIN7 = $57494E37;
 
AL_OSTYPE_OS2 = $4F533220;
 
AL_OSTYPE_WARP = $57415250;
 
AL_OSTYPE_UNIX = $554E4958;
 
AL_OSTYPE_LINUX = $54555820;
 
AL_OSTYPE_SUNOS = $53554E20;
 
AL_OSTYPE_FREEBSD = $46425344;
 
AL_OSTYPE_NETBSD = $4E425344;
 
AL_OSTYPE_OPENBSD = $4F425344;
 
AL_OSTYPE_IRIX = $49524958;
 
AL_OSTYPE_QNX = $514E5820;
 
AL_OSTYPE_BEOS = $42454F53;
 
AL_OSTYPE_HAIKU = $4841494B;
 
AL_OSTYPE_DARWIN = $44415257;
 
AL_OSTYPE_MACOS = $4D414320;
 
AL_OSTYPE_MACOSX = $4D414358;
 
AL_SYSTEM_AUTODETECT = 0;

Tells to al_install that must autodetect the system driver.

AL_SYSTEM_NONE = $4E4F4E45;

Tells to al_install that must install a stripped down version of Allegro that won't even try to touch the hardware or do anything platform specific: this can be useful for situations where you only want to manipulate memory bitmaps, such as the text mode datafile tools or the Windows GDI interfacing functions.

Is equivalent to AL_ID ('NONE');.

AL_CPU_ID = $0001;

CPU Capabilities flags for x86 capable chips

AL_CPU_FPU = $0002;
 
AL_CPU_MMX = $0004;
 
AL_CPU_MMXPLUS = $0008;
 
AL_CPU_SSE = $0010;
 
AL_CPU_SSE2 = $0020;
 
AL_CPU_3DNOW = $0040;
 
AL_CPU_ENH3DNOW = $0080;
 
AL_CPU_CMOV = $0100;
 
AL_CPU_AMD64 = $0200;
 
AL_CPU_IA64 = $0400;
 
AL_CPU_SSE3 = $0800;
 
AL_CPU_SSSE3 = $1000;
 
AL_CPU_SSE41 = $2000;
 
AL_CPU_SSE42 = $4000;
 
AL_CPU_FAMILY_UNKNOWN = 0;

CPU families - PC

AL_CPU_FAMILY_I386 = 3;
 
AL_CPU_FAMILY_I486 = 4;
 
AL_CPU_FAMILY_I586 = 5;
 
AL_CPU_FAMILY_I686 = 6;
 
AL_CPU_FAMILY_ITANIUM = 7;
 
AL_CPU_FAMILY_EXTENDED = 15;
 
AL_CPU_FAMILY_POWERPC = 18;

CPU families - Power PC

AL_CPU_MODEL_I486DX = 0;

486

AL_CPU_MODEL_I486DX50 = 1;
 
AL_CPU_MODEL_I486SX = 2;
 
AL_CPU_MODEL_I487SX = 3;
 
AL_CPU_MODEL_I486SL = 4;
 
AL_CPU_MODEL_I486SX2 = 5;
 
AL_CPU_MODEL_I486DX2 = 7;
 
AL_CPU_MODEL_I486DX4 = 8;
 
AL_CPU_MODEL_PENTIUM = 1;

Intel/586

AL_CPU_MODEL_PENTIUMP54C = 2;
 
AL_CPU_MODEL_PENTIUMOVERDRIVE = 3;
 
AL_CPU_MODEL_PENTIUMOVERDRIVEDX4 = 4;
 
AL_CPU_MODEL_CYRIX = 14;
 
AL_CPU_MODEL_UNKNOWN = 15;
 
AL_CPU_MODEL_K5 = 0;

AMD/586

AL_CPU_MODEL_K6 = 6;
 
AL_CPU_MODEL_PENTIUMPROA = 0;

Intel/686

AL_CPU_MODEL_PENTIUMPRO = 1;
 
AL_CPU_MODEL_PENTIUMIIKLAMATH = 3;
 
AL_CPU_MODEL_PENTIUMII = 5;
 
AL_CPU_MODEL_CELERON = 6;
 
AL_CPU_MODEL_PENTIUMIIIKATMAI = 7;
 
AL_CPU_MODEL_PENTIUMIIICOPPERMINE = 8;
 
AL_CPU_MODEL_PENTIUMIIIMOBILE = 9;
 
AL_CPU_MODEL_ATHLON = 2;

AMD/686

AL_CPU_MODEL_DURON = 3;
 
AL_CPU_MODEL_PENTIUMIV = 0;

Information when CPU_FAMILY is 15

AL_CPU_MODEL_XEON = 2;
 
AL_CPU_MODEL_ATHLON64 = 4;
 
AL_CPU_MODEL_OPTERON = 5;
 
AL_CPU_MODEL_POWERPC_601 = 1;

these defines are taken from <mach-o/machine.h>

AL_CPU_MODEL_POWERPC_602 = 2;
 
AL_CPU_MODEL_POWERPC_603 = 3;
 
AL_CPU_MODEL_POWERPC_603e = 4;
 
AL_CPU_MODEL_POWERPC_603ev = 5;
 
AL_CPU_MODEL_POWERPC_604 = 6;
 
AL_CPU_MODEL_POWERPC_604e = 7;
 
AL_CPU_MODEL_POWERPC_620 = 8;
 
AL_CPU_MODEL_POWERPC_750 = 9;
 
AL_CPU_MODEL_POWERPC_7400 = 10;
 
AL_CPU_MODEL_POWERPC_7450 = 11;
 
AL_KEY_A = 1;

Key scan-code identifiers.

AL_KEY_B = 2;
 
AL_KEY_C = 3;
 
AL_KEY_D = 4;
 
AL_KEY_E = 5;
 
AL_KEY_F = 6;
 
AL_KEY_G = 7;
 
AL_KEY_H = 8;
 
AL_KEY_I = 9;
 
AL_KEY_J = 10;
 
AL_KEY_K = 11;
 
AL_KEY_L = 12;
 
AL_KEY_M = 13;
 
AL_KEY_N = 14;
 
AL_KEY_O = 15;
 
AL_KEY_P = 16;
 
AL_KEY_Q = 17;
 
AL_KEY_R = 18;
 
AL_KEY_S = 19;
 
AL_KEY_T = 20;
 
AL_KEY_U = 21;
 
AL_KEY_V = 22;
 
AL_KEY_W = 23;
 
AL_KEY_X = 24;
 
AL_KEY_Y = 25;
 
AL_KEY_Z = 26;
 
AL_KEY_0 = 27;
 
AL_KEY_1 = 28;
 
AL_KEY_2 = 29;
 
AL_KEY_3 = 30;
 
AL_KEY_4 = 31;
 
AL_KEY_5 = 32;
 
AL_KEY_6 = 33;
 
AL_KEY_7 = 34;
 
AL_KEY_8 = 35;
 
AL_KEY_9 = 36;
 
AL_KEY_0_PAD = 37;
 
AL_KEY_1_PAD = 38;
 
AL_KEY_2_PAD = 39;
 
AL_KEY_3_PAD = 40;
 
AL_KEY_4_PAD = 41;
 
AL_KEY_5_PAD = 42;
 
AL_KEY_6_PAD = 43;
 
AL_KEY_7_PAD = 44;
 
AL_KEY_8_PAD = 45;
 
AL_KEY_9_PAD = 46;
 
AL_KEY_F1 = 47;
 
AL_KEY_F2 = 48;
 
AL_KEY_F3 = 49;
 
AL_KEY_F4 = 50;
 
AL_KEY_F5 = 51;
 
AL_KEY_F6 = 52;
 
AL_KEY_F7 = 53;
 
AL_KEY_F8 = 54;
 
AL_KEY_F9 = 55;
 
AL_KEY_F10 = 56;
 
AL_KEY_F11 = 57;
 
AL_KEY_F12 = 58;
 
AL_KEY_ESC = 59;
 
AL_KEY_TILDE = 60;
 
AL_KEY_MINUS = 61;
 
AL_KEY_EQUALS = 62;
 
AL_KEY_BACKSPACE = 63;
 
AL_KEY_TAB = 64;
 
AL_KEY_OPENBRACE = 65;
 
AL_KEY_CLOSEBRACE = 66;
 
AL_KEY_ENTER = 67;
 
AL_KEY_COLON = 68;
 
AL_KEY_QUOTE = 69;
 
AL_KEY_BACKSLASH = 70;
 
AL_KEY_BACKSLASH2 = 71;
 
AL_KEY_COMMA = 72;
 
AL_KEY_STOP = 73;
 
AL_KEY_SLASH = 74;
 
AL_KEY_SPACE = 75;
 
AL_KEY_INSERT = 76;
 
AL_KEY_DEL = 77;
 
AL_KEY_HOME = 78;
 
AL_KEY_END = 79;
 
AL_KEY_PGUP = 80;
 
AL_KEY_PGDN = 81;
 
AL_KEY_LEFT = 82;
 
AL_KEY_RIGHT = 83;
 
AL_KEY_UP = 84;
 
AL_KEY_DOWN = 85;
 
AL_KEY_SLASH_PAD = 86;
 
AL_KEY_ASTERISK = 87;
 
AL_KEY_MINUS_PAD = 88;
 
AL_KEY_PLUS_PAD = 89;
 
AL_KEY_DEL_PAD = 90;
 
AL_KEY_ENTER_PAD = 91;
 
AL_KEY_PRTSCR = 92;
 
AL_KEY_PAUSE = 93;
 
AL_KEY_ABNT_C1 = 94;
 
AL_KEY_YEN = 95;
 
AL_KEY_KANA = 96;
 
AL_KEY_CONVERT = 97;
 
AL_KEY_NOCONVERT = 98;
 
AL_KEY_AT = 99;
 
AL_KEY_CIRCUMFLEX = 100;
 
AL_KEY_COLON2 = 101;
 
AL_KEY_KANJI = 102;
 
AL_KEY_EQUALS_PAD = 103;
 
AL_KEY_BACKQUOTE = 104;

MacOS X

AL_KEY_SEMICOLON = 105;

MacOS X

AL_KEY_COMMAND = 106;

MacOS X

AL_KEY_UNKNOWN1 = 107;

MacOS X

AL_KEY_UNKNOWN2 = 108;
 
AL_KEY_UNKNOWN3 = 109;
 
AL_KEY_UNKNOWN4 = 110;
 
AL_KEY_UNKNOWN5 = 111;
 
AL_KEY_UNKNOWN6 = 112;
 
AL_KEY_UNKNOWN7 = 113;
 
AL_KEY_UNKNOWN8 = 114;
 
AL_KEY_MODIFIERS = 115;
 
AL_KEY_LSHIFT = 115;
 
AL_KEY_RSHIFT = 116;
 
AL_KEY_LCONTROL = 117;
 
AL_KEY_RCONTROL = 118;
 
AL_KEY_ALT = 119;
 
AL_KEY_ALTGR = 120;
 
AL_KEY_LWIN = 121;
 
AL_KEY_RWIN = 122;
 
AL_KEY_MENU = 123;
 
AL_KEY_SCRLOCK = 124;
 
AL_KEY_NUMLOCK = 125;
 
AL_KEY_CAPSLOCK = 126;
 
AL_KEY_MAX = 127;
 
AL_KB_SHIFT_FLAG = $0001;

Shift keys flags.

AL_KB_CTRL_FLAG = $0002;
 
AL_KB_ALT_FLAG = $0004;
 
AL_KB_LWIN_FLAG = $0008;
 
AL_KB_RWIN_FLAG = $0010;
 
AL_KB_MENU_FLAG = $0020;
 
AL_KB_COMMAND_FLAG = $0040;
 
AL_KB_SCROLOCK_FLAG = $0100;
 
AL_KB_NUMLOCK_FLAG = $0200;
 
AL_KB_CAPSLOCK_FLAG = $0400;
 
AL_KB_INALTSEQ_FLAG = $0800;
 
AL_KB_ACCENT1_FLAG = $1000;
 
AL_KB_ACCENT2_FLAG = $2000;
 
AL_KB_ACCENT3_FLAG = $4000;
 
AL_KB_ACCENT4_FLAG = $8000;
 
AL_JOY_TYPE_AUTODETECT = -1;

Attempts to autodetect your joystick hardware. It will use information from the configuration file if one is available (this can be created using the setup utility or by calling the al_save_joystick_data function), so you can always use AL_JOY_TYPE_AUTODETECT in your code and then select the exact hardware type from the setup program. .

See also
al_save_joystick_data
After all the headache of calibrating the joystick, you may not want to make your poor users repeat the process every time they run your program.
al_install_joystick
Installs Allegro's joystick handler, and calibrates the centre position values.
AL_JOY_TYPE_NONE = 0;

Dummy driver for machines without any joystick.

See also
al_install_joystick
Installs Allegro's joystick handler, and calibrates the centre position values.
AL_MAX_JOYSTICKS = 8;

Maximun number of elements.

AL_MAX_JOYSTICK_AXIS = 3;
 
AL_MAX_JOYSTICK_STICKS = 5;
 
AL_MAX_JOYSTICK_BUTTONS = 32;
 
AL_JOYFLAG_DIGITAL = 1;

joystick status flags.

See also
AL_JOYSTICK_INFO
information about an entire joystick.
AL_JOYFLAG_ANALOGUE = 2;
 
AL_JOYFLAG_CALIB_DIGITAL = 4;
 
AL_JOYFLAG_CALIB_ANALOGUE = 8;
 
AL_JOYFLAG_CALIBRATE = 16;
 
AL_JOYFLAG_SIGNED = 32;
 
AL_JOYFLAG_UNSIGNED = 64;
 
AL_JOYFLAG_ANALOG = AL_JOYFLAG_ANALOGUE;
 
AL_JOYFLAG_CALIB_ANALOG = AL_JOYFLAG_CALIB_ANALOGUE;
 
AL_PAL_SIZE = 256;

To know the palette size.

See also
AL_PALETTE
Color palette description for indexed modes (8bpp).
AL_GFX_TEXT = -1;

Closes any previously opened graphics mode, making you unable to use the global variable al_screen, and in those environments that have text modes, sets one previously used or the closest match to that (usually 80x25). With this driver the size parameters of al_set_gfx_mode don't mean anything, so you can leave them all to zero or any other number you prefer.

AL_GFX_AUTODETECT = 0;

Allegro will try to set the specified resolution with the current color depth in fullscreen mode. Failing that, it will try to repeat the same operation in windowed mode. If the call to al_set_gfx_mode succeeds, you are guaranteed to have set the specified resolution in the current color depth, but you don't know if the program is running fullscreen or windowed.

AL_GFX_AUTODETECT_FULLSCREEN = 1;

Allegro will try to set the specified resolution with the current color depth in fullscreen mode. If that is not possible, al_set_gfx_mode will fail.

AL_GFX_AUTODETECT_WINDOWED = 2;

Allegro will try to set the specified resolution with the current color depth in a windowed mode. If that is not possible, al_set_gfx_mode will fail. When it comes to windowed modes, the `specified resolution' actually means the graphic area your program can draw on, without including window decorations (if any). Note that in windowed modes running with a color depth other than the desktop may result in non optimal performance due to internal color conversions in the graphic driver. Use al_desktop_color_depth to your advantage in these situations.

AL_GFX_SAFE = $53414645;

Using this driver Allegro guarantees that a graphic mode will always be set correctly. It will try to select the resolution that you request, and if that fails, it will fall back upon whatever mode is known to be reliable on the current platform (this is 640x480 resolution under Windows, the actual framebuffer's resolution under Linux if it's supported, etc). If it absolutely cannot set any graphics mode at all, it will return False as usual, meaning that there's no possible video output on the machine, and that you should abort your program immediately, possibly after notifying this to the user with al_message. This fake driver is useful for situations where you just want to get into some kind of workable display mode, and can't be bothered with trying multiple different resolutions and doing all the error checking yourself. Note however, that after a successful call to al_set_gfx_mode with this driver, you cannot make any assumptions about the width, height or color depth of the screen: your code will have to deal with this little detail.

AL_GFX_NONE = $4E4F4E45;

No graphics mode.

AL_COLORCONV_NONE = 0;

Define color conversion modes.

AL_COLORCONV_8_TO_15 = 1;
 
AL_COLORCONV_8_TO_16 = 2;
 
AL_COLORCONV_8_TO_24 = 4;
 
AL_COLORCONV_8_TO_32 = 8;
 
AL_COLORCONV_15_TO_8 = $10;
 
AL_COLORCONV_15_TO_16 = $20;
 
AL_COLORCONV_15_TO_24 = $40;
 
AL_COLORCONV_15_TO_32 = $80;
 
AL_COLORCONV_16_TO_8 = $100;
 
AL_COLORCONV_16_TO_15 = $200;
 
AL_COLORCONV_16_TO_24 = $400;
 
AL_COLORCONV_16_TO_32 = $800;
 
AL_COLORCONV_24_TO_8 = $1000;
 
AL_COLORCONV_24_TO_15 = $2000;
 
AL_COLORCONV_24_TO_16 = $4000;
 
AL_COLORCONV_24_TO_32 = $8000;
 
AL_COLORCONV_32_TO_8 = $10000;
 
AL_COLORCONV_32_TO_15 = $20000;
 
AL_COLORCONV_32_TO_16 = $40000;
 
AL_COLORCONV_32_TO_24 = $80000;
 
AL_COLORCONV_32A_TO_8 = $100000;
 
AL_COLORCONV_32A_TO_15 = $200000;
 
AL_COLORCONV_32A_TO_16 = $400000;
 
AL_COLORCONV_32A_TO_24 = $800000;
 
AL_COLORCONV_DITHER_PAL = $1000000;
 
AL_COLORCONV_DITHER_HI = $2000000;
 
AL_COLORCONV_KEEP_TRANS = $4000000;
 
AL_COLORCONV_DITHER = AL_COLORCONV_DITHER_PAL OR AL_COLORCONV_DITHER_HI;
 
AL_COLORCONV_EXPAND_256 = AL_COLORCONV_8_TO_15 OR AL_COLORCONV_8_TO_16 OR AL_COLORCONV_8_TO_24 OR AL_COLORCONV_8_TO_32;
 
AL_COLORCONV_REDUCE_TO_256 = AL_COLORCONV_15_TO_8 OR AL_COLORCONV_16_TO_8 OR AL_COLORCONV_24_TO_8 OR AL_COLORCONV_32_TO_8 OR AL_COLORCONV_32A_TO_8;
 
AL_COLORCONV_EXPAND_15_TO_16 = AL_COLORCONV_15_TO_16;
 
AL_COLORCONV_REDUCE_16_TO_15 = AL_COLORCONV_16_TO_15;
 
AL_COLORCONV_EXPAND_HI_TO_TRUE = AL_COLORCONV_15_TO_24 OR AL_COLORCONV_15_TO_32 OR AL_COLORCONV_16_TO_24 OR AL_COLORCONV_16_TO_32;
 
AL_COLORCONV_REDUCE_TRUE_TO_HI = AL_COLORCONV_24_TO_15 OR AL_COLORCONV_24_TO_16 OR AL_COLORCONV_32_TO_15 OR AL_COLORCONV_32_TO_16;
 
AL_COLORCONV_24_EQUALS_32 = AL_COLORCONV_24_TO_32 OR AL_COLORCONV_32_TO_24;
 
AL_COLORCONV_TOTAL = AL_COLORCONV_EXPAND_256 OR AL_COLORCONV_REDUCE_TO_256 OR AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_EXPAND_HI_TO_TRUE OR AL_COLORCONV_REDUCE_TRUE_TO_HI OR AL_COLORCONV_24_EQUALS_32 OR AL_COLORCONV_32A_TO_15 OR AL_COLORCONV_32A_TO_16 OR AL_COLORCONV_32A_TO_24;
 
AL_COLORCONV_PARTIAL = AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_24_EQUALS_32;
 
AL_COLORCONV_MOST = AL_COLORCONV_EXPAND_15_TO_16 OR AL_COLORCONV_REDUCE_16_TO_15 OR AL_COLORCONV_EXPAND_HI_TO_TRUE OR AL_COLORCONV_REDUCE_TRUE_TO_HI OR AL_COLORCONV_24_EQUALS_32;
 
AL_COLORCONV_KEEP_ALPHA = AL_COLORCONV_TOTAL AND NOT (AL_COLORCONV_32A_TO_8 OR AL_COLORCONV_32A_TO_15 OR AL_COLORCONV_32A_TO_16 OR AL_COLORCONV_32A_TO_24);
 
AL_GFX_CAN_SCROLL = $00000001;

Indicates that the al_scroll_screen function may be used with this driver.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_CAN_TRIPLE_BUFFER = $00000002;

Indicates that the al_request_scroll and al_poll_scroll functions may be used with this driver. If this flag is not set, it is possible that the al_enable_triple_buffer function may be able to activate it.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_CURSOR = $00000004;

Indicates that a hardware mouse cursor is in use. When this flag is set, it is safe to draw onto the screen without hiding the mouse pointer first. Note that not every cursor graphic can be implemented in hardware: in particular VBE/AF only supports 2-color images up to 32x32 in size, where the second color is an exact inverse of the first. This means that Allegro may need to switch between hardware and software cursors at any point during the execution of your program, so you should not assume that this flag will remain constant for long periods of time. It only tells you whether a hardware cursor is in use at the current time, and may change whenever you hide/redisplay the pointer.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_HLINE = $00000008;

Indicates that the normal opaque version of the al_hline function is implemented using a hardware accelerator. This will improve the performance not only of al_hline itself, but also of many other functions that use it as a workhorse, for example al_circlefill and al_floodfill.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_HLINE_XOR = $00000010;

Indicates that the XOR version of the al_hline function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator (see AL_GFX_HW_HLINE).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_HLINE_SOLID_PATTERN = $00000020;

Indicates that the solid and masked pattern modes of the al_hline function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator (see AL_GFX_HW_HLINE).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_HLINE_COPY_PATTERN = $00000040;

Indicates that the copy pattern modes of the al_hline function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator (see AL_GFX_HW_HLINE).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_FILL = $00000080;

Indicates that the opaque version of the al_rectfill function, the al_clear_bitmap routine, and al_clear_to_color, are implemented using a hardware accelerator.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_FILL_XOR = $00000100;

Indicates that the XOR version of the al_rectfill function is implemented using a hardware accelerator (see AL_GFX_HW_FILL).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_FILL_SOLID_PATTERN = $00000200;

Indicates that the solid and masked pattern modes of the al_rectfill function is implemented using a hardware accelerator (see AL_GFX_HW_FILL).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_FILL_COPY_PATTERN = $00000400;

Indicates that the copy pattern mode of the al_rectfill function is implemented using a hardware accelerator (see AL_GFX_HW_FILL).

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_LINE = $00000800;

Indicates that the opaque mode al_line and al_vline functions are implemented using a hardware accelerator.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_LINE_XOR = $00001000;

Indicates that the XOR version of the al_line and al_vline functions are implemented using a hardware accelerator.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_GLYPH = $00008000;

Indicates that monochrome character expansion (for text drawing) is implemented using a hardware accelerator.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_VRAM_BLIT = $00010000;

Indicates that blitting from one part of the screen to another is implemented using a hardware accelerator. If this flag is set, blitting within the video memory will almost certainly be the fastest possible way to display an image, so it may be worth storing some of your more frequently used graphics in an offscreen portion of the video memory.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_VRAM_BLIT_MASKED = $00020000;

Indicates that the al_masked_blit routine is capable of a hardware accelerated copy from one part of video memory to another, and that al_draw_sprite will use a hardware copy when given a sub-bitmap of the screen or a video memory bitmap as the source image. If this flag is set, copying within the video memory will almost certainly be the fastest possible way to display an image, so it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.

Warning: if this flag is not set, al_masked_blit and al_draw_sprite will not work correctly when used with a video memory source image! You must only try to use these functions to copy within the video memory if they are supported in hardware.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_MEM_BLIT = $00040000;

Indicates that blitting from a memory bitmap onto the screen is being accelerated in hardware.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_MEM_BLIT_MASKED = $00080000;

Indicates that the al_masked_blit and al_draw_sprite functions are being accelerated in hardware when the source image is a memory bitmap and the destination is the physical screen.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_SYS_TO_VRAM_BLIT = $00100000;

Indicates that blitting from a system bitmap onto the screen is being accelerated in hardware. Note that some acceleration may be present even if this flag is not set, because system bitmaps can benefit from normal memory to screen blitting as well. This flag will only be set if system bitmaps have further acceleration above and beyond what is provided by AL_GFX_HW_MEM_BLIT.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_HW_SYS_TO_VRAM_BLIT_MASKED = $00200000;

Indicates that the al_masked_blit and al_draw_sprite functions are being accelerated in hardware when the source image is a system bitmap and the destination is the physical screen. Note that some acceleration may be present even if this flag is not set, because system bitmaps can benefit from normal memory to screen blitting as well. This flag will only be set if system bitmaps have further acceleration above and beyond what is provided by AL_GFX_HW_MEM_BLIT_MASKED.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_GFX_SYSTEM_CURSOR = $00400000;

Indicates that the mouse cursor is the default system cursor, not Allegro's custom cursor.

See also
al_gfx_capabilities
Bitfield describing the capabilities of the current graphics driver and video hardware.
AL_MOUSE_CURSOR_NONE = 0;

Indicates that the mouse cursor is the default system cursor, not Allegro's custom cursor.

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_MOUSE_CURSOR_ALLEGRO = 1;

Selects the custom Allegro cursor, i.e. the one that you set with al_set_mouse_sprite.

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_MOUSE_CURSOR_ARROW = 2;

The operating system default arrow cursor.

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_MOUSE_CURSOR_BUSY = 3;

The operating system default `busy' cursor (hourglass).

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_MOUSE_CURSOR_QUESTION = 4;

The operating system default `question' cursor (arrow with question mark).

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_MOUSE_CURSOR_EDIT = 5;

The operating system default `edit' cursor (vertical bar).

See also
al_select_mouse_cursor
This function allows you to use the operating system's native mouse cursors rather than some custom cursor.
AL_DRAW_MODE_SOLID = 0;

Flag for al_drawing_mode.

The pixels of the bitmap being drawn onto are simply replaced by those produced by the drawing function.

AL_DRAW_MODE_XOR = 1;

Flag for al_drawing_mode.

Pixels are written to the bitmap with an exclusive-or operation rather than a simple copy, so drawing the same shape twice will erase it. Because it involves reading as well as writing the bitmap memory, xor drawing is a lot slower than the normal replace mode.

AL_DRAW_MODE_COPY_PATTERN = 2;

Flag for al_drawing_mode.

Pixels are simply copied from the pattern bitmap onto the destination bitmap. This allows the use of multicolored patterns, and means that the color you pass to the drawing routine is ignored. This is the fastest of the patterned modes.

AL_DRAW_MODE_SOLID_PATTERN = 3;

Flag for al_drawing_mode.

Each pixel in the pattern bitmap is compared with the mask color, which is zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green). If the pattern pixel is solid, a pixel of the color you passed to the drawing routine is written to the destination bitmap, otherwise a zero is written. The pattern is thus treated as a monochrome bitmask, which lets you use the same pattern to draw different shapes in different colors, but prevents the use of multicolored patterns.

AL_DRAW_MODE_MASKED_PATTERN = 4;

Flag for al_drawing_mode.

It is almost the same as AL_DRAW_MODE_SOLID_PATTERN, but the masked pixels are skipped rather than being written as zeros, so the background shows through the gaps.

AL_DRAW_MODE_TRANS = 5;

Flag for al_drawing_mode.

The global al_color_table table or truecolor blender functions are used to overlay pixels on top of the existing image. This must only be used after you have set up the color mapping table (for 256 color modes) or blender functions (for truecolor modes). Because it involves reading as well as writing the bitmap memory, translucent drawing is very slow if you draw directly to video RAM, so wherever possible you should use a memory bitmap instead.

AL_MIDI_AUTODETECT = -1;

Identifier to pass to al_install_sound.

AL_MIDI_NONE = 0;

Identifier to pass to al_install_sound.

AL_MIDI_DIGMID = $44494749;

Identifier to pass to al_install_sound.

AL_MIDI_VOICES = 64;

Max number of MIDI voices.

AL_MIDI_TRACKS = 32;

Max number of MIDI tracks.

AL_DIGI_AUTODETECT = -1;

Identifier to pass to al_install_sound.

AL_DIGI_NONE = 0;

Identifier to pass to al_install_sound.

AL_DIGI_VOICES = 64;

Max number of digital voices.

AL_PLAYMODE_PLAY = 0;

Plays the sample a single time. This is the default if you don't set the loop flag.

See also
al_voice_set_playmode
Adjusts the loop status of the specified voice.
AL_PLAYMODE_LOOP = 1;

Loops repeatedly through the sample, jumping back to the loop start position upon reaching the loop end.

See also
al_voice_set_playmode
Adjusts the loop status of the specified voice.
AL_PLAYMODE_FORWARD = 0;

Plays the sample from beginning to end. This is the default if you don't set the backward flag.

See also
al_voice_set_playmode
Adjusts the loop status of the specified voice.
AL_PLAYMODE_BACKWARD = 2;

Reverses the direction of the sample. If you combine this with the loop flag, the sample jumps to the loop end position upon reaching the loop start (ie. you do not need to reverse the loop start and end values when you play the sample in reverse).

See also
al_voice_set_playmode
Adjusts the loop status of the specified voice.
AL_PLAYMODE_BIDIR = 4;

When used in combination with the loop flag, causes the sample to change direction each time it reaches one of the loop points, so it alternates between playing forwards and in reverse.

See also
al_voice_set_playmode
Adjusts the loop status of the specified voice.

Variables

al_errno: AL_INTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_errno';

Stores the last error number.

al_id_string: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_id';

Text string containing a date and version number for the library, in case you want to display these somewhere.

al_error: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_error';

Text string used by al_set_gfx_mode, al_install_sound and other functions to report error messages. If they fail and you want to tell the user why, this is the place to look for a description of the problem.

al_os_type: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_type';

Identifies the Operating System.

Set by al_init to one of the values:

    AL_OSTYPE_UNKNOWN    - unknown, or regular MSDOS

    AL_OSTYPE_WIN3       - Windows 3.1 or earlier
    AL_OSTYPE_WIN95      - Windows 95
    AL_OSTYPE_WIN98      - Windows 98
    AL_OSTYPE_WINME      - Windows ME
    AL_OSTYPE_WINNT      - Windows NT
    AL_OSTYPE_WIN2000    - Windows 2000
    AL_OSTYPE_WINXP      - Windows XP
    AL_OSTYPE_WIN2003    - Windows 2003
    AL_OSTYPE_WINVISTA   - Windows Vista
    AL_OSTYPE_WIN7       - Windows 7

    AL_OSTYPE_OS2        - OS/2
    AL_OSTYPE_WARP       - OS/2 Warp 3

    AL_OSTYPE_LINUX      - Linux
    AL_OSTYPE_SUNOS      - SunOS/Solaris
    AL_OSTYPE_FREEBSD    - FreeBSD
    AL_OSTYPE_NETBSD     - NetBSD
    AL_OSTYPE_IRIX       - IRIX
    AL_OSTYPE_QNX        - QNX
    AL_OSTYPE_UNIX       - Unknown Unix variant

    AL_OSTYPE_BEOS       - BeOS
    AL_OSTYPE_HAIKU      - Haiku OS

    AL_OSTYPE_DARWIN     - Darwin
    AL_OSTYPE_MACOS      - MacOS
    AL_OSTYPE_MACOSX     - MacOS X
 

See also
al_init
Function which initialises the Allegro library.
al_os_version
The major version of the Operating System currently running.
al_os_multitasking
Set by al_init to either True or False depending on whether your Operating System is multitasking or not.
al_os_version: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_version';

The major version of the Operating System currently running. Set by al_init. If Allegro for some reason was not able to retrieve the version of the Operating System, al_os_version will be set to -1.

For example: Under Win98 SE (v4.10.2222) al_os_version will be set to 4.

See also
al_os_type
Identifies the Operating System.
al_os_revision
The minor version of the Operating System currently running.
al_os_multitasking
Set by al_init to either True or False depending on whether your Operating System is multitasking or not.
al_os_revision: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_revision';

The minor version of the Operating System currently running. Set by al_init. If Allegro for some reason was not able to retrieve the version of the Operating System, al_os_revision will be set to -1.

For example: Under Win98 SE (v4.10.2222) al_os_revision will be set to 10.

See also
al_os_type
Identifies the Operating System.
al_os_version
The major version of the Operating System currently running.
al_os_multitasking
Set by al_init to either True or False depending on whether your Operating System is multitasking or not.
al_os_multitasking: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'os_multitasking';

Set by al_init to either True or False depending on whether your Operating System is multitasking or not.

See also
al_os_type
Identifies the Operating System.
al_os_version
The major version of the Operating System currently running.
al_cpu_vendor: AL_STRptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_vendor';

On Intel PCs, contains the CPU vendor name if known. On Mac OSX systems this contains the PPC subtype name. On other platforms, this may be an empty string. You can read this variable after you have called al_check_cpu (which is automatically called by al_init).

See also
al_cpu_family
Contains the CPU type, where applicable.
al_cpu_model
Contains the CPU submodel, where applicable.
al_cpu_capabilities
Contains CPU flags indicating what features are available on the current CPU.
al_cpu_family: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_family';

Contains the CPU type, where applicable. Allegro defines the following CPU family types:

  • AL_CPU_FAMILY_UNKNOWN - The type of processor is unknown

  • AL_CPU_FAMILY_I386 - The processor is an Intel-compatible 386

  • AL_CPU_FAMILY_I486 - The processor is an Intel-compatible 486

  • AL_CPU_FAMILY_I586 - The processor is a Pentium or equivalent

  • AL_CPU_FAMILY_I686 - The processor is a Pentium Pro, II, III or equivalent

  • AL_CPU_FAMILY_ITANIUM - The processor is an Itanium processor

  • AL_CPU_FAMILY_POWERPC - The processor is a PowerPC processor

  • AL_CPU_FAMILY_EXTENDED - The processor type needs to be read from the cpu_model

You can read this variable after you have called al_check_cpu (which is automatically called by al_init).

See also
al_cpu_vendor
On Intel PCs, contains the CPU vendor name if known.
al_cpu_model
Contains the CPU submodel, where applicable.
al_cpu_capabilities
Contains CPU flags indicating what features are available on the current CPU.
al_cpu_model: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_model';

Contains the CPU submodel, where applicable. Allegro defines at least the following CPU family types (see lib/alcpu.inc for a more complete list):

  AL_CPU_FAMILY_I586:
     AL_CPU_MODEL_PENTIUM, AL_CPU_MODEL_K5, AL_CPU_MODEL_K6

  AL_CPU_FAMILY_I686:
     AL_CPU_MODEL_PENTIUMPRO, AL_CPU_MODEL_PENTIUMII,
     AL_CPU_MODEL_PENTIUMIIIKATMAI, AL_CPU_MODEL_PENTIUMIIICOPPERMINE,
     AL_CPU_MODEL_ATHLON, AL_CPU_MODEL_DURON

  AL_CPU_FAMILY_EXTENDED:
     AL_CPU_MODEL_PENTIUMIV, AL_CPU_MODEL_XEON,
     AL_CPU_MODEL_ATHLON64, AL_CPU_MODEL_OPTERON

  AL_CPU_FAMILY_POWERPC:
     AL_CPU_MODEL_POWERPC_x, for x=601-604, 620, 750, 7400, 7450

You can read this variable after you have called al_check_cpu (which is automatically called by al_init. Make sure you check the al_cpu_family and al_cpu_vendor so you know which models make sense to check.

See also
al_cpu_capabilities
Contains CPU flags indicating what features are available on the current CPU.
al_cpu_capabilities: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_capabilities';

Contains CPU flags indicating what features are available on the current CPU. The flags can be any combination of these:

  • AL_CPU_ID: Indicates that the "cpuid" instruction is available. If this is set, then all Allegro CPU variables are 100% reliable, otherwise there may be some mistakes.

  • AL_CPU_FPU: An FPU is available.

  • AL_CPU_IA64: Running on Intel 64 bit CPU

  • AL_CPU_AMD64: Running on AMD 64 bit CPU

  • AL_CPU_MMX: Intel MMX instruction set is available.

  • AL_CPU_MMXPLUS: Intel MMX+ instruction set is available.

  • AL_CPU_SSE: Intel SSE instruction set is available.

  • AL_CPU_SSE2: Intel SSE2 instruction set is available.

  • AL_CPU_SSE3: Intel SSE3 instruction set is available.

  • AL_CPU_3DNOW: AMD 3DNow! instruction set is available.

  • AL_CPU_ENH3DNOW: AMD Enhanced 3DNow! instruction set is available.

  • AL_CPU_CMOV: Pentium Pro "cmov" instruction is available.

You can check for multiple features by OR-ing the flags together. For example, to check if the CPU has an FPU and MMX instructions available, you'd do:

  IF al_cpu_capabilities AND (AL_CPU_FPU OR AL_CPU_MMX = AL_CPU_FPU OR AL_CPU_MMX) THEN
    WriteLn ('CPU has both an FPU and MMX instructions!');

You can read this variable after you have called al_check_cpu (which is automatically called by al_init.

See also
al_cpu_vendor
On Intel PCs, contains the CPU vendor name if known.
al_cpu_family
Contains the CPU type, where applicable.
al_cpu_model
Contains the CPU submodel, where applicable.
al_retrace_count: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'retrace_count';

If the retrace simulator is installed, this count is incremented on each vertical retrace; otherwise, if the refresh rate is known, the count is incremented at the same rate (ignoring retraces); otherwise, it is incremented 70 times a second. This provides a way of controlling the speed of your program without installing user timer functions.

al_keyboard_lowlevel_callback: AL_INT_PROC; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'keyboard_lowlevel_callback';

If set, this function is called by the keyboard handler in response to every keyboard event, both presses (including keyboard repeat rate) and releases. It will be passed a raw keyboard scancode byte (scancodes are 7 bits long), with the top bit (8th bit) clear if the key has been pressed or set if it was released. This routine executes in an interrupt context, so it must be used carefully and only if needed.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_key: AL_KEY_LIST; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key';

Array of flags indicating the state of each key, ordered by scancode. Wherever possible these values will be updated asynchronously, but if al_keyboard_needs_poll returns True, you must manually call al_poll_keyboard to update them with the current input state. The scancodes are defined as a series of AL_KEY_* constants (and are also listed below). For example, you could write:

  IF al_key[AL_KEY_SPACE] THEN
    WriteLn ('Space is pressed');
     

Note that the array is supposed to represent which keys are physically held down and which keys are not, so it is semantically read-only.

These are the keyboard scancodes:

          AL_KEY_A ... AL_KEY_Z,
          AL_KEY_0 ... AL_KEY_9,
          AL_KEY_0_PAD ... AL_KEY_9_PAD,
          AL_KEY_F1 ... AL_KEY_F12,

          AL_KEY_ESC, AL_KEY_TILDE, AL_KEY_MINUS, AL_KEY_EQUALS,
          AL_KEY_BACKSPACE, AL_KEY_TAB, AL_KEY_OPENBRACE, AL_KEY_CLOSEBRACE,
          AL_KEY_ENTER, AL_KEY_COLON, AL_KEY_QUOTE, AL_KEY_BACKSLASH,
          AL_KEY_BACKSLASH2, AL_KEY_COMMA, AL_KEY_STOP, AL_KEY_SLASH,
          AL_KEY_SPACE,

          AL_KEY_INSERT, AL_KEY_DEL, AL_KEY_HOME, AL_KEY_END, AL_KEY_PGUP,
          AL_KEY_PGDN, AL_KEY_LEFT, AL_KEY_RIGHT, AL_KEY_UP, AL_KEY_DOWN,

          AL_KEY_SLASH_PAD, AL_KEY_ASTERISK, AL_KEY_MINUS_PAD,
          AL_KEY_PLUS_PAD, AL_KEY_DEL_PAD, AL_KEY_ENTER_PAD,

          AL_KEY_PRTSCR, AL_KEY_PAUSE,

          AL_KEY_ABNT_C1, AL_KEY_YEN, AL_KEY_KANA, AL_KEY_CONVERT,
          AL_KEY_NOCONVERT, AL_KEY_AT, AL_KEY_CIRCUMFLEX, AL_KEY_COLON2,
          AL_KEY_KANJI,

          AL_KEY_LSHIFT, AL_KEY_RSHIFT,
          AL_KEY_LCONTROL, AL_KEY_RCONTROL,
          AL_KEY_ALT, AL_KEY_ALTGR,
          AL_KEY_LWIN, AL_KEY_RWIN, AL_KEY_MENU,
          AL_KEY_SCRLOCK, AL_KEY_NUMLOCK, AL_KEY_CAPSLOCK,

          AL_KEY_EQUALS_PAD, AL_KEY_BACKQUOTE, AL_KEY_SEMICOLON, AL_KEY_COMMAND
     

Finally, you may notice an `odd' behaviour of the AL_KEY_PAUSE key. This key only generates an interrupt when it is pressed, not when it is released. For this reason, Allegro pretends the pause key is a `state' key, which is the only way to make it usable.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_poll_keyboard
Wherever possible, Allegro will read the keyboard input asynchronously (ie.
al_key_shifts
Bitmask containing the current state of shift/ctrl/alt, the special Windows keys, and the accent escape characters.
al_key_shifts: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key_shifts';

Bitmask containing the current state of shift/ctrl/alt, the special Windows keys, and the accent escape characters. Wherever possible this value will be updated asynchronously, but if al_keyboard_needs_poll returns True, you must manually call al_poll_keyboard to update it with the current input state. This can contain any of the flags:

          AL_KB_SHIFT_FLAG
          AL_KB_CTRL_FLAG
          AL_KB_ALT_FLAG
          AL_KB_LWIN_FLAG
          AL_KB_RWIN_FLAG
          AL_KB_MENU_FLAG
          AL_KB_COMMAND_FLAG
          AL_KB_SCROLOCK_FLAG
          AL_KB_NUMLOCK_FLAG
          AL_KB_CAPSLOCK_FLAG
          AL_KB_INALTSEQ_FLAG
          AL_KB_ACCENT1_FLAG
          AL_KB_ACCENT2_FLAG
          AL_KB_ACCENT3_FLAG
          AL_KB_ACCENT4_FLAG
     

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_poll_keyboard
Wherever possible, Allegro will read the keyboard input asynchronously (ie.
al_key
Array of flags indicating the state of each key, ordered by scancode.
al_three_finger_flag: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'three_finger_flag';

The DJGPP keyboard handler provides an 'emergency exit' sequence which you can use to kill off your program. If you are running under DOS this is the three finger salute, ctrl+alt+del. Most multitasking OS's will trap this combination before it reaches the Allegro handler, in which case you can use the alternative ctrl+alt+end. If you want to disable this behaviour in release versions of your program, set this flag to True.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_key_led_flag: AL_BOOL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key_led_flag';

By default, the capslock, numlock, and scroll-lock keys toggle the keyboard LED indicators when they are pressed. If you are using these keys for input in your game (eg. capslock to fire) this may not be desirable, so you can set this flag to False and prevent the LED's being updated.

See also
al_install_keyboard
Installs the Allegro keyboard interrupt handler.
al_set_leds
Overrides the state of the keyboard LED indicators.
al_joy: AL_JOYSTICK_INFO_LIST; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'joy';

Global array of joystick state information, which is updated by the al_poll_joystick function. Only the first al_num_joysticks elements will contain meaningful information.

A single joystick may provide several different stick inputs, but you can safely assume that the first element in the stick array will always be the main directional controller.

Information about each of the stick axis is stored in the AL_JOYSTICK_AXIS_INFO substructure.

Note for people who spell funny: in case you don't like having to type (analogue), there are some aliases in this unit that will allow you to write analog instead.

al_num_joysticks: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'num_joysticks';

Global variable containing the number of active joystick devices. The current drivers support a maximum of eight controllers.

See also
al_joy
Global array of joystick state information, which is updated by the al_poll_joystick function.
al_black_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'black_palette';

A palette containing solid black colors, used by the fade routines.

See also
al_desktop_palette
The palette used by the Atari ST low resolution desktop.
al_default_palette
The default IBM BIOS palette.
al_desktop_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'desktop_palette';

The palette used by the Atari ST low resolution desktop. I'm not quite sure why this is still here, except that the original grabber and test programs use it. It is probably the only Atari legacy code left in Allegro, and it would be a shame to remove it :-)

The contents of this palette are 16 colors repeated 16 times. Color entry zero is equal to color entry 16, which is equal to color entry 32, etc.

Index

Color

RGB values

0

White

63 63 63

1

Red

63 0 0

2

Green

0 63 0

3

Yellow

63 63 0

4

Blue

0 0 63

5

Pink

63 0 63

6

Cyan

0 63 63

7

Grey

16 16 16

8

Light grey

31 31 31

9

Light red

63 31 31

10

Light green

31 63 31

11

Light yellow

63 63 31

12

Light blue

31 31 63

13

Light pink

63 31 63

14

Light cyan

31 63 63

15

Black

0 0 0

See also
al_black_palette
A palette containing solid black colors, used by the fade routines.
al_default_palette
The default IBM BIOS palette.
al_default_palette: AL_PALETTE; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'default_palette';

The default IBM BIOS palette. This will be automatically selected whenever you set a new graphics mode. The palette contains 16 basic colors plus many gradients between them. If you want to see the values, you can write a small Allegro program which saves a screenshot with this palette, or open the grabber tool provided with Allegro and create a new palette object, which will use this palette by default.

See also
al_black_palette
A palette containing solid black colors, used by the fade routines.
al_desktop_palette
The palette used by the Atari ST low resolution desktop.
al_rgb_table: AL_RGB_MAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rgb_map';

To speed up reducing RGB values to 8-bit paletted colors, Allegro uses a 32k lookup table (5 bits for each color component). You must set up this table before using the gouraud shading routines, and if present the table will also vastly accelerate the al_makecol and some al_create_*_table functions on 8-bit graphic mode. RGB tables can be precalculated with the rgbmap utility, or generated at runtime with al_create_rgb_table.

See also
al_create_trans_table
Fills the specified color mapping table with lookup data for doing translucency effects with the specified palette.
al_create_light_table
Fills the specified color mapping table with lookup data for doing lighting effects with the specified palette.
al_palette_color: AL_PALETTE_DICTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'palette_color';

Table mapping palette index colors (0-255) into whatever pixel format is being used by the current display mode. In a 256-color mode this just maps onto the array index. In truecolor modes it looks up the specified entry in the current palette, and converts that RGB value into the appropriate packed pixel format.

See also
al_set_palette
Sets the entire palette of 256 colors.
al_makecol
Converts colors from a hardware independent format (red, green, and blue values ranging 0-255) to the pixel format required by the current video mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as appropriate.
al_set_color_depth
Sets the pixel format to be used by subsequent calls to al_set_gfx_mode and al_create_bitmap.
al_screen: AL_BITMAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'screen';

Screen bitmap

AL_SCREEN_W: AL_INT;

Screen size.

AL_SCREEN_H: AL_INT;

Screen size.

AL_VIRTUAL_W: AL_INT;

Screen size.

AL_VIRTUAL_H: AL_INT;

Screen size.

al_gfx_capabilities: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'gfx_capabilities';

Bitfield describing the capabilities of the current graphics driver and video hardware. This may contain combination any of the AL_GFX_* flags.

al_mouse_sprite: AL_BITMAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_sprite';

Global variable containing the current mouse sprite. This is read-only, and only to be modified using the al_set_mouse_sprite procedure.

al_mouse_x_focus: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_x_focus';

Global variable containing the current mouse focus point. This is read-only, and only to be modified using the al_set_mouse_sprite_focus procedure.

al_mouse_y_focus: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_y_focus';

Global variable containing the current mouse focus point. This is read-only, and only to be modified using the al_set_mouse_sprite_focus procedure.

al_mouse_x: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_x';

Global variable containing the current mouse horizontal position. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

The position is integer ranging from zero to the right side of the screen.

See also
al_install_mouse
Installs the Allegro mouse handler.
al_mouse_y: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_y';

Global variable containing the current mouse vertical position. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

The position is integer ranging from zero to the bottom side of the screen.

See also
al_install_mouse
Installs the Allegro mouse handler.
al_mouse_z: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_z';

Global variable containing the current mouse position. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

It holds the current vertical wheel position, when using an input driver that supports wheel mice.

See also
al_install_mouse
Installs the Allegro mouse handler.
al_mouse_w: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_w';

Global variable containing the current mouse position. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

It holds the current horizontal wheel position, when using an input driver that supports wheel mice.

See also
al_install_mouse
Installs the Allegro mouse handler.
al_mouse_b: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_b';

Global variable containing the current mouse button state. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

It is a bitfield indicating the state of each button: bit 0 is the left button, bit 1 the right, and bit 2 the middle button. Additional non standard mouse buttons might be available as higher bits in this variable. Usage example:

IF (al_mouse_b AND 1) <> 0 THEN
   WriteLn ('Left button is pressed');
IF (al_mouse_b AND 2) = 0 THEN
   WriteLn ('Right button is not pressed');
   

See also
al_install_mouse
Installs the Allegro mouse handler.
al_mouse_pos: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'mouse_pos';

Global variable containing the current mouse position. Wherever possible these values will be updated asynchronously, but if al_mouse_needs_poll returns True, you must manually call al_poll_mouse to update them with the current input state.

It has the current X coordinate in the upper 16 bits and the Y in the lower 16 bits. This may be useful in tight polling loops where a mouse interrupt could occur between your reading of the two separate variables, since you can copy this value into a local variable with a single instruction and then split it up at your leisure. Example:

VAR
  mpos, mx, my: INTEGER;
  ...
  mpos := al_mouse_pos;
  mx := mpos SHR 16;
  my := mpos AND $0000ffff;
  

al_font: AL_FONTptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'font';

A simple 8x8 fixed size font (the mode 13h BIOS default). This font contains the standard ASCII (U+20 to U+7F), Latin-1 (U+A1 to U+FF), and Latin Extended-A (U+0100 to U+017F) character ranges.

See also
al_textout_ex
Writes the string onto the bitmap at given position, using the specified font, foreground color and background color.
al_404_char: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_404_char';

When Allegro cannot find a glyph it needs in a font, it will instead output the character given in this variable. By default, this is set to the caret symbol, ˆ, but you can change this global to use any other character instead.

See also
al_font
A simple 8x8 fixed size font (the mode 13h BIOS default).
al_midi_pos: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_pos';

Stores the current position (beat number) in the MIDI file, or contains a negative number if no music is currently playing. Useful for synchronising animations with the music, and for checking whether a MIDI file has finished playing.

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_midi_msg_callback
Hook function allowing you to intercept MIDI player events.
al_midi_time: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_time';

Contains the position in seconds in the currently playing midi. This is useful if you want to display the current song position in seconds, not as beat number.

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.
al_midi_pos
Stores the current position (beat number) in the MIDI file, or contains a negative number if no music is currently playing.
al_get_midi_length
This function will simulate playing the given MIDI, from start to end, to determine how long it takes to play.
al_midi_loop_start: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_loop_start';

The loop start point, set by the al_play_looped_midi function. It may safely be altered while the music is playing, but you should be sure it's always set to sensible values (start < end). If you are changing both start and end points at the same time, make sure to alter them in the right order in case a MIDI interrupt happens to occur in between your two writes! Setting these values to -1 represents the start and end of the file respectively.

See also
al_midi_loop_end
The loop end point, set by the al_play_looped_midi function.
al_midi_loop_end: AL_LONG; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_loop_end';

The loop end point, set by the al_play_looped_midi function. It may safely be altered while the music is playing, but you should be sure it's always set to sensible values (start < end). If you are changing both start and end points at the same time, make sure to alter them in the right order in case a MIDI interrupt happens to occur in between your two writes! Setting these values to -1 represents the start and end of the file respectively.

See also
al_midi_loop_end
The loop end point, set by the al_play_looped_midi function.
al_midi_msg_callback: AL_MIDI_MSG_CALLBACK_PROC; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_msg_callback';

Hook function allowing you to intercept MIDI player events. If set to anything other than Nil, this routine will be called for each MIDI message. It will execute in an interrupt handler context, so all the code and data they use should be locked, and they must not call any operating system functions. In general you just use these routines to set some flags and respond to them later in your mainline code.

See also
al_play_midi
Starts playing the specified MIDI file, first stopping whatever music was previously playing.

Generated by PasDoc 0.13.0 on 2016-07-20 12:01:36