Types and constants
Abstract types
Audio
Aggregation types
Enumerations and flags
module Flip : sig ... end
module Text : sig ... end
Events
module Event : sig ... end
Displays
Display creation
val create_display : int -> int -> display
val destroy_display : display -> unit
val get_new_display_flags : unit -> int
val set_new_display_flags : int -> unit
Display operations
val flip_display : unit -> unit
Display size and position
val get_display_width : display -> int
val get_display_height : display -> int
val resize_display : display -> int -> int -> bool
val acknowledge_resize : display -> unit
val get_window_position : display -> int * int
val set_window_position : display -> int -> int -> unit
val get_window_constraints : display -> int * int * int * int
val set_window_constraints : display -> int -> int -> int -> int -> unit
val apply_window_constraints : display -> bool -> unit
val get_display_adapter : display -> int
Display settings
val set_window_title : display -> string -> unit
val set_new_window_title : string -> unit
val get_new_window_title : unit -> string
Fullscreen modes
val get_num_display_modes : unit -> int
Events
Event queue contents
Graphics routines
Colors
val map_rgb : int -> int -> int -> color
val map_rgba : int -> int -> int -> int -> color
val premul_rgba : int -> int -> int -> int -> color
val map_rgb_f : float -> float -> float -> color
val map_rgba_f : float -> float -> float -> float -> color
val premul_rgba_f : float -> float -> float -> float -> color
val unmap_rgb : color -> int * int * int
val unmap_rgba : color -> int * int * int * int
val unmap_rgb_f : color -> float * float * float
val unmap_rgba_f : color -> float * float * float * float
Bitmap creation
val create_bitmap : int -> int -> bitmap
val create_sub_bitmap : bitmap -> int -> int -> int -> int -> bitmap
val convert_bitmap : bitmap -> unit
val convert_memory_bitmaps : unit -> unit
val destroy_bitmap : bitmap -> unit
Bitmap properties
val get_bitmap_width : bitmap -> int
val get_bitmap_height : bitmap -> int
val is_compatible_bitmap : bitmap -> bool
val is_sub_bitmap : bitmap -> bool
val get_bitmap_x : bitmap -> int
val get_bitmap_y : bitmap -> int
val reparent_bitmap : bitmap -> bitmap -> int -> int -> int -> int
Drawing operations
val clear_to_color : color -> unit
val draw_rotated_bitmap :
bitmap ->
?tint:color ->
pos ->
pos ->
float ->
int ->
unit
val put_pixel : int -> int -> color -> unit
val put_blended_pixel : int -> int -> color -> unit
Target bitmap
val get_target_bitmap : unit -> bitmap
val set_target_bitmap : bitmap -> unit
val set_target_backbuffer : display -> unit
val get_current_display : unit -> display
Deferred drawing
val hold_bitmap_drawing : bool -> unit
val is_bitmap_drawing_held : unit -> bool
Image I/O
val register_bitmap_loader :
string ->
(string -> int -> bitmap option) option ->
unit
val register_bitmap_saver : string -> (string -> bitmap -> bool) option -> unit
val load_bitmap : string -> bitmap
val load_bitmap_flags : string -> int -> bitmap
val save_bitmap : string -> bitmap -> unit
val identify_bitmap : string -> string
Joystick routines
val install_joystick : unit -> unit
val is_joystick_installed : unit -> bool
val uninstall_joystick : unit -> unit
val get_num_joysticks : unit -> int
val get_joystick_active : joystick -> bool
val get_joystick_name : joystick -> string
val get_joystick_stick_name : joystick -> int -> string option
val get_joystick_axis_name : joystick -> int -> int -> string option
val is_joystick_stick_analogue : joystick -> int -> bool
val get_joystick_num_sticks : joystick -> int
val get_joystick_num_axes : joystick -> int -> int
Keyboard routines
val install_keyboard : unit -> unit
val is_keyboard_installed : unit -> bool
val uninstall_keyboard : unit -> unit
val keycode_to_name : Key.t -> string
val can_set_keyboard_leds : unit -> bool
val set_keyboard_leds : int -> unit
Mouse routines
val install_mouse : unit -> unit
val is_mouse_installed : unit -> bool
val uninstall_mouse : unit -> unit
val get_mouse_num_axis : unit -> int
val set_mouse_xy : display -> int -> int -> bool
val set_mouse_z : int -> bool
val set_mouse_w : int -> bool
val set_mouse_axis : int -> int -> bool
val set_mouse_wheel_precision : int -> unit
val get_mouse_wheel_precision : unit -> int
Shader routines
val build_shader : shader -> unit
val get_shader_log : shader -> string
val use_shader : shader option -> unit
val get_current_shader : unit -> shader
val destroy_shader : shader -> unit
val set_shader_sampler : string -> bitmap -> int -> unit
val set_shader_matrix : string -> transform -> unit
val set_shader_int : string -> int -> unit
val set_shader_float : string -> float -> unit
val set_shader_bool : string -> bool -> unit
val set_shader_int_vector : string -> int array array -> unit
val set_shader_float_vector : string -> float array array -> unit
System routines
val uninstall_system : unit -> unit
val is_system_installed : unit -> bool
val get_allegro_version : unit -> int
val set_exe_name : string -> unit
val set_app_name : string -> unit
val set_org_name : string -> unit
val get_app_name : unit -> string
val get_org_name : unit -> string
val get_cpu_count : unit -> int
val get_ram_size : unit -> int
Time
val get_time : unit -> float
val init_timeout : float -> timeout
Timer
val create_timer : float -> timer
val start_timer : timer -> unit
val resume_timer : timer -> unit
val stop_timer : timer -> unit
val get_timer_started : timer -> bool
val destroy_timer : timer -> unit
val get_timer_count : timer -> int64
val set_timer_count : timer -> int64 -> unit
val add_timer_count : timer -> int64 -> unit
val get_timer_speed : timer -> float
val set_timer_speed : timer -> float -> unit
Audio addons
val install_audio : unit -> unit
val is_audio_installed : unit -> bool
val uninstall_audio : unit -> unit
val get_allegro_audio_version : unit -> int
Samples
val load_sample : string -> sample
val save_sample : string -> sample -> bool
val destroy_sample : sample -> unit
val reserve_samples : int -> unit
val stop_sample : sample -> unit
val stop_samples : unit -> unit
Audio streams
val load_audio_stream : string -> int -> int -> audio_stream
Mixers
val get_default_mixer : unit -> mixer
Audio codecs
val init_acodec_addon : unit -> unit
val is_acodec_addon_initialized : unit -> bool
val get_allegro_acodec_version : unit -> int
Image I/O addon
val init_image_addon : unit -> unit
val is_image_addon_initialized : unit -> bool
val shutdown_image_addon : unit -> unit
val get_allegro_image_version : unit -> int
Font addons
val init_font_addon : unit -> unit
val is_font_addon_initialized : unit -> bool
val shutdown_font_addon : unit -> unit
val get_allegro_font_version : unit -> int
General font routines
val destroy_font : font -> unit
val get_font_line_height : font -> int
val get_font_ascent : font -> int
val get_font_descent : font -> int
val get_text_width : font -> string -> int
val draw_text : font -> color -> pos -> int -> string -> unit
val draw_justified_text :
font ->
color ->
pos ->
float ->
float ->
int ->
string ->
unit
val get_text_dimensions : font -> string -> int * int * int * int
val get_font_ranges : font -> (int * int) array
val set_fallback_font : font -> font option -> unit
Bitmap fonts
val grab_font_from_bitmap : bitmap -> (int * int) array -> font
val load_bitmap_font : string -> font
val load_bitmap_font_flags : string -> int -> font
val create_builtin_font : unit -> font
TTF fonts
val init_ttf_addon : unit -> unit
val is_ttf_addon_initialized : unit -> bool
val shutdown_ttf_addon : unit -> unit
val get_allegro_ttf_version : unit -> int
val load_ttf_font : string -> int -> int -> font
val load_ttf_font_stretch : string -> int -> int -> int -> font
Primitives addon
val init_primitives_addon : unit -> unit
val is_primitives_addon_initialized : unit -> bool
val shutdown_primitives_addon : unit -> unit
val get_allegro_primitives_version : unit -> int
High level drawing routines
val draw_rectangle : pos -> pos -> color -> float -> unit
val draw_filled_rectangle : pos -> pos -> color -> unit
val draw_rounded_rectangle : pos -> pos -> pos -> color -> float -> unit
val draw_filled_rounded_rectangle : pos -> pos -> pos -> color -> unit
val draw_pieslice : pos -> float -> float -> float -> color -> float -> unit
val draw_filled_pieslice : pos -> float -> float -> float -> color -> unit
val draw_ellipse : pos -> pos -> color -> float -> unit
val draw_circle : pos -> float -> color -> float -> unit
val draw_filled_circle : pos -> float -> color -> unit
val draw_arc : pos -> float -> float -> float -> color -> float -> unit
val draw_elliptical_arc :
pos ->
pos ->
float ->
float ->
color ->
float ->
unit
val draw_spline : pos array -> color -> float -> unit
val draw_ribbon : pos array -> color -> float -> unit
Polygon routines
val draw_filled_polygon : pos array -> color -> unit
val draw_filled_polygon_with_holes :
pos array ->
pos array list ->
color ->
unit