home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / VOGLE.ZIP / VOGLE / DRIVERS / README < prev    next >
Text File  |  2000-02-11  |  4KB  |  114 lines

  1.  
  2. This directory contains the general device drivers and their makefiles
  3.  
  4. The directory ibmpc contains the files specific to ibm pc's, see the pc
  5. makefiles in the src directory for more details on these.
  6.  
  7. -------------------------------------------------------------------------
  8.  
  9. The Structure of a Device Driver.
  10.  
  11. Vogle device entries are structured as follows:
  12.  
  13.     three character pointers giving:
  14.             the name of the device,
  15.             the name for the small hardware font,
  16.             and the name for the large hardware font.
  17.     seventeen function pointers giving the functionality of the device.
  18.             If a device is not capable of some things (eg. colour 
  19.             changing) a no-op function should be provided which
  20.             has a return value of -1.
  21.  
  22.     A function must also be specified in the device driver which copies
  23.     the device entry into the global device entry vdevice.dev. This
  24.     function call should be included conditionally in the file drivers.c,
  25.     as should the device name in the code printing the list of available
  26.     devices - also found in drivers.c.
  27.  
  28. The twelve functions required for a complete device driver are:
  29.  
  30. DEV_char
  31.     a routine which prints a character of hardware text. This routine must
  32.     doing any neccessary moving to make sure the current drawing position
  33.     on the device is correct, and it must leave the device in graphics
  34.     mode.
  35.  
  36. DEV_clear
  37.     a routine which clears the "screen" to the current background colour.
  38.  
  39. DEV_color
  40.     a routine to change the current color on the device. The default
  41.     colors are in the man page in the docs directory.
  42.  
  43. DEV_draw
  44.     a routine which draws from the current device position to a point (x, y)
  45.     in vogle device coords - note these assume that (0, 0) is the bottom
  46.     left hand corner. This routine must doing any neccessary moving to make
  47.     sure the current drawing position on the device is correct.
  48.  
  49. DEV_exit
  50.     a routine which does the necessary cleaning up to allow vogle to exit
  51.     leaving the device in a usable form.
  52.  
  53. DEV_fill
  54.     a routine for doing filled polygons, devices which do not support this
  55.     should just do an outline.
  56.  
  57. DEV_font
  58.     a routine which sets up a hardware font. This should also set
  59.     vdevice.hwidth and vdevice.hheight, which are the width and height
  60.     of the current hardware font in pixels. VOGLE assumes that hardware
  61.     text is of a fixed width.
  62.  
  63. DEV_getkey
  64.     a routine which gets a single character of input from a device capable
  65.     of providing it.
  66.  
  67. DEV_init
  68.     a routine which enables graphics on the device, sets the default
  69.     colour map, and sets vdevice.maxS{x,y} and vdevice.minS{x,y} to the
  70.     window size in pixels.
  71.  
  72. DEV_locator
  73.     a routine finds the mouse position for the device in vogle device
  74.     coordinates (returned in the arguments) and returns a bit pattern
  75.     giving which buttons were down at the time of the call.
  76.  
  77. DEV_mapcolor
  78.     a routine for changing a colormap index to a given rgb value.
  79.  
  80. DEV_string
  81.     a routine for printing a string of hardware text. This routine must
  82.     doing any neccessary moving to make sure the current drawing position
  83.     on the device is correct, and it must leave the device in graphics
  84.     mode.
  85.  
  86. DEV_backbuf
  87.     a routine to initialise double buffering by selecting the back
  88.     drawing buffer and performing any other initialisations. If there
  89.     are any hassles with all this then it should return -1.
  90.  
  91.     Lot's of this double buffering isn't really double buffering at
  92.     all. It's kind of a pseudo double buffering in that drawing is
  93.     done off screen and copied to the screen when needed.
  94.  
  95. DEV_frontbuf
  96.     a routine to switch drawing into the front drawing buffer
  97.  
  98. DEV_swapbuf
  99.     a routine to make the back buffer visible and notionally switch
  100.     the roles of the front and back drawing buffers.
  101.  
  102. DEV_sync
  103.     a routine to syncronize the display with what we think has been
  104.     output. This function can be noop. It is used with drivers such
  105.     as X11 which don't necesarily display things as soon as a call
  106.     has been made to a drawing routine. Because of buffering withing 
  107.     the system, a considerable speed up may be obtained by only syncing
  108.     the display when necesary. Cases in point are:
  109.         When drawing objects
  110.         When drawing arcs
  111.         When drawing Splines and patches
  112.     where the whole lot can be "sent down the line" with a single "sync"
  113.     at the end.
  114.