initial import
[dosrtxon] / 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, a;  /* int 0-255 */
19 };
20
21 struct pimage {
22         uint16_t *pixels;
23         int width, height;
24
25         int xshift, yshift;
26         unsigned int xmask, ymask;
27 };
28
29 extern struct pimage pfill_fb;
30 extern struct pimage pfill_tex;
31
32 void polyfill(int mode, struct pvertex *verts, int nverts);
33 void polyfill_wire(struct pvertex *verts, int nverts);
34 void polyfill_flat(struct pvertex *verts, int nverts);
35 void polyfill_gouraud(struct pvertex *verts, int nverts);
36 void polyfill_tex(struct pvertex *verts, int nverts);
37 void polyfill_tex_gouraud(struct pvertex *verts, int nverts);
38
39 #endif  /* POLYFILL_H_ */