added polygon clipper, not using it yet
[dosdemo] / src / polyclip.h
1 #ifndef POLYCLIP_H_
2 #define POLYCLIP_H_
3
4 #include "3dgfx.h"
5
6 struct cplane {
7         float x, y, z;
8         float nx, ny, nz;
9 };
10
11 /* Polygon clipper
12  * returns:
13  *  1 -> fully inside, not clipped
14  *  0 -> straddling the plane and clipped
15  * -1 -> fully outside, not clipped
16  * in all cases, vertices are copied to vout, and the vertex count is written
17  * to wherever voutnum is pointing
18  */
19 int clip_poly(struct g3d_vertex *vout, int *voutnum,
20                 const struct g3d_vertex *vin, int vnum, struct cplane *plane);
21
22 #endif  /* POLYCLIP_H_ */