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