home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / coregraf / g.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-01-06  |  2.4 KB  |  67 lines

  1. /*
  2.     Interface definition for the machine-dependent routines called by
  3.     the portable CORE graphics routines.  These variables and functions
  4.     must be provided for each machine or graphics mode to be supported,
  5.     for example in gz.c for the Z-100 or in gpc.c for the IBM PC.
  6. */
  7.  
  8.  
  9. /*        variables                                 */
  10.  
  11. extern char *machine;
  12.  
  13. extern int
  14.     max_color,        /* color numbers range from 0 to max_color    */
  15.     pixels_wide,    /* x values range from 0 (left) to pixels_wide-1 (right) */
  16.     pixels_high;    /* y values range from 0 (top) to pixels_high-1    (bottom) */
  17. extern double
  18.     best_width,
  19.     best_height; /*    screen height/width (proportional to actual display
  20.                     area dimensions in inches, but one of these *must*
  21.                     be 1, and the other must be in the range 0 to 1).
  22.                     For example, if the screen is twice as wide as it
  23.                     is high, best_height would be 0.5 and best_width
  24.                     would be 1.                                              */
  25.  
  26.  
  27. /*    text display parameters                */
  28.  
  29. extern int char_rows;        /*    number of text rows                            */
  30. extern int     char_columns;    /*    number of text columns                        */
  31. extern int     char_height;    /*    y displacement from one text row to next    */
  32. extern int     char_width;        /*    x displacement from one char column to next    */
  33. extern int     x_offset;        /*    fudge factors for                             */
  34. extern int     y_offset;        /*      equations below                            */
  35.  
  36. /* an 'A' on row r, column c  has lower left corner on raster (y value)
  37.             y =     r*char_height + y_offset 
  38.     at pixel
  39.             x =     c*char_width + x_offset            */
  40.  
  41. /*    keyboard codes             */
  42.  
  43. extern int left_arrow;
  44. extern int right_arrow;
  45. extern int up_arrow;
  46. extern int down_arrow;
  47. extern int escaped_arrows;    /*    nonzero if arrow key codes are preceded
  48.                                 by an escape code (as on IBM PC)            */
  49. extern int escape_char;        /*    the character (if any) preceding key codes    */
  50.  
  51.  
  52. /*    pointers to line drawing and erasing functions    */
  53.  
  54. extern int    (*draw_line)();    /* (*draw_line)(x1,y1,x2,y2) int x1,y1,x2,y2; 
  55.                                         draws line from (x1,y1) to (x2,y2) */
  56. extern int    (*erase_line)();    /* (*erase_line)(x1,y1,x2,y2) int x1,y1,x2,y2; 
  57.                                         erases line from (x1,y1) to (x2,y2) */
  58.  
  59.  
  60. /*    functions                    */
  61.  
  62. extern int    clear_graphics();            /* clears screen                */
  63. extern int    init_graphics();            /* initializes graphics mode    */
  64. extern int    finish_graphics();            /* terminates graphics mode        */
  65. extern int    inquire_color();            /* returns current color number    */
  66. extern double inquire_intensity();        /* returns current intensity    */
  67.