X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2F3dgfx.h;h=8d05b8a6c99b70e80780b41d69785d00d124dd54;hb=9b942b99fe10222bee50c47bfc809de268d331ec;hp=4a3cde58d3a8a980dac16af36c7adff247785941;hpb=0945eeeef21fe85f9a592bfc2e41069a7894b08b;p=dosdemo diff --git a/src/3dgfx.h b/src/3dgfx.h index 4a3cde5..8d05b8a 100644 --- a/src/3dgfx.h +++ b/src/3dgfx.h @@ -7,7 +7,7 @@ struct g3d_vertex { float x, y, z, w; float nx, ny, nz; float u, v; - unsigned char r, g, b; + unsigned char r, g, b, a; }; enum { @@ -19,10 +19,15 @@ enum { /* g3d_enable/g3d_disable bits */ enum { - G3D_CULL_FACE = 1, - G3D_DEPTH_TEST = 2, /* XXX not implemented */ - G3D_LIGHTING = 4, - G3D_TEXTURE = 8, + G3D_CULL_FACE = 0x0001, + G3D_DEPTH_TEST = 0x0002, /* XXX not implemented */ + G3D_LIGHTING = 0x0004, + G3D_LIGHT0 = 0x0008, + G3D_LIGHT1 = 0x0010, + G3D_LIGHT2 = 0x0020, + G3D_LIGHT3 = 0x0040, + G3D_TEXTURE = 0x0080, + G3D_BLEND = 0x0100, G3D_ALL = 0x7fffffff }; @@ -33,7 +38,10 @@ enum { G3D_CCW, G3D_CW }; /* arg to g3d_polygon_mode */ enum { G3D_WIRE, - G3D_FLAT + G3D_FLAT, + G3D_GOURAUD, + G3D_TEX, + G3D_TEX_GOURAUD }; /* matrix stacks */ @@ -48,6 +56,7 @@ int g3d_init(void); void g3d_destroy(void); void g3d_framebuffer(int width, int height, void *pixels); +void g3d_viewport(int x, int y, int w, int h); void g3d_enable(unsigned int opt); void g3d_disable(unsigned int opt); @@ -74,6 +83,17 @@ 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_set_texture(int xsz, int ysz, void *pixels); + 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);