tinygi

annotate src/tinygi.h @ 0:16fdca2a1ef5

initial tinygi commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 19 Jul 2015 18:30:29 +0300
parents
children bc64090fe3d1
rev   line source
nuclear@0 1 #ifndef TINYGI_H_
nuclear@0 2 #define TINYGI_H_
nuclear@0 3
nuclear@0 4 struct tgi_vec3 { float x, y, z; };
nuclear@0 5
nuclear@0 6 struct tinygi;
nuclear@0 7 struct tgi_object;
nuclear@0 8 struct tgi_shape;
nuclear@0 9
nuclear@0 10 struct tinygi *tgi_init(void);
nuclear@0 11 void tgi_destroy(struct tinygi *tgi);
nuclear@0 12
nuclear@0 13 void tgi_clear_scene(struct tinygi *tgi);
nuclear@0 14 int tgi_load_scene(struct tinygi *tgi, const char *fname);
nuclear@0 15 void tgi_add_object(struct tinygi *tgi, struct tgi_object *o);
nuclear@0 16 int tgi_del_object(struct tinygi *tgi, struct tgi_object *o);
nuclear@0 17
nuclear@0 18 struct tgi_object *tgi_find_object(struct tinygi *tgi, const char *name);
nuclear@0 19 struct tgi_object *tgi_get_object(struct tinygi *tgi, int idx);
nuclear@0 20 int tgi_get_object_count(struct tinygi *tgi);
nuclear@0 21
nuclear@0 22 /* shapes */
nuclear@0 23 struct tgi_shape *tgi_create_sphere(float rad);
nuclear@0 24 struct tgi_shape *tgi_create_box(float x0, float y0, float z0, float x1, float y1, float z1);
nuclear@0 25 void tgi_destroy_shape(struct tgi_shape *s);
nuclear@0 26
nuclear@0 27 /* objects */
nuclear@0 28 /* name can be null, in which case it's automatically generated */
nuclear@0 29 struct tgi_object *tgi_create_object(const char *name);
nuclear@0 30 void tgi_destroy_object(struct tgi_object *o);
nuclear@0 31 void tgi_set_object_shape(struct tgi_object *o, struct tgi_shape *s);
nuclear@0 32 void tgi_set_object_mtl(struct tgi_object *o, struct tgi_material *m);
nuclear@0 33
nuclear@0 34 #endif /* TINYGI_H_ */