Skip to content
tiffany352 edited this page Jan 1, 2013 · 1 revision

Types

typedef void (*ilG_drawable3d_cb)(struct ilG_context*, struct il_positionable*, void*);

Draw callback.

typedef void (*ilG_drawable3d_bind_cb)(struct ilG_context*, void*);

Bind/unbind callback.

typedef void (*ilG_drawable3d_update_cb)(struct ilG_context*, struct il_positionable*, void*);

Update callback (Called before each draw).

typedef struct ilG_drawable3d {
    const char* name;
    unsigned int id;
    ilG_drawable3d_cb draw;
    ilG_drawable3d_bind_cb bind, unbind;
    ilG_drawable3d_update_cb update;
    void *draw_ctx, *bind_ctx, *unbind_ctx, *update_ctx;
    unsigned long long attrs;
} ilG_drawable3d;

A drawable roughly corresponds to one mesh file. There should only ever be one per mesh file, even though an arbitrarily large combination of mesh/material/texture/positionables can be made. There is a one-to-many relationship between drawables and positionables.

Functions

ilG_drawable3d* ilG_drawable3d_fromId(unsigned int id);

Takes a given drawable ID and returns a pointer to the actual struct.

void ilG_drawable3d_assignId(ilG_drawable3d*);

Assigns a drawable an ID.

void ilG_drawable3d_setId(ilG_drawable3d*, unsigned int id);

Sets the ID of a drawable.

Clone this wiki locally