mesh, obj loading, sorting, shitty normals...
[dos_low3d] / src / 3dgfx.h
1 #ifndef GFX3D_H_
2 #define GFX3D_H_
3
4 #include "types.h"
5
6 #define XRES    320
7 #define YRES    200
8
9 struct g3d_vertex {
10         int32_t x, y, z, w;
11 };
12
13 enum {
14         G3D_POINTS = 1,
15         G3D_LINES,
16         G3D_TRIANGLES,
17         G3D_QUADS
18 };
19
20 extern unsigned char *g3d_fbpixels;
21 extern int g3d_width, g3d_height;
22 extern int g3d_curcidx;
23
24 extern int g3d_bbox[4];
25
26
27 int g3d_init(void);
28 void g3d_shutdown(void);
29
30 void g3d_framebuffer(int width, int height, void *fb);
31 void g3d_framebuf_addr(void *fb);
32
33 void g3d_clear_dirty(void);
34 void g3d_copy_dirty(void);
35
36 void g3d_modelview(const int32_t *m);
37 void g3d_projection(const int32_t *m);
38
39 void g3d_xform(struct g3d_vertex *v, const int32_t *m);
40
41 void g3d_color(int cidx);
42
43 void g3d_draw(int prim, struct g3d_vertex *varr, int vcount);
44 void g3d_draw_indexed(int prim, struct g3d_vertex *varr, unsigned short *idxarr,
45                 int idxcount);
46 void g3d_draw_prim(int prim, struct g3d_vertex *varr, unsigned short *idxarr);
47
48 /* defined in polyfill.asm */
49 void g3d_polyfill(struct g3d_vertex *verts);
50
51 #endif  /* GFX3D_H_ */