Skip to content

Texture.h (graphics)

tiffany352 edited this page Jan 1, 2013 · 1 revision

Types

typedef void (*ilG_texture_bind_cb)(struct ilG_context*, void*);
typedef void (*ilG_texture_update_cb)(struct ilG_context*, struct il_positionable*, void*);

typedef struct ilG_texture {
    unsigned int id;
    const char *name;
    ilG_texture_bind_cb bind, unbind;
    ilG_texture_update_cb update;
    void *bind_ctx, *update_ctx, *unbind_ctx;
} ilG_texture;

Represents an OpenGL texture. Corresponds to a single texture which may be made up of multiple image files (for example, a bump map PNG, a color map PNG, and a normal map PNG).

Variables

ilG_texture *ilG_texture_default;

A stub 1x1 white texture. Used for testing.

Functions

ilG_texture* ilG_texture_fromfile(const char *name);

Opens a texture PNG file from a file.

ilG_texture* ilG_texture_fromasset(ilA_asset* asset);

Opens a texture PNG file from an asset.

ilG_texture* ilG_texture_fromId(unsigned int id);

Converts a texture ID to a texture pointer.

void ilG_texture_assignId(ilG_texture*);

Assigns an ID to a texture.

void ilG_texture_setId(ilG_texture*, unsigned int id);

Sets the ID of a texture.

Clone this wiki locally