# texture.c File Reference

AllegroGL texture management. More...

`#include <string.h>`
`#include "alleggl.h"`
`#include "allglint.h"`
`#include <allegro/internal/aintern.h>`
`#include <GL/glu.h>`

Go to the source code of this file.

## Defines

- #define PREFIX_I "agl-tex INFO: "
- #define PREFIX_W "agl-tex WARNING: "
- #define PREFIX_E "agl-tex ERROR: "
- #define F(s) case s: return #s

## Functions

- char const * __allegro_gl_get_format_description (GLint format)
- int __allegro_gl_get_num_channels (GLenum format)
- GLint __allegro_gl_get_texture_format_ex (BITMAP *bmp, int flags)
- GLenum __allegro_gl_get_bitmap_type (BITMAP *bmp, int flags)
- GLenum __allegro_gl_get_bitmap_color_format (BITMAP *bmp, int flags)
- static int __allegro_gl_convert_flags (int flags)
- static int log2i (int n)
- BITMAP * __allegro_gl_munge_bitmap (int flags, BITMAP *bmp, int x, int y, int w, int h, GLint *type, GLint *format)
- static GLuint do_texture_upload (BITMAP *bmp, GLuint tex, GLint internal_format, GLint format, GLint type, int flags)
- GLenum allegro_gl_get_bitmap_type (BITMAP *bmp)
- GLenum allegro_gl_get_bitmap_color_format (BITMAP *bmp)

Texture routines

- GLint allegro_gl_get_texture_format (BITMAP *bmp)
    Returns the OpenGL internal texture format for this bitmap.
- GLint allegro_gl_set_texture_format (GLint format)
    Sets the color format you'd like OpenGL to use for its textures.
- int allegro_gl_use_mipmapping (int enable)
    Tell AllegroGL to use Mipmapping or not when generating textures via its functions.
- int allegro_gl_use_alpha_channel (int enable)
    Tell AllegroGL to use Alpha channel or not when generating textures via its functions.
- int allegro_gl_flip_texture (int enable)
    Tell AllegroGL to flip the texture vertically or not when generating textures via its functions, to conform to the usual OpenGL texture coordinate system (increasing upwards).
- int allegro_gl_check_texture_ex (int flags, BITMAP *bmp, GLint internal_format)
    Checks whether the specified bitmap is of the proper size for texturing.
- int allegro_gl_check_texture (BITMAP *bmp)
    Checks whether the specified bitmap is of the proper size for texturing.
- GLuint allegro_gl_make_texture_ex (int flags, BITMAP *bmp, GLint internal_format)
    Uploads an Allegro BITMAP to the GL driver as a texture.
- GLuint allegro_gl_make_texture (BITMAP *bmp)
    Uploads an Allegro BITMAP to the GL driver as a texture.
- GLuint allegro_gl_make_masked_texture (BITMAP *bmp)
    Uploads an Allegro BITMAP to the GL driver as a texture.

## Variables

- static GLint allegro_gl_opengl_internal_texture_format = -1
- static int allegro_gl_use_mipmapping_for_textures = 0
- int __allegro_gl_use_alpha = FALSE
- int __allegro_gl_flip_texture = TRUE
- GLint __allegro_gl_texture_read_format [5]
- GLint __allegro_gl_texture_components [5]

## Detailed Description

AllegroGL texture management.

Definition in file texture.c.