---
name: "retrace_proc"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.1.15-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/retrace_proc"
---

# retrace\_proc(3alleg)

## NAME

retrace\_proc

## SYNOPSIS

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

**extern void (\*retrace\_proc)();**

## DESCRIPTION

If the retrace simulator is installed, this function is called during  every vertical retrace; otherwise, if the refresh rate is known, the  function is called at the same rate (ignoring retraces); otherwise it is  called 70 times a second. Set it to NULL to disable the callback. The  function must obey the same rules as regular timer handlers (ie. it must  be locked, and mustn´t call OS or libc functions) but even more so: it  must execute very quickly, or it will mess up the timer synchronisation.  The only use I can see for this function is for palette manipulations,  because triple buffering can be done with the request\_scroll() function,  and the retrace\_count variable can be used for timing your code. If you  want to alter the palette in the retrace\_proc you should use the inline  \_set\_color() function rather than the regular set\_color() or  set\_palette(), and you shouldn´t try to alter more than two or three  palette entries in a single retrace.

## SEE ALSO

[**timer\_simulate\_retrace**(3alleg)](/timer_simulate_retrace/3alleg.md), [**timer\_is\_using\_retrace**(3alleg)](/timer_is_using_retrace/3alleg.md), [**retrace\_count**(3alleg)](/retrace_count/3alleg.md), [**\_set\_color**(3alleg)](/_set_color/3alleg.md), [**ex3buf**(3alleg)](/ex3buf/3alleg.md)
