b39574a9949ea411437fbdf18def915a500e2927
[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         unsigned char r, g, b;
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
33 #endif  /* POLYFILL_H_ */