---
name: "request_refresh_rate"
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/request_refresh_rate"
---

# request\_refresh\_rate(3alleg)

Requests a specific refresh rate during graphic mode switch. Allegro game programming library.

## NAME

request\_refresh\_rate - Requests a specific refresh rate during graphic mode switch. Allegro game programming library.

## SYNOPSIS

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

**void request\_refresh\_rate(int rate);**

## DESCRIPTION

Requests that the next call to set\_gfx\_mode() try to use the specified  refresh rate, if possible. Not all drivers are able to control this at  all, and even when they can, not all rates will be possible on all  hardware, so the actual settings may differ from what you requested.  After you call set\_gfx\_mode(), you can use get\_refresh\_rate() to find out  what was actually selected. At the moment only the DOS VESA 3.0, X DGA 2.0 and some Windows DirectX drivers support this function. The speed is specified in Hz, eg. 60, 70. To return to the normal default selection, pass a rate value of zero. Example:

```
   request_refresh_rate(60);
   if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
      abort_on_error("Couldn't set graphic mode!");
   if (get_refresh_rate() != 60)
      abort_on_error("Couldn't set refresh rate to 60Hz!");
```

## SEE ALSO

[**set\_gfx\_mode**(3alleg)](/set_gfx_mode/3alleg.md), [**get\_refresh\_rate**(3alleg)](/get_refresh_rate/3alleg.md)
