dos3d

annotate src/mingl.h @ 1:0b7f840afe4a

palette management
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 Nov 2011 08:35:58 +0200
parents
children 0e781cc43178
rev   line source
nuclear@0 1 /*
nuclear@0 2 256-color 3D graphics hack for real-mode DOS.
nuclear@0 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@0 4
nuclear@0 5 This program is free software: you can redistribute it and/or modify
nuclear@0 6 it under the terms of the GNU General Public License as published by
nuclear@0 7 the Free Software Foundation, either version 3 of the License, or
nuclear@0 8 (at your option) any later version.
nuclear@0 9
nuclear@0 10 This program is distributed in the hope that it will be useful,
nuclear@0 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@0 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@0 13 GNU General Public License for more details.
nuclear@0 14
nuclear@0 15 You should have received a copy of the GNU General Public License
nuclear@0 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@0 17 */
nuclear@0 18 #ifndef MINGL_H_
nuclear@0 19 #define MINGL_H_
nuclear@0 20
nuclear@0 21 /* enable bitflags */
nuclear@0 22 #define MGL_CULL_FACE 1
nuclear@0 23 #define MGL_DEPTH_TEST 2
nuclear@0 24 #define MGL_SMOOTH 4
nuclear@0 25 #define MGL_LIGHTING 8
nuclear@0 26
nuclear@0 27 /* primitives */
nuclear@0 28 #define MGL_POINTS 1
nuclear@0 29 #define MGL_LINES 2
nuclear@0 30 #define MGL_TRIANGLES 3
nuclear@0 31 #define MGL_QUADS 4
nuclear@0 32
nuclear@0 33 /* matrices */
nuclear@0 34 #define MGL_MODELVIEW 0
nuclear@0 35 #define MGL_PROJECTION 1
nuclear@0 36 #define MGL_TEXTURE 2
nuclear@0 37
nuclear@0 38 #define MGL_FRONT 0
nuclear@0 39 #define MGL_BACK 1
nuclear@0 40
nuclear@0 41 #define MGL_CCW 0
nuclear@0 42 #define MGL_CW 1
nuclear@0 43
nuclear@0 44 int mgl_init(int width, int height);
nuclear@0 45 void mgl_free(void);
nuclear@0 46
nuclear@0 47 unsigned char *mgl_framebuffer(void);
nuclear@0 48
nuclear@0 49 void mgl_clear(int cidx);
nuclear@0 50
nuclear@0 51 void mgl_enable(unsigned int bit);
nuclear@0 52 void mgl_disable(unsigned int bit);
nuclear@0 53
nuclear@0 54 void mgl_front_face(int ff);
nuclear@0 55 void mgl_cull_face(int cf);
nuclear@0 56
nuclear@0 57 void mgl_color_range(int rng);
nuclear@0 58 void mgl_light_intensity(int ltidx, float intens);
nuclear@0 59 void mgl_light_direction(int ltidx, float x, float y, float z);
nuclear@0 60
nuclear@0 61 void mgl_begin(int prim);
nuclear@0 62 void mgl_end(void);
nuclear@0 63
nuclear@0 64 void mgl_vertex2f(float x, float y);
nuclear@0 65 void mgl_vertex3f(float x, float y, float z);
nuclear@0 66 void mgl_vertex4f(float x, float y, float z, float w);
nuclear@0 67 void mgl_color1f(float energy);
nuclear@0 68 void mgl_index(int cidx);
nuclear@0 69 void mgl_normal(float x, float y, float z);
nuclear@0 70 void mgl_texcoord2f(float x, float y);
nuclear@0 71
nuclear@0 72 void mgl_viewport(int x, int y, int width, int height);
nuclear@0 73
nuclear@0 74 void mgl_matrix_mode(int mmode);
nuclear@0 75 void mgl_push_matrix(void);
nuclear@0 76 void mgl_pop_matrix(void);
nuclear@0 77 void mgl_load_matrix(float *mat);
nuclear@0 78 void mgl_mult_matrix(float *mat);
nuclear@0 79 void mgl_load_identity(void);
nuclear@0 80
nuclear@0 81 void mgl_translate(float x, float y, float z);
nuclear@0 82 void mgl_rotate(float angle, float x, float y, float z);
nuclear@0 83 void mgl_scale(float x, float y, float z);
nuclear@0 84
nuclear@0 85 void mgl_ortho(float left, float right, float bottom, float top, float nr, float fr);
nuclear@0 86 void mgl_frustum(float left, float right, float bottom, float top, float nr, float fr);
nuclear@0 87 void mgl_perspective(float vfov, float aspect, float nr, float fr);
nuclear@0 88
nuclear@0 89 void mgl_cube(float sz);
nuclear@0 90 void mgl_sphere(float rad, int usub, int vsub);
nuclear@0 91 void mgl_sphere_part(float rad, int usub, int vsub, float umax, float vmax);
nuclear@0 92 void mgl_torus(float inner, float outer, int usub, int vsub);
nuclear@0 93 void mgl_torus_part(float inner, float outer, int usub, int vsub, float umax, float vmin, float vmax);
nuclear@0 94
nuclear@0 95 #endif /* MINGL_H_ */