rayzor

annotate src/min3d.h @ 2:c273c6f799a4

added fixcase utility to fix the ftp-ed files' case on linux
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Apr 2014 18:31:00 +0300
parents 2a5340a6eee4
children 5fcf72837b69
rev   line source
nuclear@1 1 #ifndef MIN3D_H_
nuclear@1 2 #define MIN3D_H_
nuclear@1 3
nuclear@1 4 #include "inttypes.h"
nuclear@1 5
nuclear@1 6 /* state toggles */
nuclear@1 7 enum {
nuclear@1 8 M3D_DEPTH_TEST,
nuclear@1 9 M3D_CULL_FACE,
nuclear@1 10 M3D_LIGHTING,
nuclear@1 11 M3D_LIGHT0,
nuclear@1 12 M3D_LIGHT1,
nuclear@1 13 M3D_LIGHT2,
nuclear@1 14 M3D_LIGHT3
nuclear@1 15 };
nuclear@1 16
nuclear@1 17 /* buffer bits */
nuclear@1 18 enum {
nuclear@1 19 M3D_COLOR_BUFFER_BIT = 1,
nuclear@1 20 M3D_DEPTH_BUFFER_BIT = 2
nuclear@1 21 };
nuclear@1 22
nuclear@1 23 /* primitives */
nuclear@1 24 enum {
nuclear@1 25 M3D_POINTS = 1,
nuclear@1 26 M3D_LINES = 2,
nuclear@1 27 M3D_TRIANGLES = 3,
nuclear@1 28 M3D_QUADS = 4
nuclear@1 29 };
nuclear@1 30
nuclear@1 31 /* matrix mode */
nuclear@1 32 enum {
nuclear@1 33 M3D_MODELVIEW,
nuclear@1 34 M3D_PROJECTION
nuclear@1 35 };
nuclear@1 36
nuclear@1 37 struct m3d_image {
nuclear@1 38 int xsz, ysz;
nuclear@1 39 unsigned char *pixels;
nuclear@1 40 };
nuclear@1 41
nuclear@1 42 #ifdef __cplusplus
nuclear@1 43 extern "C" {
nuclear@1 44 #endif
nuclear@1 45
nuclear@1 46 void m3d_set_buffers(struct m3d_image *cbuf, uint16_t *zbuf);
nuclear@1 47 void m3d_clear(unsigned int bmask);
nuclear@1 48
nuclear@1 49 void m3d_enable(int bit);
nuclear@1 50 void m3d_disable(int bit);
nuclear@1 51
nuclear@1 52 /* matrix stack */
nuclear@1 53 void m3d_matrix_mode(int mode);
nuclear@1 54 void m3d_load_identity(void);
nuclear@1 55 void m3d_load_matrix(const float *m);
nuclear@1 56 void m3d_mult_matrix(const float *m);
nuclear@1 57 void m3d_translate(float x, float y, float z);
nuclear@1 58 void m3d_rotate(float angle, float x, float y, float z);
nuclear@1 59 void m3d_scale(float x, float y, float z);
nuclear@1 60 void m3d_frustum(float left, float right, float bottom, float top, float nr, float fr);
nuclear@1 61 void m3d_perspective(float vfov, float aspect, float znear, float zfar);
nuclear@1 62
nuclear@1 63 /* drawing */
nuclear@1 64 void m3d_draw(int prim, const float *varr, int vcount);
nuclear@1 65 void m3d_draw_indexed(int prim, const float *varr, const int *idxarr, int icount);
nuclear@1 66
nuclear@1 67 /* TODO immediate mode */
nuclear@1 68
nuclear@1 69 #ifdef __cplusplus
nuclear@1 70 }
nuclear@1 71 #endif
nuclear@1 72
nuclear@1 73 #endif /* MIN3D_H_ */