split the polyfiller to a preprocessor-based template file, included
[dosdemo] / src / polyfill.h
1 #ifndef POLYFILL_H_
2 #define POLYFILL_H_
3
4 #include "inttypes.h"
5
6 enum {
7         POLYFILL_WIRE,
8         POLYFILL_FLAT,
9         POLYFILL_GOURAUD,
10         POLYFILL_TEX,
11         POLYFILL_TEX_GOURAUD
12 };
13
14 /* projected vertices for the rasterizer */
15 struct pvertex {
16         int32_t x, y; /* 24.8 fixed point */
17         int32_t u, v; /* 16.16 fixed point */
18         int32_t r, g, b;  /* int 0-255 */
19 };
20
21 struct pimage {
22         uint16_t *pixels;
23         int width, height;
24 };
25
26 extern struct pimage pimg_fb;
27 extern struct pimage pimg_texture;
28
29 void polyfill(int mode, struct pvertex *verts, int nverts);
30 void polyfill_wire(struct pvertex *verts, int nverts);
31 void polyfill_flat(struct pvertex *verts, int nverts);
32 void polyfill_gouraud(struct pvertex *verts, int nverts);
33 void polyfill_tex(struct pvertex *verts, int nverts);
34 void polyfill_tex_gouraud(struct pvertex *verts, int nverts);
35
36 #endif  /* POLYFILL_H_ */