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

# next\_fli\_frame(3alleg)

Reads the next frame of the current animation file. Allegro game programming library.

## NAME

next\_fli\_frame - Reads the next frame of the current animation file. Allegro game programming library.

## SYNOPSIS

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

**int next\_fli\_frame(int loop);**

## DESCRIPTION

Reads the next frame of the current animation file. If \`loop' is not zero, the player will cycle when it reaches the end of the file, otherwise it will return FLI\_EOF. The frame is read into the global variables fli\_bitmap and fli\_palette. Example:

```
   while (next_fli_frame(0) == FLI_OK) {
      /* Do stuff, like play audio stream
         or check keys to skip animation. */
      /* Rest some time until next frame... */
   }
```

## RETURN VALUE

Returns FLI\_OK on success, FLI\_ERROR or FLI\_NOT\_OPEN on error, and FLI\_EOF on reaching the end of the file.

## SEE ALSO

[**open\_fli**(3alleg)](/open_fli/3alleg.md), [**fli\_bitmap**(3alleg)](/fli_bitmap/3alleg.md), [**fli\_palette**(3alleg)](/fli_palette/3alleg.md), [**fli\_timer**(3alleg)](/fli_timer/3alleg.md), [**fli\_frame**(3alleg)](/fli_frame/3alleg.md)
