home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / SVGALIB / _SVGALIB.TAR / usr / doc / svgalib / README.vgalib < prev    next >
Encoding:
Text File  |  1995-01-18  |  4.7 KB  |  104 lines

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