| Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables |
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 Introduction section for a brief description of this unit.
| 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_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. |
FUNCTION AL_ID (str: SHORTSTRING): AL_INT32; |
FUNCTION al_install (system_id: AL_INT): BOOLEAN; INLINE; |
FUNCTION al_init: BOOLEAN; INLINE; |
PROCEDURE al_exit; INLINE; |
PROCEDURE al_message (CONST msg: STRING); |
FUNCTION al_set_close_button_callback (proc: AL_SIMPLE_PROC): BOOLEAN; INLINE; |
PROCEDURE al_check_cpu; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'check_cpu'; |
PROCEDURE al_set_window_title (CONST title: STRING); INLINE; |
FUNCTION al_desktop_color_depth: AL_INT; INLINE; |
FUNCTION al_get_desktop_resolution (VAR w, h: AL_INT): BOOLEAN; INLINE; |
PROCEDURE al_set_uformat (aType: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_uformat'; |
FUNCTION al_get_uformat: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_uformat'; |
PROCEDURE al_set_ucodepage (CONST table, extras: AL_USHORTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_ucodepage'; |
FUNCTION al_ustrlen (s: STRING): AL_INT; INLINE; |
FUNCTION al_uconvert (CONST s: STRING; _type, newtype: AL_INT): STRING; INLINE; |
FUNCTION al_uconvert_ascii (CONST s: STRING): STRING; INLINE; |
FUNCTION al_uconvert_toascii (CONST s: STRING): STRING; INLINE; |
PROCEDURE al_set_config_file (filename: STRING); 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 (filename: STRING); 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 (section, name, def: STRING): STRING; INLINE; |
FUNCTION al_get_config_int (section, name: STRING; def: AL_INT): AL_INT; INLINE; |
FUNCTION al_get_config_hex (section, name: STRING; def: AL_INT): AL_INT; INLINE; |
FUNCTION al_get_config_float (section, name: STRING; def: AL_FLOAT): AL_FLOAT; INLINE; |
FUNCTION al_get_config_id (section, name: STRING; def: AL_INT32): AL_INT32; INLINE; |
PROCEDURE al_set_config_string (section, name, val: STRING); INLINE; |
PROCEDURE al_set_config_int (section, name: STRING; val: AL_INT); INLINE; |
PROCEDURE al_set_config_hex (section, name: STRING; val: AL_INT); INLINE; |
PROCEDURE al_set_config_float (section, name:STRING; val: AL_FLOAT); INLINE; |
PROCEDURE al_set_config_id (section, name: STRING; val: AL_INT32); INLINE; |
FUNCTION al_install_timer: BOOLEAN; 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): BOOLEAN; INLINE; |
FUNCTION al_install_int (proc: AL_SIMPLE_PROC; speed: AL_LONG): BOOLEAN; 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): BOOLEAN; INLINE; |
FUNCTION al_install_param_int (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): BOOLEAN; 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 (x: AL_LONG): AL_LONG; INLINE; |
FUNCTION AL_MSEC_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
FUNCTION AL_BPS_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
FUNCTION AL_BPM_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
PROCEDURE al_rest (tyme: AL_UINT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest'; |
PROCEDURE al_rest_callback (tyme: AL_UINT; callback: AL_PARAM_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'rest_callback'; |
FUNCTION al_install_keyboard: BOOLEAN; |
PROCEDURE al_remove_keyboard; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_keyboard'; |
FUNCTION al_poll_keyboard: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_keyboard'; |
FUNCTION al_keyboard_needs_poll: BOOLEAN; INLINE; |
FUNCTION al_keypressed: BOOLEAN; INLINE; |
FUNCTION al_readkey: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'readkey'; |
FUNCTION al_ureadkey (VAR scancode: AL_INT): AL_INT; INLINE; |
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): STRING; INLINE; |
FUNCTION al_install_joystick (atype: AL_INT): BOOLEAN; |
PROCEDURE al_remove_joystick; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'remove_joystick'; |
FUNCTION al_calibrate_joystick_name (n: AL_INT): STRING; |
FUNCTION al_calibrate_joystick (n: AL_INT): BOOLEAN; |
FUNCTION al_save_joystick_data (filename: STRING): BOOLEAN; |
FUNCTION al_load_joystick_data (filename: STRING): BOOLEAN; |
FUNCTION al_poll_joystick: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_joystick'; |
PROCEDURE al_set_color (idx: AL_INT; CONST p: AL_RGBptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_color'; |
PROCEDURE al_set_palette (CONST p: AL_PALETTE); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette'; |
PROCEDURE al_set_palette_range (CONST p: AL_PALETTE; from, ato, vsync: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette_range'; |
PROCEDURE al_get_color (idx: AL_INT; VAR p: AL_RGB); INLINE; |
PROCEDURE al_get_palette (VAR p: AL_PALETTE); INLINE; |
PROCEDURE al_get_palette_range (VAR p: AL_PALETTE; from, ato: AL_INT); INLINE; |
PROCEDURE al_fade_interpolate (CONST source, dest: AL_PALETTE; VAR aoutput: AL_PALETTE; apos, from, ato: AL_INT); INLINE; |
PROCEDURE al_fade_from_range (source, dest: AL_PALETTE; speed, from, ato: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from_range'; |
PROCEDURE al_fade_in_range (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 (source, dest: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from'; |
PROCEDURE al_fade_in (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 (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); INLINE; |
FUNCTION al_generate_optimized_palette (image: AL_BITMAPptr; pal: AL_PALETTEptr; 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; CONST pal: AL_PALETTE; callback: AL_INT_PROC); INLINE; |
PROCEDURE al_hsv_to_rgb (h, s, v: AL_FLOAT; VAR r, g, b: AL_INT); INLINE; |
PROCEDURE al_rgb_to_hsv (r, g, b: AL_INT; VAR h, s, v: AL_FLOAT); INLINE; |
FUNCTION al_bestfit_color (CONST 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'; |
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'; |
FUNCTION al_set_gfx_mode (card, w, h, v_w, v_h: AL_INT): BOOLEAN; |
FUNCTION al_scroll_screen (x, y: AL_INT): BOOLEAN; INLINE; |
FUNCTION al_request_scroll (x, y: AL_INT): BOOLEAN; INLINE; |
FUNCTION al_poll_scroll: BOOLEAN; INLINE; |
FUNCTION al_show_video_bitmap (bmp: AL_BITMAPptr): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'show_video_bitmap'; |
FUNCTION al_request_video_bitmap (bitmap: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_enable_triple_buffer: BOOLEAN; 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'; |
PROCEDURE al_clear_to_color (bitmap: AL_BITMAPptr; color: AL_INT); INLINE; |
FUNCTION al_bitmap_color_depth (bmp: AL_BITMAPptr): AL_INT; INLINE; |
FUNCTION al_bitmap_mask_color (bmp: AL_BITMAPptr): AL_INT; INLINE; |
FUNCTION al_is_same_bitmap (bmp1, bmp2: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_is_memory_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_is_screen_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_is_video_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_is_system_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_is_sub_bitmap (bmp: AL_BITMAPptr): BOOLEAN; 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: BOOLEAN); INLINE; |
FUNCTION al_get_clip_state (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
FUNCTION al_load_bitmap (CONST filename: STRING; pal: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
FUNCTION al_load_bmp (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
FUNCTION al_load_lbm (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
FUNCTION al_load_pcx (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
FUNCTION al_load_tga (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
FUNCTION al_save_bitmap (filename: STRING; bmp: AL_BITMAPptr; pal: AL_PALETTEptr): BOOLEAN; INLINE; |
FUNCTION al_save_bmp (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; INLINE; |
FUNCTION al_save_pcx (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; INLINE; |
FUNCTION al_save_tga (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; 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_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'poll_mouse'; |
FUNCTION al_mouse_needs_poll: BOOLEAN; INLINE; |
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 (VAR mickeyx, mickeyy: AL_INT); INLINE; |
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): BOOLEAN; INLINE; |
FUNCTION al_mouse_on_screen: BOOLEAN; INLINE; |
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: BOOLEAN); INLINE; |
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 (CONST 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); INLINE; |
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): BOOLEAN; INLINE; |
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): BOOLEAN; INLINE; |
FUNCTION al_is_color_font (f: AL_FONTptr): BOOLEAN; INLINE; |
FUNCTION al_is_mono_font (f: AL_FONTptr): BOOLEAN; INLINE; |
FUNCTION al_is_compatible_font (f1, f2: AL_FONTptr): BOOLEAN; INLINE; |
FUNCTION al_load_font (filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
FUNCTION al_load_bitmap_font (filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
FUNCTION al_load_txt_font (CONST filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
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): BOOLEAN; INLINE; |
PROCEDURE al_textout_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
PROCEDURE al_textout_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
PROCEDURE al_textout_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
PROCEDURE al_textout_justify_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x1, x2, y, diff, color, bg: AL_INT); INLINE; |
FUNCTION al_text_length (CONST f: AL_FONTptr; CONST str: STRING): AL_INT; INLINE; |
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): BOOLEAN; 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 (VAR digi, midi: AL_INT); INLINE; |
PROCEDURE al_get_hardware_volume (VAR digi, midi: AL_INT); INLINE; |
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_load_midi (CONST filename: STRING): AL_MIDIptr; INLINE; |
PROCEDURE al_destroy_midi (midi: AL_MIDIptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'destroy_midi'; |
FUNCTION al_play_midi (midi: AL_MIDIptr; loop: BOOLEAN): BOOLEAN; INLINE; |
FUNCTION al_play_looped_midi (midi: AL_MIDIptr; loop_start, loop_end: AL_INT): BOOLEAN; 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: BOOLEAN; INLINE; |
FUNCTION al_load_sample (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
FUNCTION al_load_wav (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
FUNCTION al_load_voc (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
FUNCTION al_save_sample (CONST filename: STRING; spl: AL_SAMPLEptr): BOOLEAN; 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, loop: AL_INT): 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, loop: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'adjust_sample'; |
PROCEDURE al_register_sample_file_type (CONST ext: STRING; load: AL_SAMPLE_LOAD_FUNC; save: AL_SAMPLE_SAVE_FUNC); INLINE; |
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_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_STRptr): AL_SAMPLEptr; CDECL; |
AL_SAMPLE_SAVE_FUNC = FUNCTION (CONST filename: AL_STRptr; spl: AL_SAMPLEptr): AL_INT; CDECL; |
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_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_U_ASCII: AL_INT32; |
AL_U_ASCII_CP: AL_INT32; |
AL_U_UNICODE: AL_INT32; |
AL_U_UTF8: AL_INT32; |
AL_U_CURRENT: AL_INT32; |
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_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'three_finger_flag'; |
al_key_led_flag: AL_INT; 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'; |
FUNCTION AL_ID (str: SHORTSTRING): AL_INT32; |
|
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): BOOLEAN; 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
Returns
See also
|
FUNCTION al_init: BOOLEAN; INLINE; |
|
Function which initialises the Allegro library. This is the same thing as calling Returns
See also
|
PROCEDURE al_exit; INLINE; |
|
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
|
PROCEDURE al_message (CONST msg: STRING); |
|
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 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): BOOLEAN; 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 Example: VAR CloseButtonPressed: BOOLEAN = FALSE; PROCEDURE CloseButtonHandler; CDECL; BEGIN ClosePuttonPressed := TRUE; END; ... al_init; al_set_close_button_callback (@CloseButtonHandler); ... WHILE NOT ClosePuttonPressed DO DoStuff;
Returns
See also
|
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
|
PROCEDURE al_set_window_title (CONST title: STRING); INLINE; |
|
On platforms that are capable of it, this routine alters the window title for your Allegro program. Parameters
See also
|
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. Returnsthe color depth or zero on platforms where this information is not available or does not apply. See also
|
FUNCTION al_get_desktop_resolution (VAR w, h: AL_INT): BOOLEAN; 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. Each parameter is a pointer to an integer where one dimension of the screen will be stored. 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
Returns
See also
|
PROCEDURE al_set_uformat (aType: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_uformat'; |
|
Sets the current text encoding format. This will affect all parts of Allegro, wherever you see a function that returns a string, or takes a string as a parameter. Although you can change the text format on the fly, this is not a good idea. Many strings, for example the names of your hardware drivers and any language translations, are loaded when you call al_init, so if you change the encoding format after this, they will be in the wrong format, and things will not work properly. Generally you should only call
Parameters
See also
|
FUNCTION al_get_uformat: AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'get_uformat'; |
|
Finds out what text encoding format is currently selected. This function is probably useful only if you are writing an Allegro addon dealing with text strings and you use a different codepath for each possible format.
ReturnsThe currently selected text encoding format. See also
|
PROCEDURE al_set_ucodepage (CONST table, extras: AL_USHORTptr); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_ucodepage'; |
|
When you select the AL_U_ASCII_CP encoding mode, a set of tables are used to convert between 8-bit characters and their Unicode equivalents. You can use this function to specify a custom set of mapping tables, which allows you to support different 8-bit codepages. Allegro will use the Note that Allegro comes with a default parameters set internally. The default Parameters
See also
|
FUNCTION al_ustrlen (s: STRING): AL_INT; INLINE; |
ReturnsThe number of characters in the string. Note that this doesn't have to equal the string's size in bytes. |
FUNCTION al_uconvert (CONST s: STRING; _type, newtype: AL_INT): STRING; INLINE; |
|
Converts the specified string See also
|
FUNCTION al_uconvert_ascii (CONST s: STRING): STRING; INLINE; |
|
Converts strings from ASCII into the current encoding format. See also
|
FUNCTION al_uconvert_toascii (CONST s: STRING): STRING; INLINE; |
|
Converts strings from the current encoding format into ASCII. See also
|
PROCEDURE al_set_config_file (filename: STRING); 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
|
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
|
PROCEDURE al_override_config_file (filename: STRING); 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 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 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 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 |
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
|
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
|
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 (section, name, def: STRING): STRING; INLINE; |
|
Retrieves a string variable from the current config file. The section name may be 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. Example: VAR Lang: STRING; ... Lang := al_get_config_string ('system', 'language', 'EN');
Returnsthe string to the constant 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 See also
|
FUNCTION al_get_config_int (section, name: STRING; def: AL_INT): AL_INT; INLINE; |
|
Reads an integer variable from the current config file. See the comments about al_get_config_string. |
FUNCTION al_get_config_hex (section, name: STRING; def: AL_INT): AL_INT; INLINE; |
|
Reads an integer variable from the current config file, in hexadecimal. See the comments about al_get_config_string. |
FUNCTION al_get_config_float (section, name: STRING; def: AL_FLOAT): AL_FLOAT; INLINE; |
|
Reads a floating point variable from the current config file. See the comments about al_get_config_string. |
FUNCTION al_get_config_id (section, name: STRING; def: AL_INT32): AL_INT32; INLINE; |
|
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 (section, name, val: STRING); INLINE; |
|
Writes a string variable to the current config file, replacing any existing value it may have, or removes the variable if 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 See also
|
PROCEDURE al_set_config_int (section, name: STRING; val: AL_INT); INLINE; |
|
Writes an integer variable to the current config file. See the comments about al_set_config_string. |
PROCEDURE al_set_config_hex (section, name: STRING; val: AL_INT); INLINE; |
|
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 (section, name:STRING; val: AL_FLOAT); INLINE; |
|
Writes a floating point variable to the current config file. See the comments about al_set_config_string. |
PROCEDURE al_set_config_id (section, name: STRING; val: AL_INT32); INLINE; |
|
Writes a 4-letter driver ID variable to the current config file. See the comments about al_set_config_string. |
FUNCTION al_install_timer: BOOLEAN; 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
See also
|
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
|
FUNCTION al_install_int_ex (proc: AL_SIMPLE_PROC; speed: AL_LONG): BOOLEAN; 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 Returns
See also
|
FUNCTION al_install_int (proc: AL_SIMPLE_PROC; speed: AL_LONG): BOOLEAN; INLINE; |
|
Installs a user timer handler, with the speed given as the number of milliseconds between ticks. This is the same thing as Returns
See also
|
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
|
FUNCTION al_install_param_int_ex (proc: AL_PARAM_PROC; param: AL_VOIDptr; speed: AL_LONG): BOOLEAN; 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): BOOLEAN; 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
|
FUNCTION AL_SECS_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
|
Give the number of seconds between each tick to al_install_int_ex. |
FUNCTION AL_MSEC_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
|
Give the number of milliseconds between each tick to al_install_int_ex. |
FUNCTION AL_BPS_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
|
Give the number of ticks each second to al_install_int_ex. |
FUNCTION AL_BPM_TO_TIMER (x: AL_LONG): AL_LONG; INLINE; |
|
Give the number of ticks each minute to al_install_int_ex. |
PROCEDURE al_rest (tyme: 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 (tyme: 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 |
FUNCTION al_install_keyboard: BOOLEAN; |
|
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
Returns
See also
|
FUNCTION al_poll_keyboard: AL_INT; 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 Returnszero on success or a negative on failure (ie. no keyboard driver installed). |
FUNCTION al_keyboard_needs_poll: BOOLEAN; INLINE; |
|
Returns |
FUNCTION al_keypressed: BOOLEAN; INLINE; |
|
Returns WHILE NOT al_keypressed DO AnimateLogo (al_screen);
See also
|
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: INTEGER; ... 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
|
FUNCTION al_ureadkey (VAR scancode: AL_INT): AL_INT; INLINE; |
|
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: INTEGER; ... 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
|
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
|
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
|
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
|
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 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
|
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
|
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): STRING; INLINE; |
|
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
|
FUNCTION al_install_joystick (atype: AL_INT): BOOLEAN; |
|
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
See also
|
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
|
FUNCTION al_calibrate_joystick_name (n: AL_INT): STRING; |
|
Pass the number of the joystick you want to calibrate as the parameter.
Returnsa text description for the next type of calibration that will be done on the specified joystick, or empty string if no more calibration is required. See also
|
FUNCTION al_calibrate_joystick (n: AL_INT): BOOLEAN; |
|
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 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
See also
|
FUNCTION al_save_joystick_data (filename: STRING): BOOLEAN; |
|
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
Returns
See also
|
FUNCTION al_load_joystick_data (filename: STRING): BOOLEAN; |
|
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
See also
|
FUNCTION al_poll_joystick: AL_INT; 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.
Returnszero on success or a negative number on failure (usually because no joystick driver was installed). See also
|
PROCEDURE al_set_color (idx: AL_INT; CONST p: AL_RGBptr); 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
|
PROCEDURE al_set_palette (CONST 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
|
PROCEDURE al_set_palette_range (CONST p: AL_PALETTE; from, ato, vsync: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_palette_range'; |
|
Sets the palette entries between See also
|
PROCEDURE al_get_color (idx: AL_INT; VAR p: AL_RGB); INLINE; |
|
Retrieves the specified palette entry. See also
|
PROCEDURE al_get_palette (VAR p: AL_PALETTE); INLINE; |
|
Retrieves the entire palette of 256 colors. You should provide a |
PROCEDURE al_get_palette_range (VAR p: AL_PALETTE; from, ato: AL_INT); INLINE; |
|
Retrieves the palette entries between |
PROCEDURE al_fade_interpolate (CONST source, dest: AL_PALETTE; VAR aoutput: AL_PALETTE; apos, from, ato: AL_INT); INLINE; |
|
Calculates a temporary palette part way between See also
|
PROCEDURE al_fade_from_range (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 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
|
PROCEDURE al_fade_in_range (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 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
|
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 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
|
PROCEDURE al_fade_from (source, dest: AL_PALETTE; speed: AL_INT); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'fade_from'; |
|
Gradually fades from the 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
|
PROCEDURE al_fade_in (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 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
|
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 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
|
PROCEDURE al_select_palette (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 |
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); INLINE; |
|
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
|
FUNCTION al_generate_optimized_palette (image: AL_BITMAPptr; pal: AL_PALETTEptr; 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
Returnsthe 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
|
PROCEDURE al_create_rgb_table (VAR table: AL_RGB_MAP; CONST pal: AL_PALETTE; callback: AL_INT_PROC); INLINE; |
|
Fills the specified RGB mapping table with lookup data for the specified palette. If the |
PROCEDURE al_hsv_to_rgb (h, s, v: AL_FLOAT; VAR r, g, b: AL_INT); INLINE; |
|
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
|
PROCEDURE al_rgb_to_hsv (r, g, b: AL_INT; VAR h, s, v: AL_FLOAT); INLINE; |
|
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
|
FUNCTION al_bestfit_color (CONST 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
Returnsthe index of the palette for the closest match to the requested color. See also
|
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.
Returnsthe requested RGB triplet in the current color depth. See also
|
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.
Returnsthe requested RGB triplet in the specified color depth. See also
|
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.
Returnsthe requested RGB triplet in the specified color depth. See also
|
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. Returnsthe 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. Returnsthe 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, these functions extract one of the red, green, blue, or alpha components (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
|
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'; |
|
Given a color in the format being used by the specified color depth, these functions extract one of the red, green, blue, or alpha components (ranging 0-255). The alpha part is only meaningful for 32-bit pixels. See also
|
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'; |
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
|
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 If you intend using converted bitmaps with functions like al_masked_blit or al_draw_sprite, you should specify the See also
|
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
|
FUNCTION al_set_gfx_mode (card, w, h, v_w, v_h: AL_INT): BOOLEAN; |
|
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 The When you call 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 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
See also
|
FUNCTION al_scroll_screen (x, y: AL_INT): BOOLEAN; INLINE; |
|
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 Returns
See also
|
FUNCTION al_request_scroll (x, y: AL_INT): BOOLEAN; INLINE; |
|
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
See also
|
FUNCTION al_poll_scroll: BOOLEAN; INLINE; |
|
Checks the status of a scroll request with triple buffering. Returns
See also
|
FUNCTION al_show_video_bitmap (bmp: AL_BITMAPptr): AL_INT; 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 Returnszero on success and non-zero on failure. |
FUNCTION al_request_video_bitmap (bitmap: AL_BITMAPptr): BOOLEAN; INLINE; |
|
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
See also
|
FUNCTION al_enable_triple_buffer: BOOLEAN; 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
See also
|
FUNCTION al_create_bitmap (w, h: AL_INT): AL_BITMAPptr; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_bitmap'; |
|
Creates a memory bitmap sized
Returnsa pointer to the created bitmap, or See also
|
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). Returnsa pointer to the created bitmap, or See also
|
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 Remember to free the sub bitmap before freeing the parent bitmap to avoid memory leaks and potential crashes accessing memory which has been freed.
Returnsa pointer to the created sub bitmap, or See also
|
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.
Returnsa pointer to the bitmap on success, or See also
|
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.
Returnsa pointer to the bitmap on success, See also
|
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 The bitmap must not have a mouse cursor shown on it at the time it is destroyed. See also
|
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. 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.: 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
|
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
|
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
|
PROCEDURE al_clear_to_color (bitmap: AL_BITMAPptr; color: AL_INT); INLINE; |
|
Clears the bitmap to the specified color. See also
|
FUNCTION al_bitmap_color_depth (bmp: AL_BITMAPptr): AL_INT; INLINE; |
|
Returnsthe color depth of the specified bitmap (8, 15, 16, 24, or 32). See also
|
FUNCTION al_bitmap_mask_color (bmp: AL_BITMAPptr): AL_INT; INLINE; |
|
Returnsthe 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
|
FUNCTION al_is_same_bitmap (bmp1, bmp2: AL_BITMAPptr): BOOLEAN; INLINE; |
|
Returns
See also
|
FUNCTION al_is_memory_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
Returns
|
FUNCTION al_is_screen_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
|
Returns
See also
|
FUNCTION al_is_video_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
|
if bmp is the screen bitmap, a video memory bitmap, or a sub-bitmap of either.) Returns
See also
|
FUNCTION al_is_system_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
|
Returns
See also
|
FUNCTION al_is_sub_bitmap (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
|
Returns
See also
|
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 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 Note: For backwards compatibility, the unlocking behavior of such functions is permanent. That is, if you call 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 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
|
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
|
PROCEDURE al_acquire_screen; INLINE; |
|
Shortcut version of See also
|
PROCEDURE al_release_screen; INLINE; |
|
Shortcut version of See also
|
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
|
PROCEDURE al_set_clip_state (bmp: AL_BITMAPptr; state: BOOLEAN); INLINE; |
|
Turns on (if state is See also
|
FUNCTION al_get_clip_state (bmp: AL_BITMAPptr): BOOLEAN; INLINE; |
|
Returns the clipping state. See also
|
FUNCTION al_load_bitmap (CONST filename: STRING; pal: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
|
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 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
|
FUNCTION al_load_bmp (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
|
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. Returnsa pointer to the bitmap or See also
|
FUNCTION al_load_lbm (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
|
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. Returnsa pointer to the bitmap or See also
|
FUNCTION al_load_pcx (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
|
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. Returnsa pointer to the bitmap or See also
|
FUNCTION al_load_tga (CONST filename: STRING; palette: AL_PALETTEptr): AL_BITMAPptr; INLINE; |
|
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. Returnsa pointer to the bitmap or See also
|
FUNCTION al_save_bitmap (filename: STRING; bmp: AL_BITMAPptr; pal: AL_PALETTEptr): BOOLEAN; 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); |
FUNCTION al_save_bmp (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; INLINE; |
|
Writes a bitmap into a 256-color or 24-bit truecolor BMP file. Returnsnon-zero on error. See also
|
FUNCTION al_save_pcx (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; INLINE; |
|
Writes a bitmap into a 256-color or 24-bit truecolor PCX file. Returnsnon-zero on error. See also
|
FUNCTION al_save_tga (filename: STRING; bmp: AL_BITMAPptr; palette: AL_PALETTEptr): BOOLEAN; INLINE; |
|
Writes a bitmap into a 256-color, 15-bit hicolor, 24-bit truecolor, or 32-bit truecolor+alpha TGA file. Returnsnon-zero on error. See also
|
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 |
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_INT; 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. Returnszero on success, or a negative number on failure (ie. no mouse driver installed). See also
|
FUNCTION al_mouse_needs_poll: BOOLEAN; INLINE; |
|
Returns See also
|
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
|
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, |
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 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 See also
|
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
|
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
|
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
|
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
|
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
|
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 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
|
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
|
PROCEDURE al_get_mouse_mickeys (VAR mickeyx, mickeyy: AL_INT); INLINE; |
|
Measures how far the mouse has moved since the last call to this function. The values of 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 As a bonus, See also
|
FUNCTION al_show_os_cursor (cursor: AL_INT): BOOLEAN; 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, 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 Returns
|
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 See also
|
PROCEDURE al_xor_mode (aOn: BOOLEAN); INLINE; |
|
This is a shortcut for toggling xor drawing mode on and off. Calling See also
|
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 See also
|
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
|
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
|
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
|
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
|
PROCEDURE al_calc_spline (CONST 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
|
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 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, See also
|
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, See also
|
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 See also
|
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 See also
|
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
|
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
|
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 See also
|
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 |
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 |
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 |
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 See also
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
PROCEDURE al_circle (bmp: AL_BITMAPptr; x, y, r, color: AL_INT); INLINE; |
|
Draws a circle with the specified centre and radius. See also
|
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
|
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
|
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
|
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
|
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
|
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
|
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
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, 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
|
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 Parameters
|
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 See also
|
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
See also
|
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 See also
|
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 |
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 |
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 |
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 |
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 |
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. Returnsthe 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. Returnsthe 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. Returnsthe value of the pixel in 16bpp |
PROCEDURE _al_putpixel24 (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 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. Returnsthe 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. Returnsthe value of the pixel in 32bpp |
FUNCTION al_font_has_alpha (f: AL_FONTptr): BOOLEAN; INLINE; |
|
Search all pixels of a font for alpha values. See also
|
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 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
|
FUNCTION al_is_trans_font (f: AL_FONTptr): BOOLEAN; INLINE; |
|
This function checks if the given font is a color font using al_draw_trans_sprite to render glyphs. See also
|
FUNCTION al_is_color_font (f: AL_FONTptr): BOOLEAN; INLINE; |
|
This function checks if the given font is a color font, as opposed to a monochrome font. Returns
See also
|
FUNCTION al_is_mono_font (f: AL_FONTptr): BOOLEAN; INLINE; |
|
This function checks if the given font is a mono font, as opposed to a color font. Returns
See also
|
FUNCTION al_is_compatible_font (f1, f2: AL_FONTptr): BOOLEAN; INLINE; |
|
This function compares the two fonts, which you can use to find out if Allegro is capable of merging them. Returns
|
FUNCTION al_load_font (filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
|
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 The third parameter can be used to pass specific information to a custom loader routine. Normally, you can just leave this as Returnsa pointer to the font or See also
|
FUNCTION al_load_bitmap_font (filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
|
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:
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 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.
Returnsa pointer to the font or See also
|
FUNCTION al_load_txt_font (CONST filename: STRING; palette: AL_PALETTEptr; param: AL_VOIDptr): AL_FONTptr; INLINE; |
|
Loads a font script. The script file contains a number of lines in the format
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. ReturnsA pointer to the font or See also
|
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
Returnsa pointer to the font or See also
|
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;
Returnsthe number of continuous character ranges in a font, or -1 if that information is not available. See also
|
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 See also
|
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 See also
|
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);
Returnsa pointer to the new font or See also
|
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;
Returnsa pointer to the new font or See also
|
FUNCTION al_transpose_font (f: AL_FONTptr; drange: AL_INT): BOOLEAN; 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
See also
|
PROCEDURE al_textout_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
|
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. Parameters
See also
|
PROCEDURE al_textout_centre_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
|
Like See also
|
PROCEDURE al_textout_right_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x, y, color, bg: AL_INT); INLINE; |
|
Like See also
|
PROCEDURE al_textout_justify_ex (bmp: AL_BITMAPptr; CONST f: AL_FONTptr; CONST str: STRING; x1, x2, y, diff, color, bg: AL_INT); INLINE; |
|
Draws justified text within the region See also
|
FUNCTION al_text_length (CONST f: AL_FONTptr; CONST str: STRING): AL_INT; INLINE; |
|
Returns the length (in pixels) of a string in the specified font. See also
|
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
|
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
|
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
ReturnsA pointer to the created RLE sprite, or See also
|
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 Parameters
|
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
See also
|
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
See also
|
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
See also
|
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 See also
|
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 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 See also
|
FUNCTION al_install_sound (digi, midi: AL_INT): BOOLEAN; 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. failure. If it fails it will store a description of the problem in al_error.) Returns( See also
|
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
|
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
|
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
|
PROCEDURE al_get_volume (VAR digi, midi: AL_INT); INLINE; |
|
Retrieves the global sound output volume, both for digital samples and MIDI playback, as integers from 0 to 255. See also
|
PROCEDURE al_get_hardware_volume (VAR digi, midi: AL_INT); INLINE; |
|
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
|
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 See also
|
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 |
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
|
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_load_midi (CONST filename: STRING): AL_MIDIptr; INLINE; |
|
Loads a MIDI file (handles both format 0 and format 1). Returnsa pointer to a AL_MIDI structure, or See also
|
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
|
FUNCTION al_play_midi (midi: AL_MIDIptr; loop: BOOLEAN): BOOLEAN; INLINE; |
|
Starts playing the specified MIDI file, first stopping whatever music was previously playing. If the
Returns
See also
|
FUNCTION al_play_looped_midi (midi: AL_MIDIptr; loop_start, loop_end: AL_INT): BOOLEAN; INLINE; |
|
Starts playing a MIDI file with a user-defined loop position. When the player reaches the
Returns
See also
|
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 See also
|
PROCEDURE al_midi_pause; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_pause'; |
|
Pauses the MIDI player. See also
|
PROCEDURE al_midi_resume; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'midi_resume'; |
|
Resumes playback of a paused MIDI file. See also
|
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 Returnszero if it could successfully seek to the requested position. Otherwise, a return value of 1 means it stopped playing, and See also
|
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. Returnsthe value of al_midi_time, the length of the midi. See also
|
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
|
FUNCTION al_load_midi_patches: BOOLEAN; 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
See also
|
FUNCTION al_load_sample (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
|
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.
Returnsa pointer to the AL_SAMPLE or See also
|
FUNCTION al_load_wav (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
|
Loads a sample from a RIFF WAV file. Remember to free this sample later to avoid memory leaks.
Returnsa pointer to the See also
|
FUNCTION al_load_voc (CONST filename: STRING): AL_SAMPLEptr; INLINE; |
|
Loads a sample from a Creative Labs VOC file. Remember to free this sample later to avoid memory leaks.
Returnsa pointer to the See also
|
FUNCTION al_save_sample (CONST filename: STRING; spl: AL_SAMPLEptr): BOOLEAN; INLINE; |
|
Writes a sample into a file. The output format is determined from the
Returns
See also
|
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
Returnsa pointer to the created sample, or See also
|
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
|
FUNCTION al_play_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq, loop: AL_INT): AL_INT; CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'play_sample'; |
|
Triggers a sample at the specified volume, pan position, and frequency. The parameters Returnsthe 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
|
PROCEDURE al_adjust_sample (CONST spl: AL_SAMPLEptr; vol, pan, freq, loop: AL_INT); 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. |
PROCEDURE al_register_sample_file_type (CONST ext: STRING; load: AL_SAMPLE_LOAD_FUNC; save: AL_SAMPLE_SAVE_FUNC); INLINE; |
|
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 FUNCTION LoadMP3 (CONST filename: AL_CHARptr): AL_SAMPLEptr; CDECL; BEGIN ... END; ... al_register_sample_file_type ('mp3', @LoadMPT, NIL); |
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_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_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_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_MIDIptr = ˆAL_MIDI; |
|
Pointer to |
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_STRptr): AL_SAMPLEptr; CDECL; |
|
Used by al_register_sample_file_type. |
AL_SAMPLE_SAVE_FUNC = FUNCTION (CONST filename: AL_STRptr; spl: AL_SAMPLEptr): AL_INT; CDECL; |
|
Used by al_register_sample_file_type. |
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 = 4; |
|
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 = FALSE; |
|
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.4'; |
|
Defined to a text string containing all version numbers and maybe some additional text. |
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_CPU_MODEL_K6 = 6; |
AL_CPU_MODEL_ATHLON64 = 4; |
AL_JOY_TYPE_AUTODETECT = -1; |
|
To be used at |
AL_JOY_TYPE_NONE = 0; |
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_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 thet palette size. See also
|
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 |
AL_GFX_CAN_SCROLL = $00000001; |
|
Indicates that the al_scroll_screen function may be used with this driver. See also
|
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_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_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_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_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_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_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_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_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_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_HW_LINE = $00000800; |
|
Indicates that the opaque mode al_line and al_vline functions are implemented using a hardware accelerator. See also
|
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_HW_GLYPH = $00008000; |
|
Indicates that monochrome character expansion (for text drawing) is implemented using a hardware accelerator. See also
|
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_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_HW_MEM_BLIT = $00040000; |
|
Indicates that blitting from a memory bitmap onto the screen is being accelerated in hardware. See also
|
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_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_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_SYSTEM_CURSOR = $00400000; |
|
Indicates that the mouse cursor is the default system cursor, not Allegro's custom cursor. See also
|
AL_MOUSE_CURSOR_NONE = 0; |
|
Indicates that the mouse cursor is the default system cursor, not Allegro's custom cursor. See also
|
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_MOUSE_CURSOR_ARROW = 2; |
|
The operating system default arrow cursor. See also
|
AL_MOUSE_CURSOR_BUSY = 3; |
|
The operating system default `busy' cursor (hourglass). See also
|
AL_MOUSE_CURSOR_QUESTION = 4; |
|
The operating system default `question' cursor (arrow with question mark). See also
|
AL_MOUSE_CURSOR_EDIT = 5; |
|
The operating system default `edit' cursor (vertical bar). See also
|
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_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_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: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'cpu_family'; |
|
Contains the CPU type, where applicable. Allegro defines the following CPU family types:
You can read this variable after you have called al_check_cpu (which is automatically called by al_init). See also
|
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: 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:
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_U_ASCII: AL_INT32; |
|
Fixed size, 8-bit ASCII characters. . See also
|
AL_U_ASCII_CP: AL_INT32; |
|
Alternative 8-bit codepage. . See also
|
AL_U_UNICODE: AL_INT32; |
|
Fixed size, 16-bit Unicode characters. . See also
|
AL_U_UTF8: AL_INT32; |
|
Variable size, UTF-8 format Unicode characters. . See also
|
AL_U_CURRENT: AL_INT32; |
|
Current encoding. See also
|
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_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 IF al_key[AL_KEY_SPACE] <> 0 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 See also
|
al_key_shifts: AL_INT; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'key_shifts'; |
|
Bitmask containing the current state of
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_three_finger_flag: AL_INT; 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 See also
|
al_key_led_flag: AL_INT; 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 zero and prevent the LED's being updated. See also
|
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_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: 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.
See also
|
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_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 See also
|
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_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_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 The position is integer ranging from zero to the right side of the screen. See also
|
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 The position is integer ranging from zero to the bottom side of the screen. See also
|
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 It holds the current vertical wheel position, when using an input driver that supports wheel mice. See also
|
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 It holds the current horizontal wheel position, when using an input driver that supports wheel mice. See also
|
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 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_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 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_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, See also
|
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_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_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: 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_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 See also
|