nuclear@0: /* nuclear@0: 256-color 3D graphics hack for real-mode DOS. nuclear@0: Copyright (C) 2011 John Tsiombikas nuclear@0: nuclear@0: This program is free software: you can redistribute it and/or modify nuclear@0: it under the terms of the GNU General Public License as published by nuclear@0: the Free Software Foundation, either version 3 of the License, or nuclear@0: (at your option) any later version. nuclear@0: nuclear@0: This program is distributed in the hope that it will be useful, nuclear@0: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@0: GNU General Public License for more details. nuclear@0: nuclear@0: You should have received a copy of the GNU General Public License nuclear@0: along with this program. If not, see . nuclear@0: */ nuclear@0: #ifndef MINGL_H_ nuclear@0: #define MINGL_H_ nuclear@0: nuclear@0: /* enable bitflags */ nuclear@0: #define MGL_CULL_FACE 1 nuclear@0: #define MGL_DEPTH_TEST 2 nuclear@0: #define MGL_SMOOTH 4 nuclear@0: #define MGL_LIGHTING 8 nuclear@0: nuclear@0: /* primitives */ nuclear@0: #define MGL_POINTS 1 nuclear@0: #define MGL_LINES 2 nuclear@0: #define MGL_TRIANGLES 3 nuclear@0: #define MGL_QUADS 4 nuclear@0: nuclear@0: /* matrices */ nuclear@0: #define MGL_MODELVIEW 0 nuclear@0: #define MGL_PROJECTION 1 nuclear@0: #define MGL_TEXTURE 2 nuclear@0: nuclear@0: #define MGL_FRONT 0 nuclear@0: #define MGL_BACK 1 nuclear@0: nuclear@0: #define MGL_CCW 0 nuclear@0: #define MGL_CW 1 nuclear@0: nuclear@0: int mgl_init(int width, int height); nuclear@0: void mgl_free(void); nuclear@0: nuclear@0: unsigned char *mgl_framebuffer(void); nuclear@0: nuclear@0: void mgl_clear(int cidx); nuclear@0: nuclear@0: void mgl_enable(unsigned int bit); nuclear@0: void mgl_disable(unsigned int bit); nuclear@0: nuclear@0: void mgl_front_face(int ff); nuclear@0: void mgl_cull_face(int cf); nuclear@0: nuclear@0: void mgl_color_range(int rng); nuclear@0: void mgl_light_intensity(int ltidx, float intens); nuclear@0: void mgl_light_direction(int ltidx, float x, float y, float z); nuclear@0: nuclear@0: void mgl_begin(int prim); nuclear@0: void mgl_end(void); nuclear@0: nuclear@0: void mgl_vertex2f(float x, float y); nuclear@0: void mgl_vertex3f(float x, float y, float z); nuclear@0: void mgl_vertex4f(float x, float y, float z, float w); nuclear@0: void mgl_color1f(float energy); nuclear@0: void mgl_index(int cidx); nuclear@0: void mgl_normal(float x, float y, float z); nuclear@0: void mgl_texcoord2f(float x, float y); nuclear@0: nuclear@0: void mgl_viewport(int x, int y, int width, int height); nuclear@0: nuclear@0: void mgl_matrix_mode(int mmode); nuclear@0: void mgl_push_matrix(void); nuclear@0: void mgl_pop_matrix(void); nuclear@0: void mgl_load_matrix(float *mat); nuclear@0: void mgl_mult_matrix(float *mat); nuclear@0: void mgl_load_identity(void); nuclear@0: nuclear@0: void mgl_translate(float x, float y, float z); nuclear@0: void mgl_rotate(float angle, float x, float y, float z); nuclear@0: void mgl_scale(float x, float y, float z); nuclear@0: nuclear@0: void mgl_ortho(float left, float right, float bottom, float top, float nr, float fr); nuclear@0: void mgl_frustum(float left, float right, float bottom, float top, float nr, float fr); nuclear@0: void mgl_perspective(float vfov, float aspect, float nr, float fr); nuclear@0: nuclear@0: void mgl_cube(float sz); nuclear@0: void mgl_sphere(float rad, int usub, int vsub); nuclear@0: void mgl_sphere_part(float rad, int usub, int vsub, float umax, float vmax); nuclear@0: void mgl_torus(float inner, float outer, int usub, int vsub); nuclear@0: void mgl_torus_part(float inner, float outer, int usub, int vsub, float umax, float vmin, float vmax); nuclear@0: nuclear@0: #endif /* MINGL_H_ */