tinygi
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/tinygi.h Sun Jul 19 18:30:29 2015 +0300 1.3 @@ -0,0 +1,34 @@ 1.4 +#ifndef TINYGI_H_ 1.5 +#define TINYGI_H_ 1.6 + 1.7 +struct tgi_vec3 { float x, y, z; }; 1.8 + 1.9 +struct tinygi; 1.10 +struct tgi_object; 1.11 +struct tgi_shape; 1.12 + 1.13 +struct tinygi *tgi_init(void); 1.14 +void tgi_destroy(struct tinygi *tgi); 1.15 + 1.16 +void tgi_clear_scene(struct tinygi *tgi); 1.17 +int tgi_load_scene(struct tinygi *tgi, const char *fname); 1.18 +void tgi_add_object(struct tinygi *tgi, struct tgi_object *o); 1.19 +int tgi_del_object(struct tinygi *tgi, struct tgi_object *o); 1.20 + 1.21 +struct tgi_object *tgi_find_object(struct tinygi *tgi, const char *name); 1.22 +struct tgi_object *tgi_get_object(struct tinygi *tgi, int idx); 1.23 +int tgi_get_object_count(struct tinygi *tgi); 1.24 + 1.25 +/* shapes */ 1.26 +struct tgi_shape *tgi_create_sphere(float rad); 1.27 +struct tgi_shape *tgi_create_box(float x0, float y0, float z0, float x1, float y1, float z1); 1.28 +void tgi_destroy_shape(struct tgi_shape *s); 1.29 + 1.30 +/* objects */ 1.31 +/* name can be null, in which case it's automatically generated */ 1.32 +struct tgi_object *tgi_create_object(const char *name); 1.33 +void tgi_destroy_object(struct tgi_object *o); 1.34 +void tgi_set_object_shape(struct tgi_object *o, struct tgi_shape *s); 1.35 +void tgi_set_object_mtl(struct tgi_object *o, struct tgi_material *m); 1.36 + 1.37 +#endif /* TINYGI_H_ */