1 /* 2 * File: view.h 3 * 4 * Description: header for view.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_H 14 #define VIEW_H 15 16 #include <gtk/gtk.h> 17 #include <GL/gl.h> 18 #include <GL/glu.h> 19 #include <gtk/gtkgl.h> 20 21 #include "geo.h" 22 23 24 typedef enum { 25 VIEW_XY, 26 VIEW_YZ, 27 VIEW_XZ, 28 VIEW_3D 29 } ViewNums; 30 31 32 typedef struct _model_view model_view; 33 34 struct _model_view { 35 36 GtkWidget *gltable; 37 GtkWidget *glarea; 38 39 GdkGLContext *glcontext; 40 GdkGLDrawable *gldrawable; 41 42 GLfloat grid_mins[ 3 ]; 43 GLfloat grid_maxes[ 3 ]; 44 45 GLfloat heading, pitch, roll; /* viewport orientation */ 46 GLfloat dist; 47 GLfloat camX, camY, camZ; /* Camera location. */ 48 GLfloat minX, minY, minZ, maxX, maxY, maxZ; /* used to set up orthographic views */ 49 50 GLfloat cursX, cursY, cursZ, cursA; 51 52 int type; 53 int dirty; 54 int flipped; 55 }; 56 57 58 59 extern model_view *views[4]; 60 61 62 GtkWidget *create_view( int type ); 63 GtkWidget *view_create_dummy_drawable( void ) ; 64 65 gboolean view_redraw_all( void ) ; 66 void view_redraw_n( int frame_num ) ; 67 68 gint view_flip_cb( GtkWidget *widget, gpointer data ) ; 69 70 void view_set_height( float height ); /* acts on the 3d view only */ 71 void view_fov_changed( void ); /* acts on the 3d view only */ 72 73 #endif 74 75 76 77 78 79 80