X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2F3dgfx.h;h=363a1b2577e41b184bc16a4e234b6a72c7a4411d;hp=77104596d186bd7758900625a8ea72f618fb79c3;hb=091586fb9501d613f621fceb70fa21ff97c4898e;hpb=1442212ba0ff24b868dd29facc2278a26c8a9a18 diff --git a/src/3dgfx.h b/src/3dgfx.h index 7710459..363a1b2 100644 --- a/src/3dgfx.h +++ b/src/3dgfx.h @@ -19,15 +19,23 @@ enum { /* g3d_enable/g3d_disable bits */ enum { - 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_CULL_FACE = 0x000001, + G3D_DEPTH_TEST = 0x000002, /* XXX not implemented */ + G3D_LIGHTING = 0x000004, + G3D_LIGHT0 = 0x000008, + G3D_LIGHT1 = 0x000010, + G3D_LIGHT2 = 0x000020, + G3D_LIGHT3 = 0x000040, + G3D_TEXTURE_2D = 0x000080, /* XXX doesn't affect anything, use g3d_polygon_mode */ + G3D_BLEND = 0x000100, + G3D_TEXTURE_GEN = 0x000200, + G3D_CLIP_FRUSTUM = 0x000800,/* when disabled, don't clip against the frustum */ + G3D_CLIP_PLANE0 = 0x001000, /* user-defined 3D clipping planes XXX not impl. */ + G3D_CLIP_PLANE1 = 0x002000, + G3D_CLIP_PLANE2 = 0x004000, + G3D_CLIP_PLANE3 = 0x008000, + + G3D_TEXTURE_MAT = 0x010000, G3D_ALL = 0x7fffffff }; @@ -48,6 +56,7 @@ enum { enum { G3D_MODELVIEW, G3D_PROJECTION, + G3D_TEXTURE, G3D_NUM_MATRICES }; @@ -56,6 +65,7 @@ int g3d_init(void); void g3d_destroy(void); void g3d_framebuffer(int width, int height, void *pixels); +void g3d_framebuffer_addr(void *pixels); void g3d_viewport(int x, int y, int w, int h); void g3d_enable(unsigned int opt); @@ -81,6 +91,8 @@ void g3d_ortho(float left, float right, float bottom, float top, float znear, fl void g3d_frustum(float left, float right, float bottom, float top, float znear, float zfar); void g3d_perspective(float vfov, float aspect, float znear, float zfar); +/* returns pointer to the *internal* matrix, and if argument m is not null, + * also copies the internal matrix there. */ const float *g3d_get_matrix(int which, float *m); void g3d_light_pos(int idx, float x, float y, float z); @@ -96,14 +108,16 @@ 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); + const uint16_t *iarr, int iarr_size); void g3d_begin(int prim); void g3d_end(void); void g3d_vertex(float x, float y, float z); void g3d_normal(float x, float y, float z); -void g3d_color(float r, float g, float b); -void g3d_color4(float r, float g, float b, float a); +void g3d_color3b(unsigned char r, unsigned char g, unsigned char b); +void g3d_color4b(unsigned char r, unsigned char g, unsigned char b, unsigned char a); +void g3d_color3f(float r, float g, float b); +void g3d_color4f(float r, float g, float b, float a); void g3d_texcoord(float u, float v); #endif /* THREEDGFX_H_ */