#ifndef _MODEL_H_
#define _MODEL_H_
+#include "array.h"
#include "color.h"
#include "common.h"
-#include "list.h"
#include "mat.h"
+#include "tri.h"
#define MODEL_TYPE_RAW (1)
#define MODEL_TYPE_OBJ (2)
+// create an interface for a vector array
+DEFINE_ARRAY_TYPE(tri);
+
/*
* A model is a group of geometry and its attributes.
/*
- * Get the model's geometry as a list of triangles.
+ * Get the model's geometry as an array of triangles.
*/
-const list_t* model_geometry(const model_t* m);
+const array_t* model_geometry(const model_t* m);
/*
* Get the number of triangles that make up the model.
*/
color_t model_tcolor(const model_t* m, vec_t pt);
+/*
+ * Get a copy of the raw texture data. It must be freed when not needed.
+ * Returns NULL if the model has no texture.
+ */
+void* model_tdata(const model_t* m, int* width, int* height);
+
/*
* Post-multiply a transformation matrix to the internal matrix representing