10 unsigned char r, g, b, a;
20 /* g3d_enable/g3d_disable bits */
22 G3D_CULL_FACE = 0x0001,
23 G3D_DEPTH_TEST = 0x0002, /* XXX not implemented */
24 G3D_LIGHTING = 0x0004,
35 /* arg to g3d_front_face */
36 enum { G3D_CCW, G3D_CW };
38 /* arg to g3d_polygon_mode */
56 void g3d_destroy(void);
58 void g3d_framebuffer(int width, int height, void *pixels);
59 void g3d_viewport(int x, int y, int w, int h);
61 void g3d_enable(unsigned int opt);
62 void g3d_disable(unsigned int opt);
63 void g3d_setopt(unsigned int opt, unsigned int mask);
64 unsigned int g3d_getopt(unsigned int mask);
66 void g3d_front_face(unsigned int order);
67 void g3d_polygon_mode(int pmode);
69 void g3d_matrix_mode(int mmode);
71 void g3d_load_identity(void);
72 void g3d_load_matrix(const float *m);
73 void g3d_mult_matrix(const float *m);
74 void g3d_push_matrix(void);
75 void g3d_pop_matrix(void);
77 void g3d_translate(float x, float y, float z);
78 void g3d_rotate(float angle, float x, float y, float z);
79 void g3d_scale(float x, float y, float z);
80 void g3d_ortho(float left, float right, float bottom, float top, float znear, float zfar);
81 void g3d_frustum(float left, float right, float bottom, float top, float znear, float zfar);
82 void g3d_perspective(float vfov, float aspect, float znear, float zfar);
84 const float *g3d_get_matrix(int which, float *m);
86 void g3d_light_pos(int idx, float x, float y, float z);
87 void g3d_light_color(int idx, float r, float g, float b);
89 void g3d_light_ambient(float r, float g, float b);
91 void g3d_mtl_diffuse(float r, float g, float b);
92 void g3d_mtl_specular(float r, float g, float b);
93 void g3d_mtl_shininess(float shin);
95 void g3d_set_texture(int xsz, int ysz, void *pixels);
97 void g3d_draw(int prim, const struct g3d_vertex *varr, int varr_size);
98 void g3d_draw_indexed(int prim, const struct g3d_vertex *varr, int varr_size,
99 const int16_t *iarr, int iarr_size);
101 #endif /* THREEDGFX_H_ */