These functions are declared in the main Allegro header file:

 #include <allegro5/allegro.h>

ALLEGRO_DISPLAY_MODE

typedef struct ALLEGRO_DISPLAY_MODE

Source Code

Used for fullscreen mode queries. Contains information about a supported fullscreen modes.

typedef struct ALLEGRO_DISPLAY_MODE {
   int width;          // Screen width
   int height;         // Screen height
   int format;         // The pixel format of the mode
   int refresh_rate;   // The refresh rate of the mode
} ALLEGRO_DISPLAY_MODE;

The refresh_rate may be zero if unknown.

For an explanation of what format means, see ALLEGRO_PIXEL_FORMAT.

See also: al_get_display_mode

al_get_display_mode

ALLEGRO_DISPLAY_MODE *al_get_display_mode(int index, ALLEGRO_DISPLAY_MODE *mode)

Source Code

Retrieves a fullscreen mode. Display parameters should not be changed between a call of al_get_num_display_modes and al_get_display_mode. index must be between 0 and the number returned from al_get_num_display_modes-1. mode must be an allocated ALLEGRO_DISPLAY_MODE structure. This function will return NULL on failure, and the mode parameter that was passed in on success.

See also: ALLEGRO_DISPLAY_MODE, al_get_num_display_modes

al_get_num_display_modes

int al_get_num_display_modes(void)

Source Code

Get the number of available fullscreen display modes for the current set of display parameters. This will use the values set with al_set_new_display_refresh_rate, and al_set_new_display_flags to find the number of modes that match. Settings the new display parameters to zero will give a list of all modes for the default driver.

See also: al_get_display_mode