home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / avogl.tar.gz / avogl.tar / vogl / drivers / README < prev    next >
Text File  |  1992-09-22  |  4KB  |  107 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. The driver structure is basically the same as that of VOGLE's with one
  8. exception, the clear routine (if it is going to behave like the one in 
  9. Iris GL) should only clear the current viewport, not the whole screen.
  10.  
  11. -------------------------------------------------------------------------
  12.  
  13. The Structure of a Device Driver.
  14.  
  15. VOGL device entries are structured as follows:
  16.  
  17.     three character pointers giving:
  18.             the name of the device,
  19.             the name for the small hardware font,
  20.             and the name for the large hardware font.
  21.     sixteen function pointers giving the functionality of the device.
  22.             If a device is not capable of some things (eg. colour 
  23.             changing) a no-op function should be provided which
  24.             has a return value of -1.
  25.  
  26.     A function must also be specified in the device driver which copies
  27.     the device entry into the global device entry vdevice.dev. This
  28.     function call should be included conditionally in the file drivers.c,
  29.     as should the device name in the code printing the list of available
  30.     devices - also found in drivers.c.
  31.  
  32. The twelve functions required for a complete device driver are:
  33.  
  34. DEV_char
  35.     a routine which prints a character of hardware text. This routine must
  36.     doing any neccessary moving to make sure the current drawing position
  37.     on the device is correct, and it must leave the device in graphics
  38.     mode.
  39.  
  40. DEV_clear
  41.     a routine which clears the current viewport to the current background
  42.     colour. Note: On hardcopy devices, as with VOGLE, clearing should still
  43.     eject the current page.
  44.  
  45. DEV_color
  46.     a routine to change the current color on the device. The default
  47.     colors are in the man page in the docs directory.
  48.  
  49. DEV_draw
  50.     a routine which draws from the current device position to a point (x, y)
  51.     in vogle device coords - note these assume that (0, 0) is the bottom
  52.     left hand corner. This routine must doing any neccessary moving to make
  53.     sure the current drawing position on the device is correct.
  54.  
  55. DEV_exit
  56.     a routine which does the necessary cleaning up to allow vogle to exit
  57.     leaving the device in a usable form.
  58.  
  59. DEV_fill
  60.     a routine for doing filled polygons, devices which do not support this
  61.     should just do an outline.
  62.  
  63. DEV_font
  64.     a routine which sets up a hardware font. This should also set
  65.     vdevice.hwidth and vdevice.hheight, which are the width and height
  66.     of the current hardware font in pixels. VOGLE assumes that hardware
  67.     text is of a fixed width.
  68.  
  69. DEV_getkey
  70.     a routine which gets a single character of input from a device capable
  71.     of providing it.
  72.  
  73. DEV_init
  74.     a routine which enables graphics on the device, sets the default
  75.     colour map, and sets vdevice.maxS{x,y} and vdevice.minS{x,y} to the
  76.     window size in pixels.
  77.  
  78. DEV_locator
  79.     a routine finds the mouse position for the device in vogle device
  80.     coordinates (returned in the arguments) and returns a bit pattern
  81.     giving which buttons were down at the time of the call.
  82.  
  83. DEV_mapcolor
  84.     a routine for changing a colormap index to a given rgb value.
  85.  
  86. DEV_string
  87.     a routine for printing a string of hardware text. This routine must
  88.     doing any neccessary moving to make sure the current drawing position
  89.     on the device is correct, and it must leave the device in graphics
  90.     mode.
  91.  
  92. DEV_backbuf
  93.     a routine to initialise double buffering by selecting the back
  94.     drawing buffer and performing any other initialisations. If there
  95.     are any hassles with all this then it should return -1.
  96.  
  97.     Lot's of this double buffering isn't really double buffering at
  98.     all. It's kind of a pseudo double buffering in that drawing is
  99.     done off screen and copied to the screen when needed.
  100.  
  101. DEV_frontbuf
  102.     a routine to switch drawing into the front drawing buffer
  103.  
  104. DEV_swapbuf
  105.     a routine to make the back buffer visible and notionally switch
  106.     the roles of the front and back drawing buffers.
  107.