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