deepstone
diff src/mingl.h @ 28:11d14f688485
added clipping
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 22 Sep 2013 06:38:08 +0300 |
parents | 0909996838ff |
children |
line diff
1.1 --- a/src/mingl.h Sun Sep 22 02:47:46 2013 +0300 1.2 +++ b/src/mingl.h Sun Sep 22 06:38:08 2013 +0300 1.3 @@ -1,29 +1,18 @@ 1.4 -/* 1.5 -256-color 3D graphics hack for real-mode DOS. 1.6 -Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org> 1.7 - 1.8 -This program is free software: you can redistribute it and/or modify 1.9 -it under the terms of the GNU General Public License as published by 1.10 -the Free Software Foundation, either version 3 of the License, or 1.11 -(at your option) any later version. 1.12 - 1.13 -This program is distributed in the hope that it will be useful, 1.14 -but WITHOUT ANY WARRANTY; without even the implied warranty of 1.15 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.16 -GNU General Public License for more details. 1.17 - 1.18 -You should have received a copy of the GNU General Public License 1.19 -along with this program. If not, see <http://www.gnu.org/licenses/>. 1.20 -*/ 1.21 #ifndef MINGL_H_ 1.22 #define MINGL_H_ 1.23 1.24 /* enable bitflags */ 1.25 -#define MGL_CULL_FACE 1 1.26 -#define MGL_DEPTH_TEST 2 1.27 -#define MGL_SMOOTH 4 1.28 -#define MGL_LIGHTING 8 1.29 -#define MGL_TEXTURE_2D 16 1.30 +#define MGL_CULL_FACE 0 1.31 +#define MGL_DEPTH_TEST 1 1.32 +#define MGL_SMOOTH 2 1.33 +#define MGL_LIGHTING 3 1.34 +#define MGL_TEXTURE_2D 4 1.35 +#define MGL_CLIP_PLANE0 5 1.36 +#define MGL_CLIP_PLANE1 6 1.37 +#define MGL_CLIP_PLANE2 7 1.38 +#define MGL_CLIP_PLANE3 8 1.39 +#define MGL_CLIP_PLANE4 9 1.40 +#define MGL_CLIP_PLANE5 10 1.41 1.42 /* primitives */ 1.43 #define MGL_POINTS 1 1.44 @@ -57,6 +46,9 @@ 1.45 void mgl_front_face(int ff); 1.46 void mgl_cull_face(int cf); 1.47 1.48 +void mgl_set_ambient(float amb); 1.49 +float mgl_get_ambient(void); 1.50 + 1.51 void mgl_color_range(int rng); 1.52 void mgl_light_intensity(int ltidx, float intens); 1.53 void mgl_light_position(int ltidx, float x, float y, float z, float w); 1.54 @@ -91,6 +83,8 @@ 1.55 1.56 void mgl_teximage(int width, int height, unsigned char *pixels); 1.57 1.58 +void mgl_clip_plane(int id, float nx, float ny, float nz, float dist); 1.59 + 1.60 void mgl_cube(float sz); 1.61 void mgl_sphere(float rad, int usub, int vsub); 1.62 void mgl_sphere_part(float rad, int usub, int vsub, float umax, float vmax);