home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PRINTING / SHOWGL10.ZIP / GRAPHIX.H < prev    next >
C/C++ Source or Header  |  1991-05-28  |  4KB  |  81 lines

  1. /* constants and structures for graphix.c graphics function library */
  2. /* this header file should be used in the main program or in the file where
  3. the function g_init () is called.  All others should use graph.h .  Use
  4. hpgraph.h only to compile graphix.c */
  5. /* copyright 1991, Robert C. Becker, Lantern Systems */
  6.  
  7. enum DFNON__OFF { DFN_OFF, DFN_ON };    /* definition for display fn's ON/OFF */
  8.  
  9. #include "graph.h"    /* function prototypes */
  10.  
  11. #ifndef VID_PARAM_DEFT
  12.  
  13. #define        IBMBIOS        0    /* use internal BIOS for I/O */
  14. #define        IBMPACKED    1    /* CGA, MCGA, VGA 256 color mode, ATT6300, Herc HGC & HCG+ pixel organization */
  15. #define        IBMPLANES    2    /* EGA & VGA pixel organization*/
  16. #define        VESABIOS    3    /* VESA devices using BIOS I/O */
  17.  
  18. struct _vid_x_parm_        /* graphix init parameters */
  19.     {
  20.     unsigned max_xdot;    /* horizontal screens pixels - 1 */
  21.     unsigned max_ydot;    /* vertical screen pixels - 1 */
  22.     int max_pen;        /* # colors for this mode - 1 */
  23.     unsigned char mode;    /* BIOS mode # for this mode */
  24.     unsigned video_bios;    /* 0 -> using bios writes, != 0 -> not using bios for pixel writes */
  25.     unsigned base_adr;    /* segment adr for video RAM */
  26.     unsigned block_size;        /* # bytes in one block of video RAM */
  27.     unsigned block_per_page;    /* # blocks needed to make one graphics screen */
  28.     unsigned bytes_per_pixel;    /* =1 unless more than 8 bits/pixel */
  29.     unsigned bits_per_pixel;    /* # bits used for a single pixel */
  30.     unsigned pixels_per_byte;    /* # pixels/byte  (=1 if > 8 bits/pixel) */
  31.  
  32.     };
  33. #define     VID_PARAM_DEFT    /* video param structure defined */
  34. #endif
  35.  
  36. #ifndef CHAR_STR_DEFT
  37.  
  38. struct char___deft
  39.     {
  40.     char *fontname;
  41.     int _far **char_v;
  42.     unsigned char _far **char_p;
  43.     double ascender;
  44.     double descender;
  45.     double width;
  46.     double base;
  47.     double center;
  48.     double top;
  49.     double x_inc;
  50.     double y_inc;
  51.     double scale;
  52.     };
  53.  
  54. #define        CHAR_STR_DEFT    /* char description struct defined */
  55. #endif
  56.  
  57. struct _vid_x_parm_ hpc_320_200_hp = { 319, 199, 3, 0x04, IBMPACKED, 0xb800, 0x2000, 2, 1, 2, 4 };
  58.     /* BIOS CGA 320x200 color */
  59. struct _vid_x_parm_ hpc_640_200_hp = { 639, 199, 1, 0x06, IBMPACKED, 0xb800, 0x2000, 2, 1, 1, 8 };
  60.     /* BIOS CGA 640x200 BW */
  61. struct _vid_x_parm_ hpa_640_400_hp = { 639, 399, 1, 0x48, IBMPACKED, 0xb800, 0x2000, 4, 1, 1, 8 };
  62.     /* AT&T 640x400 mode, tiny type */
  63. struct _vid_x_parm_ hph_720_348_hp = { 719, 347, 1, 0x00, IBMPACKED, 0xb000, 0x2000, 4, 1, 1, 8 };
  64.     /* Hercules 720x348 mode (HGC and HGC+) */
  65. struct _vid_x_parm_ hpe_320_200_hp = { 319, 199, 15, 0x0d, IBMPLANES, 0xa000, 0, 1, 1, 1, 8 };
  66.     /* IBM EGA med-res mode (320x200) */
  67. struct _vid_x_parm_ hpe_640_200_hp = { 639, 199, 15, 0x0e, IBMPLANES, 0xa000, 0, 1, 1, 1, 8 };
  68.     /* IBM EGA med-res mode (640x200) */
  69. struct _vid_x_parm_ hpem_640_350_hp = { 639, 349, 2, 0x0f, IBMPLANES, 0xa000, 0, 1, 1, 1, 8 };
  70.     /* IBM EGA high-res BW mode (640x350) */
  71. struct _vid_x_parm_ hpe_640_350_hp = { 639, 349, 15, 0x10, IBMPLANES, 0xa000, 0, 1, 1, 1, 8 };
  72.     /* IBM EGA high-res mode (640x350) */
  73. struct _vid_x_parm_ hpv_640_480_hp = { 639, 479, 15, 0x12, IBMPLANES, 0xa000, 0, 1, 1, 1, 8 };
  74.     /* IBM VGA high-res mode (640x480) */
  75. struct _vid_x_parm_ hpv_320_200_hp = { 319, 199, 255, 0x13, IBMPACKED, 0xa000,0, 1, 1, 1, 8 };
  76.     /* IBM VGA lo-res mode (320x200) */
  77. struct _vid_x_parm_ hpm_640_480_hp = { 639, 479, 2, 0x11, IBMPACKED, 0xa000, 0, 1, 1, 1, 8  };
  78.     /* IBM MCGA 640x480 BW (highest resolution) */
  79.  
  80. extern double X_mm = 220.0, Y_mm = 160.0;    /* screen size in mm */
  81.