---
name: "get_gfx_mode_list"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/get_gfx_mode_list"
---

# get\_gfx\_mode\_list(3alleg)

Obtains a list of available video modes. Allegro game programming library.

## NAME

get\_gfx\_mode\_list - Obtains a list of available video modes. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**GFX\_MODE\_LIST \*get\_gfx\_mode\_list(int card);**

## DESCRIPTION

Attempts to create a list of all the supported video modes for a certain graphics driver, made up from the GFX\_MODE\_LIST structure, which has the following definition:

```
   typedef struct GFX_MODE_LIST
   {
      int num_modes;
      GFX_MODE *mode;
   } GFX_MODE_LIST;
```

The mode entry  points to the actual list of video modes.

```
   typedef struct GFX_MODE
   {
      int width, height, bpp;
   } GFX_MODE;
```

This list of video modes is terminated with an { 0, 0, 0 } entry.

Note that the card parameter must refer to a \_real\_ driver. This function fails if you pass GFX\_SAFE, GFX\_AUTODETECT, or any other "magic" driver.

## RETURN VALUE

Returns a pointer to a list structure of the type GFX\_MODE\_LIST or NULL if the request could not be satisfied.

## SEE ALSO

[**destroy\_gfx\_mode\_list**(3alleg)](/destroy_gfx_mode_list/3alleg.md), [**set\_gfx\_mode**(3alleg)](/set_gfx_mode/3alleg.md), [**set\_color\_depth**(3alleg)](/set_color_depth/3alleg.md)
