---
name: "ALLEGRO_RENDER_STATE"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ALLEGRO_RENDER_STATE/3alleg5"
---

# ALLEGRO\_RENDER\_STATE(3alleg5)

Allegro 5 API

## NAME

ALLEGRO\_RENDER\_STATE - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  typedef enum ALLEGRO_RENDER_STATE {
  ```

## DESCRIPTION

Possible render states which can be set with al\_set\_render\_state(3alleg5):

- ALLEGRO\_ALPHA\_TEST

  If this is set to 1, the values of ALLEGRO\_ALPHA\_FUNCTION and ALLEGRO\_ALPHA\_TEST\_VALUE define a comparison function which is performed on the alpha component of each pixel. Only if it evaluates to true the pixel is written. Otherwise no subsequent processing (like depth test or blending) is performed. This can be very useful, for example if a depth buffer is used but you do not want fully transparent pixels to modify it.

- ALLEGRO\_ALPHA\_FUNCTION

  One of ALLEGRO\_RENDER\_FUNCTION(3alleg5), only used when ALLEGRO\_ALPHA\_TEST is 1.

- ALLEGRO\_ALPHA\_TEST\_VALUE

  Only used when ALLEGRO\_ALPHA\_TEST is 1. Should be a value of 0 - 255.

- ALLEGRO\_WRITE\_MASK

  This determines how the framebuffer and depthbuffer are updated whenever a pixel is written (in case alpha and/or depth testing is enabled: after all such enabled tests succeed). Depth values are only written if ALLEGRO\_DEPTH\_TEST is 1, in addition to the write mask flag being set.

- ALLEGRO\_DEPTH\_TEST

  If this is set to 1, compare the depth value of any newly written pixels with the depth value already in the buffer, according to ALLEGRO\_DEPTH\_FUNCTION. Allegro primitives with no explicit z coordinate will write a value of 0 into the depth buffer.

- ALLEGRO\_DEPTH\_FUNCTION

  One of ALLEGRO\_RENDER\_FUNCTION(3alleg5), only used when ALLEGRO\_DEPTH\_TEST is 1.

## SINCE

5\.1.2

## SEE ALSO

al\_set\_render\_state(3alleg5), ALLEGRO\_RENDER\_FUNCTION(3alleg5), ALLEGRO\_WRITE\_MASK\_FLAGS(3alleg5)
