X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Frasterize;a=blobdiff_plain;f=model.h;h=8f05c7aff37281fda39016346fafdda5270010ce;hp=b2b3eb48cde55113ebf948261933f3ccb5d8750b;hb=bc662e293c854e1bdc9d46e9a410fe220247e6d4;hpb=07083c8dfbbd4fe48e84d86ce8d7e44e0719b84a diff --git a/model.h b/model.h index b2b3eb4..8f05c7a 100644 --- a/model.h +++ b/model.h @@ -8,15 +8,19 @@ #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. @@ -43,9 +47,9 @@ void model_destroy(model_t* m); /* - * 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. @@ -78,6 +82,12 @@ void model_transformation(const model_t* m, mat_t* transform); */ 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