summaryrefslogtreecommitdiff
path: root/example/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/example.c')
-rw-r--r--example/example.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/example/example.c b/example/example.c
index 050afa3..bf315f0 100644
--- a/example/example.c
+++ b/example/example.c
@@ -3,5 +3,35 @@
int main()
{
+ struct kalmia_t *k = kalmia_parse_file("suzanne.dae");
+ if (k == NULL) {
+ fprintf(stderr, "Failed to read file!\n");
+ return 1;
+ }
+
+ printf(
+ "library_geometries[id=%s, name=%s]\n",
+ k->library_geometries->id,
+ k->library_geometries->name
+ );
+
+ int i;
+ for (i=0; i<k->library_geometries->geometry_count; i++) {
+ struct ka_geometry_t *g = k->library_geometries->geometry + i;
+ printf(" geometry[id=%s, name=%s]\n", g->id, g->name);
+ printf(" mesh\n");
+
+ int j;
+ for (j=0; j<g->mesh.source_count; j++) {
+ struct ka_source_t s = g->mesh.source[j];
+ printf(" source[id=%s, name=%s]\n", s.id, s.name);
+ }
+ for (j=0; j<g->mesh.triangles_count; j++) {
+ struct ka_triangles_t t = g->mesh.triangles[j];
+ printf(" triangles[name=%s, count=%d, material=%s]\n", t.name, t.count, t.material);
+ }
+ }
+
+ kalmia_destroy(k);
return 0;
}