Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 al_acknowledge_resize
 al_bitmap_is_locked
 al_clear
 al_clone_bitmap
 al_convert_mask_to_alpha
 al_create_bitmap
 al_create_display
 al_create_event_queue
 al_create_mouse_cursor
 al_create_sub_bitmap
 al_current_time
 al_destroy_bitmap
 al_destroy_display
 al_destroy_event_queue
 al_destroy_mouse_cursor
 al_draw_bitmap
 al_draw_bitmap_region
 al_draw_line
 al_draw_pixel
 al_draw_rectangle
 al_draw_rotated_bitmap
 al_draw_rotated_scaled_bitmap
 al_draw_scaled_bitmap
 al_drop_next_event
 al_event_queue_is_empty
 al_flip_display
 al_flush_event_queue
 al_get_backbuffer
 al_get_bitmap_flags
 al_get_bitmap_format
 al_get_bitmap_height
 al_get_bitmap_width
 al_get_blender
 al_get_clipping_rectangle
 al_get_current_display
 al_get_display_flags
 al_get_display_format
 al_get_display_height
 al_get_display_mode
 al_get_display_refresh_rate
 al_get_display_width
 al_get_frontbuffer
 al_get_joystick
 al_get_joystick_axis_name
 al_get_joystick_button_name
 al_get_joystick_name
 al_get_joystick_state
 al_get_joystick_stick_flags
 al_get_joystick_stick_name
 al_get_keyboard
 al_get_keyboard_state
 al_get_mouse
 al_get_mouse_num_axes
 al_get_mouse_num_buttons
 al_get_mouse_state
 al_get_new_bitmap_flags
 al_get_new_bitmap_format
 al_get_new_display_flags
 al_get_new_display_format
 al_get_new_display_refresh_rate
 al_get_next_event
 al_get_num_display_modes
 al_get_num_joystick_axes
 al_get_num_joystick_buttons
 al_get_num_joystick_sticks
 al_get_opengl_extension_list
 al_get_opengl_proc_address
 al_get_pixel
 al_get_state_axis
 al_get_target_bitmap
 al_get_timer_count
 al_get_timer_speed
 al_hide_mouse_cursor
 al_install_joystick
 al_install_keyboard
 al_install_mouse
 al_install_timer
 al_is_compatible_bitmap
 al_is_mouse_installed
 al_is_opengl_extension_supported
 al_key_down
 al_keycode_to_name
 al_load_bitmap
 al_lock_bitmap
 al_lock_bitmap_region
 al_map_rgb
 al_map_rgb_f
 al_map_rgba
 al_map_rgba_f
 al_mouse_button_down
 al_num_joysticks
 al_opengl_version
 al_peek_next_event
 al_put_pixel
 al_register_event_source
 al_release_joystick
 al_resize_display
 al_rest
 al_set_blender
 al_set_clipping_rectangle
 al_set_current_display
 al_set_display_icon
 al_set_keyboard_leds
 al_set_memory_management_functions
 al_set_mouse_axis
 al_set_mouse_cursor
 al_set_mouse_range
 al_set_mouse_w
 al_set_mouse_xy
 al_set_mouse_z
 al_set_new_bitmap_flags
 al_set_new_bitmap_format
 al_set_new_display_flags
 al_set_new_display_format
 al_set_new_display_refresh_rate
 al_set_system_mouse_cursor
 al_set_target_bitmap
 al_set_timer_count
 al_set_timer_speed
 al_show_mouse_cursor
 al_start_timer
 al_stop_timer
 al_timer_is_started
 al_uninstall_joystick
 al_uninstall_keyboard
 al_uninstall_mouse
 al_uninstall_timer
 al_unlock_bitmap
 al_unmap_rgb
 al_unmap_rgb_f
 al_unmap_rgba
 al_unmap_rgba_f
 al_unregister_event_source
 al_update_display_region
 al_wait_for_event
 al_wait_for_event_timed
 al_wait_for_vsync
bool al_acknowledge_resize(ALLEGRO_DISPLAY *display)
When the user receives a resize event from a resizable display, if they wish the display to be resized they must call this function to let the graphics driver know that it can now resize the display.
Returns whether or not a bitmap is already locked.
void al_clear(ALLEGRO_COLOR color)
Clear a complete display, but confined by the clipping rectangle.
ALLEGRO_BITMAP *al_clone_bitmap(ALLEGRO_BITMAP *bitmap)
Clone a bitmap “exactly”, formats can be different.
void al_convert_mask_to_alpha(ALLEGRO_BITMAP *bitmap,
ALLEGRO_COLOR mask_color)
Convert the given mask color to an alpha channel in the bitmap.
ALLEGRO_BITMAP *al_create_bitmap(int w,
int h)
Creates a new bitmap using the bitmap format and flags for the current thread.
ALLEGRO_DISPLAY *al_create_display(int w,
int h)
Create a display, or window, with the specified dimensions.
ALLEGRO_EVENT_QUEUE *al_create_event_queue(void)
Create a new, empty event queue, returning a pointer to object if successful.
ALLEGRO_MOUSE_CURSOR *al_create_mouse_cursor(ALLEGRO_BITMAP *bmp,
int x_focus,
int y_focus)
Create a mouse cursor from the bitmap provided.
ALLEGRO_BITMAP *al_create_sub_bitmap(ALLEGRO_BITMAP *parent,
int x,
int y,
int w,
int h)
Creates a sub-bitmap of the parent, at the specified coordinates and of the specified size.
AL_FUNC(double,
al_current_time,
(void))
Return the number of seconds since the Allegro library was initialised.
void al_destroy_bitmap(ALLEGRO_BITMAP *bitmap)
Destroys the given bitmap, freeing all resources used by it.
void al_destroy_display(ALLEGRO_DISPLAY *display)
Destroy a display.
void al_destroy_event_queue(ALLEGRO_EVENT_QUEUE *queue)
Destroy the event queue specified.
void al_destroy_mouse_cursor(ALLEGRO_MOUSE_CURSOR *cursor)
Free the memory used by the given cursor.
void al_draw_bitmap(ALLEGRO_BITMAP *bitmap,
float dx,
float dy,
int flags)
Draws an unscaled, unrotated bitmap at the given position to the current target bitmap (see al_set_target_bitmap).
void al_draw_bitmap_region(ALLEGRO_BITMAP *bitmap,
float sx,
float sy,
float sw,
float sh,
float dx,
float dy,
int flags)
Draws a region of the given bitmap to the target bitmap.
void al_draw_line(float fx,
float fy,
float tx,
float ty,
ALLEGRO_COLOR color)
Draws a line to the current target.
void al_draw_pixel(float x,
float y,
ALLEGRO_COLOR color)
Draws a single pixel at x, y.
void al_draw_rectangle(float tlx,
float tly,
float brx,
float bry,
ALLEGRO_COLOR color,
int flags)
Draws a rectangle to the current target.
void al_draw_rotated_bitmap(ALLEGRO_BITMAP *bitmap,
float cx,
float cy,
float dx,
float dy,
float angle,
int flags)
Draws a rotated version of the given bitmap to the target bitmap.
void al_draw_rotated_scaled_bitmap(ALLEGRO_BITMAP *bitmap,
float cx,
float cy,
float dx,
float dy,
float xscale,
float yscale,
float angle,
int flags)
Like al_draw_rotated_bitmap, but can also scale the bitmap.
void al_draw_scaled_bitmap(ALLEGRO_BITMAP *bitmap,
float sx,
float sy,
float sw,
float sh,
float dx,
float dy,
float dw,
float dh,
int flags)
Draws a scaled version of the given bitmap to the target bitmap.
void al_drop_next_event(ALLEGRO_EVENT_QUEUE *queue)
Drop the next event packet from the queue.
bool al_event_queue_is_empty(ALLEGRO_EVENT_QUEUE *queue)
Return true if the event queue specified is currently empty.
void al_flip_display(void)
Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen.
void al_flush_event_queue(ALLEGRO_EVENT_QUEUE *queue)
Drops all events, if any, from the queue.
ALLEGRO_BITMAP *al_get_backbuffer(void)
Return a special bitmap representing the back-buffer of the current display.
int al_get_bitmap_flags(ALLEGRO_BITMAP *bitmap)
Return the flags user to create the bitmap.
int al_get_bitmap_format(ALLEGRO_BITMAP *bitmap)
Returns the pixel format of a bitmap.
int al_get_bitmap_height(ALLEGRO_BITMAP *bitmap)
Returns the height of a bitmap in pixels.
int al_get_bitmap_width(ALLEGRO_BITMAP *bitmap)
Returns the width of a bitmap in pixels.
void al_get_blender(int *src,
int *dst,
ALLEGRO_COLOR *color)
Returns the active blender for the current thread.
void al_get_clipping_rectangle(int *x,
int *y,
int *w,
int *h)
Gets the clipping rectangle of the target bitmap.
ALLEGRO_DISPLAY *al_get_current_display(void)
Query for the current display in the calling thread.
int al_get_display_flags(void)
Gets the flags of the current display.
int al_get_display_format(void)
Gets the pixel format of the current display.
int al_get_display_height(void)
Gets the height of the current display.
ALLEGRO_DISPLAY_MODE *al_get_display_mode(int index,
ALLEGRO_DISPLAY_MODE *mode)
Retrieves a display mode.
int al_get_display_refresh_rate(void)
Gets the refresh rate of the current display.
int al_get_display_width(void)
Gets the width of the current display.
ALLEGRO_BITMAP *al_get_frontbuffer(void)
Return a special bitmap representing the front-buffer of the current display.
ALLEGRO_JOYSTICK *al_get_joystick(int num)
Get a handle for joystick number NUM on the system.
const char *al_get_joystick_axis_name(const ALLEGRO_JOYSTICK *joy,
int stick,
int axis)
Return the name of the given axis.
const char *al_get_joystick_button_name(const ALLEGRO_JOYSTICK *joy,
int button)
Return the name of the given button.
const char *al_get_joystick_name(ALLEGRO_JOYSTICK *joy)
Return the name of the given joystick.
void al_get_joystick_state(ALLEGRO_JOYSTICK *joy,
ALLEGRO_JOYSTATE *ret_state)
Get the current joystick state.
int al_get_joystick_stick_flags(const ALLEGRO_JOYSTICK *joy,
int stick)
Return the flags of the given “stick”.
const char *al_get_joystick_stick_name(const ALLEGRO_JOYSTICK *joy,
int stick)
Return the name of the given “stick”.
ALLEGRO_KEYBOARD *al_get_keyboard(void)
Return a pointer to an object representing the keyboard, that can be used as an event source.
void al_get_keyboard_state(ALLEGRO_KBDSTATE *ret_state)
Save the state of the keyboard specified at the time the function is called into the structure pointed to by RET_STATE.
ALLEGRO_MOUSE *al_get_mouse(void)
Return a pointer to an object representing the mouse, that can be used as an event source.
unsigned int al_get_mouse_num_axes(void)
Return the number of buttons on the mouse.
unsigned int al_get_mouse_num_buttons(void)
Return the number of buttons on the mouse.
void al_get_mouse_state(ALLEGRO_MSESTATE *ret_state)
Save the state of the mouse specified at the time the function is called into the structure pointed to by RET_STATE.
int al_get_new_bitmap_flags(void)
Returns the flags used for newly created bitmaps.
int al_get_new_bitmap_format(void)
Returns the format used for newly created bitmaps.
int al_get_new_display_flags(void)
Gets the current flags used for newly created displays.
int al_get_new_display_format(void)
Gets the current pixel format used for newly created displays.
int al_get_new_display_refresh_rate(void)
Gets the current refresh rate used for newly created displays.
bool al_get_next_event(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT *ret_event)
Take the next event packet out of the event queue specified, and copy the contents into RET_EVENT, returning true.
int al_get_num_display_modes(void)
Get the number of available fullscreen display modes for the current set of display parameters.
int al_get_num_joystick_axes(const ALLEGRO_JOYSTICK *joy,
int stick)
Return the number of axes on the given “stick”.
int al_get_num_joystick_buttons(const ALLEGRO_JOYSTICK *joy)
Return the number of buttons on the joystick.
int al_get_num_joystick_sticks(const ALLEGRO_JOYSTICK *joy)
Return the number of “sticks” on the given joystick.
ALLEGRO_OGL_EXT_LIST *al_get_opengl_extension_list(void)
Returns the list of OpenGL extensions supported by Allegro, for the current display.
void *al_get_opengl_proc_address(AL_CONST char *name)
Helper to get the address of an OpenGL symbol
ALLEGRO_COLOR al_get_pixel(ALLEGRO_BITMAP *bitmap,
int x,
int y)
Get a pixel’s color value from the specified bitmap.
Extract the mouse axis value from the saved state.
ALLEGRO_BITMAP *al_get_target_bitmap(void)
Return the target bitmap of the current display.
AL_FUNC(long,
al_get_timer_count,
(ALLEGRO_TIMER *timer))
Return the timer’s counter value.
AL_FUNC(double,
al_get_timer_speed,
(ALLEGRO_TIMER *timer))
Return the timer’s speed, in seconds.
bool al_hide_mouse_cursor(void)
Hide the mouse cursor in the current display of the calling thread.
bool al_install_joystick(void)
Install a joystick driver, returning true if successful.
bool al_install_keyboard(void)
Install a keyboard driver.
bool al_install_mouse(void)
Install a mouse driver.
AL_FUNC(ALLEGRO_TIMER*,
al_install_timer,
(double speed_secs))
Install a new timer.
bool al_is_compatible_bitmap(ALLEGRO_BITMAP *bitmap)
D3D and OpenGL allow sharing a texture in a way so it can be used for multiple windows.
bool al_is_mouse_installed(void)
Returns true if al_install_mouse was called successfully.
int al_is_opengl_extension_supported(AL_CONST char *extension)
This function is a helper to determine whether an OpenGL extension is available on the current display or not.
bool al_key_down(const ALLEGRO_KBDSTATE *state,
int keycode)
Return true if the key specified was held down in the state specified.
const char *al_keycode_to_name(int keycode)
Converts the given keycode to a description of the key.
ALLEGRO_BITMAP *al_load_bitmap(char const *filename)
Load a bitmap from a file using the bitmap format and flags of the current thread.
ALLEGRO_LOCKED_REGION *al_lock_bitmap(ALLEGRO_BITMAP *bitmap,
ALLEGRO_LOCKED_REGION *locked_region,
int flags)
Lock an entire bitmap for reading or writing.
ALLEGRO_LOCKED_REGION *al_lock_bitmap_region(
   ALLEGRO_BITMAP *bitmap,
   int x,
   int y,
   int width,
   int height,
   ALLEGRO_LOCKED_REGION *locked_region,
   int flags
)
Like al_lock_bitmap, but only locks a specific area of the bitmap.
ALLEGRO_COLOR al_map_rgb(unsigned char r,
unsigned char g,
unsigned char b)
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
ALLEGRO_COLOR al_map_rgb_f(float r,
float g,
float b)
Convert r, g, b, (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.
ALLEGRO_COLOR al_map_rgba(unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
ALLEGRO_COLOR al_map_rgba_f(float r,
float g,
float b,
float a)
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
bool al_mouse_button_down(ALLEGRO_MSESTATE *state,
int button)
Return true if the mouse button specified was held down in the state specified.
int al_num_joysticks(void)
Return the number of joysticks on the system (depending on the OS this may not be accurate).
float al_opengl_version(void)
Returns the OpenGL version number of the client (the computer the program is running on), for the current DISPLAY.
bool al_peek_next_event(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT *ret_event)
Copy the contents of the next event packet in the event queue specified into RET_EVENT and return true.
void al_put_pixel(int x,
int y,
ALLEGRO_COLOR color)
Draw a single pixel on the target bitmap.
void al_register_event_source(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT_SOURCE *source)
Register the event source with the event queue specified.
void al_release_joystick(ALLEGRO_JOYSTICK *joy)
Release a previously ‘gotten’ joystick object.
bool al_resize_display(int width,
int height)
Resize the current display.
AL_FUNC(void,
al_rest,
(double seconds))
Waits for the specified number seconds.
void al_set_blender(int src,
int dst,
ALLEGRO_COLOR color)
Sets the function to use for blending for the current thread.
void al_set_clipping_rectangle(int x,
int y,
int width,
int height)
Set the region of the target bitmap or display that pixels get clipped to.
void al_set_current_display(ALLEGRO_DISPLAY *display)
Change the current display for the calling thread.
void al_set_display_icon(ALLEGRO_BITMAP *icon)
Changes the icon associated with the current display (window).
bool al_set_keyboard_leds(int leds)
Overrides the state of the keyboard LED indicators.
void al_set_memory_management_functions(
   void *(*malloc)(void *opaque, size_t size),
   void *(*malloc_atomic)(void *opaque, size_t size),
   void (*free)(void *opaque, void *ptr),
   void *(*realloc)(void *opaque, void *ptr, size_t size),
   void *(*debug_malloc)(int line, const char *file, const char *func, void *opaque, size_t size),
   void *(*debug_malloc_atomic)(int line, const char *file, const char *func, void *opaque, size_t size),
   void (*debug_free)(int line, const char *file, const char *func, void *opaque, void *ptr),
   void *(*debug_realloc)(int line, const char *file, const char *func, void *opaque, void *ptr, size_t size),
   void *user_opaque
)
Customise the memory management functions used by the library.
bool al_set_mouse_axis(int which,
int value)
Set the given mouse axis to the given value.
bool al_set_mouse_cursor(ALLEGRO_MOUSE_CURSOR *cursor)
Set the given mouse cursor to be the current mouse cursor.
bool al_set_mouse_range(int x1,
int y1,
int x2,
int y2)
Sets the area of the screen within which the mouse can move.
bool al_set_mouse_w(int w)
Set the mouse wheel position to the given value.
bool al_set_mouse_xy(int x,
int y)
Try to position the mouse at the given coordinates.
bool al_set_mouse_z(int z)
Set the mouse wheel position to the given value.
void al_set_new_bitmap_flags(int flags)
Sets the flags to use for newly created bitmaps.
void al_set_new_bitmap_format(int format)
Sets the pixel format for newly created bitmaps.
void al_set_new_display_flags(int flags)
Sets various flags for display creation.
void al_set_new_display_format(int format)
Set the pixel format for al displays created after this call.
void al_set_new_display_refresh_rate(int refresh_rate)
Sets the refresh rate to use for newly created displays.
bool al_set_system_mouse_cursor(ALLEGRO_SYSTEM_MOUSE_CURSOR cursor_id)
Set the given system mouse cursor to be the current mouse cursor.
void al_set_target_bitmap(ALLEGRO_BITMAP *bitmap)
Select the bitmap to which all subsequent drawing operations in the calling thread will draw.
AL_FUNC(void,
al_set_timer_count,
(ALLEGRO_TIMER *timer, long count))
Change a timer’s counter value.
AL_FUNC(void,
al_set_timer_speed,
(ALLEGRO_TIMER *timer, double speed_secs))
Set the timer’s speed, i.e.
bool al_show_mouse_cursor(void)
Make a mouse cursor visible in the current display of the calling thread.
AL_FUNC(void,
al_start_timer,
(ALLEGRO_TIMER *timer))
Start the timer specified.
AL_FUNC(void,
al_stop_timer,
(ALLEGRO_TIMER *timer))
Stop the timer specified.
AL_FUNC(bool,
al_timer_is_started,
(ALLEGRO_TIMER *timer))
Return true if the timer specified is currently started.
void al_uninstall_joystick(void)
Uninstalls the active joystick driver.
void al_uninstall_keyboard(void)
Uninstalls the active keyboard driver, if any.
void al_uninstall_mouse(void)
Uninstalls the active mouse driver, if any.
AL_FUNC(void,
al_uninstall_timer,
(ALLEGRO_TIMER *timer))
Uninstall the timer specified.
void al_unlock_bitmap(ALLEGRO_BITMAP *bitmap)
Unlock a previously locked bitmap or bitmap region.
void al_unmap_rgb(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b)
Retrieves components of an ALLEGRO_COLOR, ignoring alpha Components will range from 0-255.
void al_unmap_rgb_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b)
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.
void al_unmap_rgba(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b,
unsigned char *a)
Retrieves components of an ALLEGRO_COLOR.
void al_unmap_rgba_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b,
float *a)
Retrieves components of an ALLEGRO_COLOR.
void al_unregister_event_source(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT_SOURCE *source)
Unregister an event source with an event queue.
bool al_update_display_region(int x,
int y,
int width,
int height)
Update the the front buffer from the backbuffer in the specified region.
void al_wait_for_event(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT *ret_event)
Wait until the event queue specified is non-empty.
bool al_wait_for_event_timed(ALLEGRO_EVENT_QUEUE *queue,
ALLEGRO_EVENT *ret_event,
float secs)
Wait until the event queue specified is non-empty.
bool al_wait_for_vsync(void)
Wait for the beginning of a vertical retrace.