home *** CD-ROM | disk | FTP | other *** search
- /* @(#)graphics.h 1.2 92/05/28 SMI */
- /* from graphics.h 1.4 90/07/23 SMI */
-
- /*
- * Copyright (c) 1986 by Sun Microsystems, Inc.
- */
-
- #ifndef GRAPHICS_H
- #define GRAPHICS_H
-
-
- #ifndef window_hs_DEFINED
- #ifdef XV
- #include <xview/window_hs.h>
- #else
- #include <sunwindow/window_hs.h>
- #endif XV
- #endif window_hs_DEFINED
-
- #ifdef XV
- #include <X11/Xlib.h>
- #include <X11/Xatom.h>
- #include <xview/xview.h>
- #include <xview/canvas.h>
- #endif XV
-
- #ifdef XGL
- #ifndef XGL_INCLUDED
- #include <xgl/xgl.h>
- #endif
- #else
- #ifndef DEV_GP1_ERR_NO_GP1
- #include "dev_gp1.h"
- #endif
- #endif XGL
-
-
-
- #ifdef XGL
-
- Xgl_trans Ctrl_view_mat ;
- Xgl_trans WIN_MAT ;
- Xgl_trans OBJ_MAT ;
- Xgl_trans ROT_MAT ;
- Xgl_trans TM1 ;
- Xgl_trans TM2 ;
- Xgl_trans TM3 ;
- Xgl_trans PERSP_MAT ;
- Xgl_trans ID_MAT ;
-
- typedef Xgl_pt_f2d Pt2d ;
- typedef Xgl_pt_f3d Pt3d ;
- typedef Xgl_matrix_f3d Mat3d ;
- typedef Xgl_matrix_f2d Mat2d ;
-
-
- #else
-
- #define WIN_MAT 0 /* final viewing matrix */
- #define TM1 1
- #define TM2 2
- #define TM3 3
- #define OBJ_MAT 4 /* (TRANLATION*ROTATION*PERSPECTIVE) */
- #define ROT_MAT 5 /* matrix that holds ship orientation */
-
- typedef Point2df Pt2d ;
- typedef Point3df Pt3d ;
- typedef Matrix3df Mat3d ;
- typedef Matrix2df Mat2d ;
-
- #endif XGL
-
- #include "object_types.h"
-
- #define WHITE 1
- #define LGREY 2
- #define GREY 3
- #define RED 4
- #define GREEN 5
- #define BLUE 6
- #define YELLOW 7
-
-
-
- #ifdef XGL
- #define Set_color(ctx, i) \
- do { \
- current_xgl_color.index = dbmap[i] ; \
- xgl_object_set(ctx, XGL_CTX_LINE_COLOR, ¤t_xgl_color, 0) ; \
- } while(0) ;
- #define Set_marker_color(ctx) \
- xgl_object_set(ctx, XGL_CTX_MARKER_COLOR, ¤t_xgl_color, 0) ;
- #else
- #define Set_color(gp,color) \
- { \
- if(hwdb) \
- { \
- Dev_gp1_set_color((gp),(color)) ; \
- } \
- else \
- { \
- Dev_gp1_dbuf_color((gp),(color)) ; \
- } \
- }
- #endif XGL
-
-
-
- #ifdef XV
- extern Xv_Window Main_pw, Control_pw;
- #else
- extern Pixwin *Main_pw, *Control_pw ;
- #endif XV
-
- #ifdef XGL
- extern Xgl_3d_ctx Main_gfx, Control_gfx ;
- extern Xgl_2d_ctx Text_gfx;
- extern Xgl_mem_ras Cursor_ras;
- #else
- extern GP1_handle Main_gfx, Control_gfx ;
- #endif XGL
-
- #ifdef XGL
- Xgl_matrix_f3d P_matrix ;
- #else
- Matrix3df P_matrix ;
- #endif XGL
-
- #ifdef XGL
- Xgl_color current_xgl_color ;
- #endif XGL
-
- int Mouse_x, Mouse_y ;
- int Left_But, Middle_But, Right_But ;
- int Side_1, Side_2, Side_3, Side_4, Side_5 ;
- int Side_6, Side_7, Side_8, Side_9, Side_10 ;
- float Mouse_ax, Mouse_ay ;
- int hwdb ;
- int mouse_control ;
-
- /* sort_list is a list of objects that starts out in
- strictly increasing order but then gets sorted. It
- is kept from frame to frame in order to optimize
- sorting time (taking advantage of coherence) */
- short sort_list[MAX_OBJECTS] ;
- short nobjects ;
- int dbmap[256] ;
-
- #endif GRAPHICS_H
-