fog
[voxscape] / src / voxscape.h
1 #ifndef VOXSCAPE_H_
2 #define VOXSCAPE_H_
3
4 #include <stdint.h>
5
6 struct voxscape;
7
8 #define VOX_RGB(r, g, b)        \
9         ((uint32_t)(r) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 16))
10
11 struct voxscape *vox_create(int xsz, int ysz);
12 struct voxscape *vox_open(const char *hfile, const char *cfile);
13 void vox_free(struct voxscape *vox);
14
15 void vox_fog(struct voxscape *vox, int zstart, uint32_t color);
16 int vox_height(struct voxscape *vox, int32_t x, int32_t y);
17
18 void vox_framebuf(struct voxscape *vox, int xres, int yres, uint32_t *fb, int horizon);
19 /* negative height for auto at -h above terrain */
20 void vox_view(struct voxscape *vox, int32_t x, int32_t y, int h, int32_t angle);
21 void vox_proj(struct voxscape *vox, int fov, int znear, int zfar);
22
23 void vox_render(struct voxscape *vox);
24
25 void vox_begin(struct voxscape *vox);
26 void vox_render_slice(struct voxscape *vox, int n);
27
28 void vox_sky_solid(struct voxscape *vox, uint32_t color);
29 void vox_sky_grad(struct voxscape *vox, uint32_t chor, uint32_t ctop);
30
31 #endif  /* VOXSCAPE_H_ */