home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / v / vgalib12.tar / vgalib / README < prev    next >
Text File  |  1993-02-09  |  5KB  |  98 lines

  1. Hi!
  2.  
  3. This is version 1.2 of the VGA graphics library for linux. As the
  4. previous version it has the following features:
  5.     - Support for all standard VGA 16 and 256 color modes
  6.     - Support for non-standard 256 color modes (including mode X)
  7.     - Tseng ET4000 SVGA 256 color modes
  8.     - Monochrome 640x480 mode 
  9.     - Text mode restoration
  10.     - Handling of console I/O
  11.     - Flipping between graphics mode and text mode
  12.     - Restores text mode after CTRL-C interrupt
  13. The present version adds the following:
  14.     - The ET4000 modes should now be more robust
  15.     - Tools for creating your own video modes
  16.  
  17. VGAlib requires the 0.96b kernel (or newer) and must be compiled
  18. with GCC 2.2.2 (or newer). To compile and install VGAlib just 
  19. type make. This will also build the following programs:
  20.     vgatest: a simple demonstration of the library and the various
  21.          video modes
  22.     dumpreg: dumps the current VGA registers to stdout, mainly used
  23.          for debugging and creating new video modes
  24.     runx   : if you have problems with text mode restoration after 
  25.          running X386, then try to use runx instead of startx
  26. Remember that all programs using VGAlib must be run with setuid 
  27. root (login as root and do a 'chmod +s prog-name'), otherwise you 
  28. will get a "can't get I/O permissions" error.
  29.  
  30. VGAlib does it's best to restore the text mode, but it may fail
  31. with some SVGA cards if you use a text mode with more than 80
  32. columns. If you are having problems please try to use an 80
  33. column text mode.
  34.  
  35. Below is a short description of the functions in the library.
  36. Look at vgatest.c for examples on how to use these functions:
  37.     - vga_setmode() is used to select the graphics mode or to 
  38.       restore the text mode.
  39.     - vga_hasmode() tests if a given video mode is supported
  40.       by the graphics card (use this function before using
  41.       any of the ET4000 SVGA modes)
  42.     - vga_clear() clears the graphics screen. This is also done
  43.       by vga_setmode().
  44.     - vga_getxdim(), vga_getydim() and vga_getcolors() return
  45.       the resolution and number of colors for the current mode.
  46.     - vga_getpalette() and vga_getpalvec() returns the contents
  47.       of one or more palette registers, respectively.
  48.     - vga_setpalette() and vga_setpalvec() allows you to modify
  49.       one or more palette registers, respectively.
  50.     - vga_setcolor() determines the color for future calls of 
  51.       the drawing functions.
  52.     - vga_drawpixel() and vga_drawline() draws a pixel or a line
  53.       in the current color, respectively.
  54.     - vga_drawscanline() draws one single horisontal line of 
  55.       pixels and has been optimized for the fastest possible
  56.       output.
  57.     - vga_screenoff() and vga_screenon() turns the screen refresh 
  58.       off and on. On some VGA's the graphics operations will be 
  59.       faster, if the screen is turned off during graphics output.
  60.     - vga_flip() switches between graphics and text mode without 
  61.       destroying the screen contents. This makes it possible for
  62.       your application to use both text and graphics output.
  63.     - vga_gecth() waits for a character to be typed an returns 
  64.       the ASCII value. If you press ESC (the exact key can be 
  65.       changed with vga_setflipchar()), the text mode will be 
  66.       temporarily restored until you press another key. This allows 
  67.       you to switch to another virtual console and later return to 
  68.       your graphics application.
  69.     - vga_setflipchar() changes the character that vga_getch() 
  70.       uses for flipping between graphics and text mode.  
  71.     - vga_dumpregs() dumps the current VGA register contents to
  72.       stdout 
  73. My main motivation for implementing the graphics/text flipping was
  74. to make debugging easier. If your program reaches a breakpoint while
  75. in graphics mode, you can switch to text mode with the gdb command
  76.  
  77.     print vga_flip()
  78.  
  79. and later restore the graphics screen contents with the same command.
  80. It is usefull to define the following alias in gdb:
  81.  
  82.     define flip <RETURN> print vga_flip() <RETURN> end <RETURN>
  83.  
  84. The directory 'support' contains the sources and executables for two
  85. Borland C++ programs that allows you to dump the register contents
  86. for any BIOS video mode. 'vga.exe' should work with any VGA/SVGA
  87. adapter, while 'tseng.exe' only is for use with an ET4000 adapater.
  88. Both programs take a hexadecimal mode number as argument and writes
  89. the register contents to the console. Also provided is a description 
  90. of the VGA and ET4000 registers taken from the 'vgadoc01.zip' package 
  91. at SIMTEL20.
  92.  
  93. There has been a lot of interest in the previous versions of VGAlib,
  94. and I would like to thank everybody who has suggested improvements.
  95.  
  96.     Tommy Frandsen (frandsen@diku.dk)
  97.  
  98.