types

types —

Synopsis




#define     G3D_FLAG_IMG_GREYSCALE
            G3DImage;
#define     G3D_FLAG_MAT_TWOSIDE
            G3DMaterial;
#define     G3D_FLAG_FAC_NORMALS
#define     G3D_FLAG_FAC_TEXMAP
            G3DFace;
            G3DObject;
gboolean    (*G3DSetBgColorFunc)            (gfloat r,
                                             gfloat g,
                                             gfloat b,
                                             gfloat a,
                                             gpointer user_data);
gboolean    (*G3DUpdateInterfaceFunc)       (gpointer user_data);
gboolean    (*G3DUpdateProgressBarFunc)     (gfloat percentage,
                                             gboolean show,
                                             gpointer user_data);
            G3DContext;
            G3DModel;

Description

Details

G3D_FLAG_IMG_GREYSCALE

#define G3D_FLAG_IMG_GREYSCALE  (1L << 1)


G3DImage

typedef struct {
	gchar *name;
	guint32 width;
	guint32 height;
	guint8 depth;
	guint32 flags;
	guint8 *pixeldata;

	guint32 tex_id;
	gfloat tex_scale_u;
	gfloat tex_scale_v;
} G3DImage;


G3D_FLAG_MAT_TWOSIDE

#define G3D_FLAG_MAT_TWOSIDE    (1L << 0)


G3DMaterial

typedef struct {
	gchar *name;
	gfloat r, g, b, a;
	gfloat shininess;
	gfloat specular[4];
	guint32 flags;

	G3DImage *tex_image;
} G3DMaterial;


G3D_FLAG_FAC_NORMALS

#define G3D_FLAG_FAC_NORMALS    (1L << 0)


G3D_FLAG_FAC_TEXMAP

#define G3D_FLAG_FAC_TEXMAP     (1L << 1)


G3DFace

typedef struct {
	guint32 vertex_count;
	guint32 *vertex_indices;

	G3DMaterial *material;

	guint32 flags;

	gfloat *normals;

	G3DImage *tex_image;
	guint32 tex_vertex_count;
	gfloat *tex_vertex_data;
} G3DFace;


G3DObject

typedef struct {
	gchar *name;

	GSList *materials;
	GSList *faces;
	GSList *objects;

	/* vertices */
	guint32 vertex_count;
	gfloat *vertex_data;

	/* texture stuff: temporary storage, should be in G3DFace items */
	guint32 tex_vertex_count;
	gfloat *tex_vertex_data;
	G3DImage *tex_image;

	/* some fields to speed up rendering, should not be used by plugins */
	/* FIXME: remove from API (replace with user_data pointer?) */
	gfloat *_normals;
	G3DMaterial **_materials;
	guint32  _num_faces;
	guint32 *_indices;
	guint32 *_flags;
	guint32 *_tex_images;
	gfloat *_tex_coords;
} G3DObject;


G3DSetBgColorFunc ()

gboolean    (*G3DSetBgColorFunc)            (gfloat r,
                                             gfloat g,
                                             gfloat b,
                                             gfloat a,
                                             gpointer user_data);

r :
g :
b :
a :
user_data :
Returns :

G3DUpdateInterfaceFunc ()

gboolean    (*G3DUpdateInterfaceFunc)       (gpointer user_data);

user_data :
Returns :

G3DUpdateProgressBarFunc ()

gboolean    (*G3DUpdateProgressBarFunc)     (gfloat percentage,
                                             gboolean show,
                                             gpointer user_data);

percentage :
show :
user_data :
Returns :

G3DContext

typedef struct {
	GSList *plugins;

	GHashTable *exts_import;
	GHashTable *exts_image;

	G3DSetBgColorFunc set_bgcolor_func;
	gpointer set_bgcolor_data;
	G3DUpdateInterfaceFunc update_interface_func;
	gpointer update_interface_data;
	G3DUpdateProgressBarFunc update_progress_bar_func;
	gpointer update_progress_bar_data;
} G3DContext;


G3DModel

typedef struct {
	gchar *filename;
	G3DContext *context;

	GSList *materials;
	GSList *objects;

	GHashTable *tex_images;
} G3DModel;