home *** CD-ROM | disk | FTP | other *** search
/ Der Mediaplex Sampler - Die 6 von Plex / 6_v_plex.zip / 6_v_plex / DISK2 / MULTI_04 / SHOWGL15.ZIP / GRAPH.H < prev    next >
C/C++ Source or Header  |  1991-12-09  |  7KB  |  185 lines

  1. /* header file for graphix.c applications.  Function prototypes & #defines */
  2. /* copyright 1988, 1989, 1990, 1991 Robert C. Becker, Lantern Systems */
  3.  
  4. #define        VIDEO        0x10    /* BIOS video int. */
  5. #define        WRT_PIX        0x0c    /* BIOS write pixel request */
  6. #define        SET_MODE    0    /* BIOS set video mode: al = video mode */
  7. #define        VIDEO_STATE    0x0f    /* BIOS get video state */
  8.  
  9. #define        CRT        1    /* text CRT on HP systems, here just CRT */
  10. #define        KBD        2    /* same as on HP systems */
  11. #define        MOUSE        3    /* no previous definition */
  12.  
  13. #define        CGA_320x200    &hpc_320_200_hp        /* BIOS CGA 320x200, 4 color */
  14. #define        CGA_640x200    &hpc_640_200_hp        /* BIOS CGA 640x200 BW */
  15. #define        ATT_640x400    &hpa_640_400_hp        /* AT&T 640x400 BW, tiny type */
  16. #define        ATTDEB_640x400    &hpa_640_400_hp        /* AT&T 640x400 BW, tiny type, 16 colors */
  17. #define        HGC_720x348    &hph_720_348_hp        /* Hercules HGC and HGC+ 720x348 BW */
  18. #define        EGA_320x200    &hpe_320_200_hp        /* IBM EGA low-res 320x200, 16 color */
  19. #define        EGA_640x200    &hpe_640_200_hp        /* IBM EGA med-res 640x200, 16 color */
  20. #define        MEGA_640x350    &hpem_640_350_hp    /* IBM EGA high-res 640x350, BW */
  21. #define        EGA_640x350    &hpe_640_350_hp        /* IBM EGA high-res 640x350, 16 color */
  22. #define        VGA_640x480    &hpv_640_480_hp        /* IBM VGA high-res 640x480, 16 color */
  23. #define        VGA_320x200    &hpv_320_200_hp        /* IBM VGA lo-res 320x200, 256 color */
  24. #define        MCGA_640x480    &hpm_640_480_hp        /* IBM MCGA high-res 640x480, BW */
  25.  
  26. #ifndef VID_PARAM_DEFT
  27.  
  28. #define        IBMPACKED    1    /* video bios # for CGA, MCGA, and VGA 256 color mode, ATT6300, Herc HGC & HCG+ */
  29. #define        IBMPLANES    2    /* video bios # for EGA & VGA */
  30. #define        VESABIOS    3    /* video bios # for VESA devices using BIOS I/O */
  31.  
  32. struct _vid_x_parm_        /* graphix init parameters */
  33.     {
  34.     unsigned max_xdot;    /* horizontal screens pixels - 1 */
  35.     unsigned max_ydot;    /* vertical screen pixels - 1 */
  36.     int max_pen;        /* # colors for this mode - 1 */
  37.     unsigned char mode;    /* BIOS mode # for this mode */
  38.     unsigned video_bios;    /* 0 -> using bios writes, != 0 -> not using bios for pixel writes */
  39.     unsigned base_adr;    /* segment adr for video RAM */
  40.     unsigned block_size;        /* # bytes in one block of video RAM */
  41.     unsigned block_per_page;    /* # blocks needed to make one graphics screen */
  42.     unsigned bytes_per_pixel;    /* =1 unless more than 8 bits/pixel */
  43.     unsigned bits_per_pixel;    /* # bits used for a single pixel */
  44.     unsigned pixels_per_byte;    /* # pixels/byte  (=1 if > 8 bits/pixel) */
  45.  
  46.     };
  47.  
  48. #define     VID_PARAM_DEFT    /* video param structure defined */
  49. #endif
  50.  
  51. #ifndef VID_RTN_DEFT
  52.  
  53. struct video_display        /* returned structure for video_test () */
  54.     {
  55.     unsigned disp_a;
  56.     struct _vid_x_parm_ *vid_mode_a;
  57.     char *display_a;
  58.     unsigned disp_b;
  59.     struct _vid_x_parm_ *vid_mode_b;
  60.     char *display_b;
  61.     };
  62. #define     VID_RTN_DEFT    /* video_test return structure defined */
  63. #endif
  64.  
  65. #ifndef Graphix_hdr_deft
  66.  
  67. extern struct _vid_x_parm_ hpc_320_200_hp;        /* BIOS CGA 320x200, 4 color */
  68. extern struct _vid_x_parm_ hpc_640_200_hp;        /* BIOS CGA 640x200 BW */
  69. extern struct _vid_x_parm_ hpa_640_400_hp;        /* AT&T 640x400 BW, tiny type */
  70. extern struct _vid_x_parm_ hpad_640_400_hp;        /* AT&T 640x400 BW, tiny type, 16 colors */
  71. extern struct _vid_x_parm_ hph_720_348_hp;        /* Hercules HGC and HGC+ 720x348 BW */
  72. extern struct _vid_x_parm_ hpe_320_200_hp;        /* IBM EGA low-res 320x200, 16 color */
  73. extern struct _vid_x_parm_ hpe_640_200_hp;        /* IBM EGA med-res 640x200, 16 color */
  74. extern struct _vid_x_parm_ hpem_640_350_hp;        /* IBM EGA high-res 640x350, BW */
  75. extern struct _vid_x_parm_ hpe_640_350_hp;        /* IBM EGA high-res 640x350, 16 color */
  76. extern struct _vid_x_parm_ hpv_640_480_hp;        /* IBM VGA high-res 640x480, 16 color */
  77. extern struct _vid_x_parm_ hpv_320_200_hp;        /* IBM VGA lo-res 320x200, 256 color */
  78. extern struct _vid_x_parm_ hpm_640_480_hp;        /* IBM MCGA high-res 640x480, BW */
  79.  
  80. #define        Graphix_hdr_deft
  81.  
  82. #endif
  83.  
  84. #ifndef GR_CFG_DEFT
  85.  
  86. struct gr_config    /* defining structure for get_config (), set_config () */
  87.     {
  88.     int units, coupled, pen, pendown, degree, clip_type;
  89.     int wht_color, pen_max, g_input, csize_units;
  90.     int disp_fn, current_font;
  91.     double hclip_xmin, hclip_xmax, hclip_ymin, hclip_ymax;
  92.     double sclip_xmin, sclip_xmax, sclip_ymin, sclip_ymax;
  93.     double clip_xmin, clip_xmax, clip_ymin, clip_ymax;
  94.     double vport_xmin, vport_xmax, vport_ymin, vport_ymax;
  95.     double uu_xfactor, uu_yfactor, uu_xoffset, uu_yoffset;
  96.     double rpos_x, rpos_y, xpos, ypos, ldir_angle, cdir_angle;
  97.     double pivot_cos, pivot_sin, pivot_x, pivot_y, p_cos, p_sin;
  98.     double tilt, gdu, l_rpt, l_org, l_type, c_size;
  99.     double x_factor, y_factor, x_offset, y_offset, xmax, ymax;
  100.     double scr_xmin, scr_ymin;
  101.     };
  102.  
  103. #define    GR_CFG_DEFT
  104. #endif
  105.  
  106.  
  107. #ifndef CHAR_STR_DEFT
  108. struct char___deft
  109.     {
  110.     char *fontname;
  111.     int _far **char_v;
  112.     unsigned char _far **char_p;
  113.     unsigned char last_char;
  114.     double ascender;
  115.     double descender;
  116.     double width;
  117.     double base;
  118.     double center;
  119.     double top;
  120.     double x_inc;
  121.     double y_inc;
  122.     double scale;
  123.     };
  124.  
  125. #define        CHAR_STR_DEFT    /* char description struct defined */
  126. #endif
  127.  
  128. void arc ( double, int, double, double );
  129. void axes ( double, double, double, double, int, int, double );
  130. void cdir ( double );
  131. void char_xspace ( double, double );
  132. void clip ( double, double, double, double );
  133. void clip_off ( void );
  134. void clip_on ( void );
  135. void couple_pdir ( void );
  136. void csize ( double, double, double );
  137. void csize_gdu (void);
  138. void csize_mm (void);
  139. void csize_udu (void);
  140. void deg ( void );
  141. int  digitize ( double *, double * );
  142. void disp_fns ( enum DFNON__OFF );
  143. void draw ( double, double );
  144. void frame ( void );
  145. void gclear ( void );
  146. void get_config ( struct gr_config * );
  147. void g_init ( struct _vid_x_parm_ * );
  148. int  graphics_input ( int );
  149. void graphics_off ( void );
  150. void grid ( double, double, double, double, int, int, double );
  151. void idraw ( double, double );
  152. void imove ( double, double );
  153. void iplot ( double, double, int );
  154. void labelf ( char *, ... );
  155. void ldir ( double );
  156. void limit ( double, double, double, double );
  157. void line_type ( int, double );
  158. void lorg ( int );
  159. void move ( double, double );
  160. void mscale ( double, double );
  161. void pen ( int );
  162. void penup ( void );
  163. void pdir ( double );
  164. void pivot ( double );
  165. void plot ( double, double, int );
  166. void rad ( void );
  167. double ratio ( void );
  168. void rdraw ( double, double );
  169. void rectangle ( double, double, double, double );
  170. int  read_locator ( double *, double * );
  171. void rmove ( double, double );
  172. void rplot ( double, double, int );
  173. void show ( double, double, double, double );
  174. void set_config ( struct gr_config * );
  175. void setgu ( void );
  176. void setuu ( void );
  177. void track ( int );
  178. void uncouple_pdir ( void );
  179. void viewport ( double, double, double, double );
  180. int  where ( double *, double * );
  181. void window ( double, double, double, double );
  182.  
  183. struct char___deft _far *std_font ( void );    /* pointer to struct defining std char font */
  184.  
  185.