

                                 VGL 2.0

                           VGA Graphics Library
                              (VGA mode 13h)

                          Created by Mark Morley
                           morley@camosun.bc.ca

                                 May 1993



What is VGL?
============

   VGL is a graphics library for VGA mode 13h.  Perhaps a `collection of
   graphics routines' is a better description than `library'.  The core of the
   package is an assembly language module.  This module exists in both a
   286 and 386 version and contains the basic "core" routines.  All the other
   routines are written in C and are contained in seperate modules.  Full
   source is included.

   The library includes routines for drawing on virtual screens (or virtual
   page flipping if you like), drawing sprites, doing fast blits, manipulating
   the palette (including fading and cycling), drawing bitmapped fonts, loading
   GIF images, drawing lines, trapping key presses, handling the mouse, etc.


What does it cost?
==================

   Nothing.  VGL is free.


What's the catch?
=================

   The one thing I ask is that you don't try and sell VGL itself or make it
   a part of another programming library.  VGL is FREE and anyone who wants
   it should be allowed to have it WITHOUT CHARGE.

   If you write a program and use my routines, you can sell YOUR PROGRAM
   without having to give away the source.  You don't even have to give me
   any credit for my work, although it would be a nice gesture.

   If you do write something with my stuff, I'd love to see it.  Whether it's
   a demo or a full blown game, I'd just like to see that someone is actually
   using this stuff.

   Finally, if you find this library useful or informative, I'd love to get
   a note from you saying so.  This is all the encouragement I need to keep
   developing it.

   Oh yeah, my wife says she wants a post card from your home town, so if
   you're so inclined you can send one to:

        M. Morley
        3889 Mildred Street
        Victoria, B.C.
        V8Z 7G1   Canada


What's new in 2.0?
==================

   * vglHLine
     Draw a horizontal line.  To be used later in polygon fills (version 3.0?)

   * vglUpdateW, vglUpdateLW, vglCopyW
     Work just like the routines without a 'W' on the end, except these
     ones will wait for vertical retrace before copying to the screen.

   * vglBlack
     Sets the palette to all black.

   * vglFadeIn, vglFadeOut, vglFadePartIn, vglFadePartOut
     Routines to smoothly fade in all or part of a palette.

   * vglCyclePartL, vglCyclePartR
     Routines to rotate a part of the palette to the left or right.

   * vglSetPartPal
     Set a partial palette.

   * vglSetPal (modified)
     Now waits for vertical retrace (avoids *some* flicker).

   * vglTrapKeys, vglReleaseKeys
     Allows you to test for multiple keys being held down.

   * vglLoadFont, vglPutc, vglPuts, vglBoldOn, vglBoldOff, vglItalicsOn,
      vglItalicsOff, vglUnderlineOff, vglUnderlineOff, vglShadowOn,
      vglShadowOff, vglTextColor, vglUnderlineColor, vglShadowColor
     Routines to display bitmapped fonts.  22 fonts are included.  I'm
     really happy with this module, even though it isn't the cleanest code.
     It could be faster, though.

   * vglMousePresent, vglInitMouse, vglShowMouse, vglHideMouse,
      vglHideMouseIf, vglGetMouseInfo
     Simplistic mouse routines.  Just enough to get you started.  I'll add
     support for the rest of the mouse functions when I have more time.

   * vglPlayFLI
     C routine to play a .FLI file.  Sorry, I haven't added support for
     .FLC files.  This is fairly slow, but possibly still useable for title
     screens, etc.


Where do I get it?
==================

   VGL's official home is on suncad.camosun.bc.ca in the /pub/morley
   directory.  Look for a file called vgl20.zip.  The demos in the archive
   assume that font files will be in a subdirectory called FONTS, so be sure
   and unzip it with the -d option!

   NOTE: VGL20.ZIP is zipped with PKZIP 2.04G

   If you have demos or games to send me, you can upload them to the
   same computer into the /incoming directory.  Send me an note letting me
   know you've uploaded something, I don't remember to check it that often.

   Please help make VGL available to more people by uploading it to BBS's
   and other FTP sites.  Thanks.


How do I use it?
================

   For details on how each routine works, you'll have to read the source
   files.  The VGL library exists in the following modules:

      VGL.H          The header file for all VGL routines.
      VGL286.ASM     The 286 ASM routines for blitting, sprites, etc.
      VGL386.ASM     The 386 ASM routines for blitting, sprites, etc.
      VGLPAL.C       C routines for fading and cycling palette entries.
      VGLGIF.C       C routine to load a GIF image from disk.
      VGLLINE.C      C routine to draw a line using Bresenham's.
      VGLFONTS.C     C routines to load and use bitmapped fonts.
      VGLKEY.C       C routines to trap key presses and releases.
      VGLMOUSE.C     C routines to use the mouse.
      VGLFLI.C       C routine to play a .FLI file.

   To make use of the routines in a particular module, simply add the module
   to your makefile or project and link it in.  Note that you don't *have*
   to include all the modules.  If you don't need fonts, then don't link in
   VGLFONTS.C  If you don't need to trap keystrokes, then don't link in
   VGLKEY.C  You get the idea.

   NOTE: Some modules require others.  Example: VGLFONTS.C uses routines in
         VGLx86.ASM and VGLLINE.C

   There are also a few demo programs (with source) to show you how to use
   the library.

   I apologise for the lack of decent documentation.  I'm more than happy to
   try and answer any questions you may have, though.


Special thanks to:
==================

   * Mike Asbury, who pointed out a way to speed up the inner loop of several
     of my ASM routines.  The speedup isn't noticeable on my 486's, but it
     apparently makes a big difference on 386's.  Thanks Mike!

   * Many others who sent me ideas and suggestions.  I'm sorry I couldn't
     implement them all for this release.  Maybe next time.

