1 /*
2  * File:         view_config.h
3  *
4  * Description:  header for view_config.c
5  *
6  *
7  * This source code is part of kludge3d, and is released under the
8  * GNU General Public License.
9  *
10  *
11  */
12 
13 #ifndef VIEW_CONFIG_H
14 #define VIEW_CONFIG_H
15 
16 #include <GL/gl.h>
17 #include <GL/glu.h>
18 
19 
20 #define MP_SHOW_WIREFRAME  0
21 #define MP_SHOW_FLAT	   1
22 #define MP_SHOW_TEXTURED   2
23 
24 #define MP_MODE_RENDER		  0
25 #define MP_MODE_SELECTION	   1
26 
27 #define MP_TRI_ORDER_CCW  0
28 #define MP_TRI_ORDER_CW   1
29 #define MP_TRI_ORDER_ALL  2
30 
31 typedef struct _model_view_config model_view_config;
32 
33 /* view configuration */
34 struct _model_view_config {
35 
36 	GLfloat bkgnd_color[ 3 ];
37 	GLfloat grid_color[ 3 ];
38 	GLfloat vertex_unsel_color[ 3 ];
39 	GLfloat vertex_sel_color[ 3 ];
40 	GLfloat poly_unsel_color[ 3 ];
41 	GLfloat poly_sel_color[ 3 ];
42 
43 
44 	GLfloat cursor_rad;
45 	GLfloat vertex_rad;
46 	GLfloat girder_rad;
47 
48 	GLfloat fov, near_plane, far_plane;
49 
50 	GLfloat grid_spacing;
51 
52 	unsigned int vertices_visible;
53 	unsigned int grid_visible;
54 	unsigned int origin_visible;
55 	unsigned int normals_visible;
56 
57 	unsigned int cursor_visible;
58 
59 	int polygon_mode;	/* textured, flat, wireframe, etc. */
60 	int render_mode;	/* regular rendering, or picking */
61 	int triangle_order;	/* counter-clockwise, clockwise, etc */
62 
63 	int draw_verts_as_cubes;
64 };
65 
66 extern model_view_config view_config;
67 
68 extern GLfloat *cursor_glarray;		/* GL arrays describing */
69 extern GLfloat *vertex_glarray; 	/* helper objects */
70 extern GLfloat *girder_glarray;
71 
72 
73 void view_config_init( void ) ;
74 int view_retrieve_preferences( void ) ;
75 
76 void view_rebuild_glarrays( void ) ;
77 
78 void view_set_rendermode( int mode );
79 void view_set_triangleorder( int order );
80 void view_set_vertexsize( float size );
81 void view_set_fov( float fov );
82 
83 #endif
84 
85 
86 
87