---
name: "al_build_shader"
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/al_build_shader/3alleg5"
---

# al\_build\_shader(3alleg5)

Allegro 5 API

## NAME

al\_build\_shader - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  bool al_build_shader(ALLEGRO_SHADER *shader)
  ```

## DESCRIPTION

This is required before the shader can be used with al\_use\_shader(3alleg5). It should be called after successfully attaching the pixel and/or vertex shaders with al\_attach\_shader\_source(3alleg5) or al\_attach\_shader\_source\_file(3alleg5).

Returns true on success and false on error, in which case the error log is updated. The error log can be retrieved with al\_get\_shader\_log(3alleg5).

*Note:* If you are using the ALLEGRO\_PROGRAMMABLE\_PIPELINE flag, then you must specify both a pixel and a vertex shader sources for anything to be rendered.

## SINCE

5\.1.6

## SEE ALSO

al\_use\_shader(3alleg5), al\_get\_shader\_log(3alleg5)
