]> Dogcows Code - chaz/rasterize/blobdiff - vert.h
add texture mapping with perspective correction
[chaz/rasterize] / vert.h
diff --git a/vert.h b/vert.h
index 48b3e2db1c59bbcafb9538b92c89d9232e29502c..8a3567c6e7fd344054f426f559d78a1e198b0804 100644 (file)
--- a/vert.h
+++ b/vert.h
@@ -19,19 +19,22 @@ struct vert
 {
     vec_t   v;
     vec_t   n;
+    vec_t   t;
     color_t c;
 };
 typedef struct vert vert_t;
 
 
 /*
- * Initialize a vertex with a point vector, normal, and a color.
+ * Initialize a vertex with a point vector, normal, texture coordinates,
+ * and a color.
  */
 INLINE_MAYBE
-void vert_init(vert_t* r, vec_t v, vec_t n, color_t c)
+void vert_init(vert_t* r, vec_t v, vec_t n, vec_t t, color_t c)
 {
     r->v = v;
     r->n = n;
+    r->t = t;
     r->c = c;
 }
 
@@ -43,7 +46,7 @@ INLINE_MAYBE
 vert_t vert_new(vec_t v)
 {
     vert_t r;
-    vert_init(&r, v, VEC_ZERO, COLOR_WHITE);
+    vert_init(&r, v, VEC_ZERO, VEC_ZERO, COLOR_WHITE);
     return r;
 }
 
This page took 0.017693 seconds and 4 git commands to generate.