Windows

These functions are declared in the following header file:

 #include <allegro5/allegro_windows.h>

al_get_win_window_handle

HWND al_get_win_window_handle(ALLEGRO_DISPLAY *display)

Source Code

Returns the handle to the window that the passed display is using.

al_win_add_window_callback

bool al_win_add_window_callback(ALLEGRO_DISPLAY *display,
   bool (*callback)(ALLEGRO_DISPLAY *display, UINT message, WPARAM wparam,
   LPARAM lparam, LRESULT *result, void *userdata), void *userdata)

Source Code

The specified callback function will intercept the window's message before Allegro processes it. If the callback function consumes the event, then it should return true. In that case, Allegro will not do anything with the event.

Optionally, you may use result to customize what Allegro will return return in response to this event. By default, Allegro returns TRUE.

The userdata pointer can be used to supply additional context to the callback function.

The callbacks are executed in the same order they were added.

Returns true if the callback was added.

Since: 5.1.2

al_win_remove_window_callback

bool al_win_remove_window_callback(ALLEGRO_DISPLAY *display,
   bool (*callback)(ALLEGRO_DISPLAY *display, UINT message, WPARAM wparam,
   LPARAM lparam, LRESULT *result, void *userdata), void *userdata)

Source Code

Removes the callback that was previously registered with al_win_add_window_callback. The userdata pointer must be the same as what was used during the registration of the callback.

Returns true if the callback was removed.

Since: 5.1.2

Mac OS X

These functions are declared in the following header file:

 #include <allegro5/allegro_osx.h>

al_osx_get_window

NSWindow* al_osx_get_window(ALLEGRO_DISPLAY *display)

Source Code

Retrieves the NSWindow handle associated with the Allegro display.

Since: 5.0.8, 5.1.3

iPhone

These functions are declared in the following header file:

 #include <allegro5/allegro_iphone.h>

al_iphone_set_statusbar_orientation

void al_iphone_set_statusbar_orientation(int o)

Source Code

Sets the orientation of the status bar, which can be one of the following:

Since: 5.1.0

al_iphone_get_view

UIView *al_iphone_get_view(ALLEGRO_DISPLAY *display)

Source Code

Retrieves the UIView* (EAGLView*) associated with the Allegro display.

Since: 5.1.0

al_iphone_get_window

UIWindow *al_iphone_get_window(ALLEGRO_DISPLAY *display)

Source Code

Retrieves the UIWindow* associated with the Allegro display.

Since: 5.1.0

Android

These functions are declared in the following header file:

 #include <allegro5/allegro_android.h>

al_android_set_apk_file_interface

void al_android_set_apk_file_interface(void)

Source Code

This function will set up a custom ALLEGRO_FILE_INTERFACE that makes all future calls of al_fopen read from the applicatons's APK file.

Note: Currently, access to the APK file after calling this function is read only.

Since: 5.1.2

al_android_set_apk_fs_interface

void al_android_set_apk_fs_interface(void)

Source Code

This function will set up a custom ALLEGRO_FS_INTERFACE which allows working within the APK filesystem. The filesystem root is your assets directory and there is read-only access to all files within.

Note: Some things like querying file size or attributes are not supported by this. You can always use the PhysFS addon to open the APK file (it is just a regular .zip file) and get more complete information.

Since: 5.1.13

al_android_get_os_version

const char *al_android_get_os_version(void)

Source Code

Returns a pointer to a static buffer that contains the version string of the Android platform that the calling Allegro program is running on.

Since: 5.1.2

X11

These functions are declared in the following header file:

 #include <allegro5/allegro_x.h>

al_get_x_window_id

XID al_get_x_window_id(ALLEGRO_DISPLAY *display)

Source Code

Retrieves the XID associated with the Allegro display.

Since: 5.1.12

Allegro version 5.2.1 - Last updated: 2016-08-14 03:14:20 UTC