split the polyfiller to a preprocessor-based template file, included
[dosdemo] / src / 3dgfx.h
index 68d0783..ecc3f3c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef THREEDGFX_H_
 #define THREEDGFX_H_
 
+#include "inttypes.h"
+
 struct g3d_vertex {
        float x, y, z, w;
        float nx, ny, nz;
@@ -20,7 +22,11 @@ enum {
        G3D_CULL_FACE = 1,
        G3D_DEPTH_TEST = 2,     /* XXX not implemented */
        G3D_LIGHTING = 4,
-       G3D_TEXTURE = 8,
+       G3D_LIGHT0 = 8,
+       G3D_LIGHT1 = 16,
+       G3D_LIGHT2 = 32,
+       G3D_LIGHT3 = 64,
+       G3D_TEXTURE = 128,
 
        G3D_ALL = 0x7fffffff
 };
@@ -28,6 +34,13 @@ enum {
 /* arg to g3d_front_face */
 enum { G3D_CCW, G3D_CW };
 
+/* arg to g3d_polygon_mode */
+enum {
+       G3D_WIRE,
+       G3D_FLAT,
+       G3D_GOURAUD,
+};
+
 /* matrix stacks */
 enum {
        G3D_MODELVIEW,
@@ -47,6 +60,7 @@ void g3d_setopt(unsigned int opt, unsigned int mask);
 unsigned int g3d_getopt(unsigned int mask);
 
 void g3d_front_face(unsigned int order);
+void g3d_polygon_mode(int pmode);
 
 void g3d_matrix_mode(int mmode);
 
@@ -65,6 +79,15 @@ void g3d_perspective(float vfov, float aspect, float znear, float zfar);
 
 const float *g3d_get_matrix(int which, float *m);
 
+void g3d_light_pos(int idx, float x, float y, float z);
+void g3d_light_color(int idx, float r, float g, float b);
+
+void g3d_light_ambient(float r, float g, float b);
+
+void g3d_mtl_diffuse(float r, float g, float b);
+void g3d_mtl_specular(float r, float g, float b);
+void g3d_mtl_shininess(float shin);
+
 void g3d_draw(int prim, const struct g3d_vertex *varr, int varr_size);
 void g3d_draw_indexed(int prim, const struct g3d_vertex *varr, int varr_size,
                const int16_t *iarr, int iarr_size);