---
name: "al_get_opengl_texture"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_get_opengl_texture"
---

# al\_get\_opengl\_texture(3)

Allegro 5 API

## NAME

al\_get\_opengl\_texture - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_opengl.h>
  GLuint al_get_opengl_texture(ALLEGRO_BITMAP *bitmap)
  ```

## DESCRIPTION

Returns the OpenGL texture id internally used by the given bitmap if it uses one, else 0.

Example:

-

  ```
  bitmap = al_load_bitmap("my_texture.png");
  texture = al_get_opengl_texture(bitmap);
  if (texture != 0)
      glBindTexture(GL_TEXTURE_2D, texture);
  ```
