home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / TGE131.ZIP / TGE.DOC < prev    next >
Text File  |  1994-03-05  |  126KB  |  2,546 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                The Graphics Engine version 1.31 Documentation
  7.                                05 March 1994
  8.  
  9.                 The Graphics Engine software and manual are
  10.                Copyright (c) 1993-1994 by Matthew Hildebrand.
  11.                             All rights reserved.
  12.  
  13.  
  14.  
  15.  
  16. Topics covered in this document:
  17. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  18.  
  19.      INTRODUCTION
  20.      WHY USE TGE?
  21.      TERMS OF USAGE AND DISTRIBUTION
  22.      SYSTEM REQUIREMENTS
  23.      PACKING LIST
  24.      RELEASE NOTES FOR VERSION 1.31
  25.      A CRASH COURSE IN GRAPHICS PROGRAMMING
  26.      USING TGE IN A PROGRAM
  27.      TGE'S GRAPHICAL FUNCTION SET
  28.      VIEWPORTS AND CLIPPING
  29.      VIRTUAL COORDINATES
  30.      VIRTUAL SCREENS
  31.      GRAPHICAL OUTPUT MODES
  32.      USING FONTS
  33.      BITMAP MANIPULATION
  34.      PALETTE MANIPULATION
  35.      USING THE MOUSE
  36.      TGE'S MOUSE FUNCTION SET
  37.      ADDITIONAL FEATURES IN THE REGISTERED VERSION
  38.      CREATING FONTS
  39.      USING PCX2RAW AND GRAPHICS FILES
  40.      CONTACTING THE AUTHOR
  41.      OBTAINING THE NEWEST VERSION OF TGE
  42.      KNOWN PROBLEMS USING TGE
  43.      ACKNOWLEDGEMENT
  44.      LEGAL STUFF
  45.  
  46.  
  47.  
  48.  
  49. INTRODUCTION
  50. ▀▀▀▀▀▀▀▀▀▀▀▀
  51.  
  52.      The Graphics Engine is the result of my efforts to construct a library
  53.      of routines designed to make writing C/C++ graphics applications
  54.      easier.  I have used it in my own programs with excellent results.
  55.  
  56.      TGE allows the DOS programmer to easily access many graphics modes,
  57.      without having to do special coding for each; the complications
  58.      involved with supporting more than one graphics mode are removed.  TGE
  59.      also provides remarkable flexibility and expandability through its
  60.      modular design.
  61.  
  62.  
  63.  
  64. WHY USE TGE?
  65. ▀▀▀▀▀▀▀▀▀▀▀▀
  66.  
  67.      TGE provides a simple, standard interface with which programs may
  68.      access a powerful library of graphical functions.  TGE supports
  69.      device-independence through the use of loadable drivers; loadable
  70.      fonts; viewports; virtual screens of definable sizes; graphics output
  71.      using COPY, AND, NOT, OR, and XOR, even to virtual screens; bitmap
  72.      scaling; interrupt-driven, definable mouse pointer services; direct
  73.      manipulation of PCX, RAW, and PAL files; and a virtual coordinate
  74.      system to make device-independence easier.
  75.  
  76.      TGE's use of loadable graphics drivers means that all code and data
  77.      necessary to handle any given graphics mode is stored in a disk file.
  78.      When a program runs, this file will be loaded into memory and the code
  79.      and data it contains will be made available.  Consequently:
  80.           - Support for more graphics modes may be added simply by creating
  81.             more drivers; programs need not be recompiled.
  82.           - Since the code to manage the specifics of each mode is
  83.             contained in the drivers, the main program needs not concern
  84.             itself with what mode it is operating in.  The same code can
  85.             work in any graphics mode.
  86.           - Memory is saved for programs which support many graphics modes.
  87.             Instead of keeping the code and data necessary for each in
  88.             memory at all times, only the memory required for one driver is
  89.             used.
  90.  
  91.      The names of TGE's functions, such as "putImage" and "filledRect" may
  92.      easily be changed to suit individual preferences.
  93.  
  94.      TGE is powerful, fast, and cheap.  Upgrades are free.
  95.  
  96.  
  97.  
  98. TERMS OF USAGE AND DISTRIBUTION
  99. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  100.  
  101.      TGE is not free; it is distributed on a "try before you buy" basis.
  102.      Permission is granted to use TGE, for evaluation purposes only, for a
  103.      trial period of up to 30 days.  In order to use TGE after the trial
  104.      period, you MUST REGISTER; registration entitles you to free upgrades,
  105.      technical support, royalty-free distribution rights for all software
  106.      written using TGE, and a copy of the registered version of TGE, which
  107.      includes TGE's complete source code, an extra font, and features not
  108.      available in the shareware version.  Failure to register constitutes
  109.      theft and is punishable by law.
  110.  
  111.      By registering a copy of TGE, you signify that you have read and
  112.      understood the terms of usage and distribution explained in this
  113.      document, and that you agree to be bound by these terms; you also
  114.      signify that you agree to release the Author (Matthew Hildebrand) from
  115.      all liability associated with the use of TGE.
  116.  
  117.      In order to register a copy of TGE, send $30 US funds or $40 Canadian
  118.      funds to Matthew Hildebrand at the address listed in the CONTACTING
  119.      THE AUTHOR section of this document.  For each software package which
  120.      is both distributed by a corporation and built using TGE, send an
  121.      additional $100 US funds or $130 Canadian funds; this fee is a
  122.      pittance compared to the revenue generated by typical commercial
  123.      packages.  Payment by money order, cheque, or cash is acceptable;
  124.      currency must be US or Canadian funds.  Users outside the USA and
  125.      Canada, please ensure that cheques are drawn on a US or Canadian bank,
  126.      and that money orders are international if necessary.  Also, be sure
  127.      to send a filled out copy of ORDER.FRM with your payment. Thank you in
  128.      advance for registering TGE; your support is what makes its continued
  129.      growth possible.
  130.  
  131.      Upon receipt of your registration, I will mail you a copy of the
  132.      registered version of TGE, which includes complete source code, an
  133.      extra font, and features not available in the shareware version; this
  134.      registered copy of TGE may not be distributed in any way.  Once I have
  135.      mailed you a copy of the registered version, you will be considered a
  136.      registered user.  If you are interested in receiving notifications of
  137.      new versions as they are released, or copies of the new versions
  138.      themselves, refer to paragraph two of the OBTAINING THE NEWEST VERSION
  139.      OF TGE section.
  140.  
  141.      The privileges granted by purchasing TGE may be retracted if any of
  142.      the copyright notices in TGE's source files is modified or removed, if
  143.      any or all of the registered version of TGE is distributed in any way,
  144.      or if any or all of TGE's source code is distributed as part of a
  145.      software package.
  146.  
  147.      The shareware version of TGE may be distributed freely as long as the
  148.      distributed package is complete and its contents are not modified in
  149.      any way, and the distributed package is not sold for profit.
  150.  
  151.  
  152.  
  153. SYSTEM REQUIREMENTS
  154. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  155.  
  156.      TGE is a C/C++ programmer's library.  As such, it requires a C or C++
  157.      compiler of some sort to work with it.  TGE was written and tested
  158.      with Borland C++ 2.0 and Turbo C 2.0; it should work with other C/C++
  159.      compilers as well.
  160.  
  161.      The drivers that come with TGE are written using 80386 instructions;
  162.      they therefore cannot be used on a processor older than the 386 unless
  163.      they are modified first.
  164.  
  165.      The font and virtual coordinate systems are written in C++, not C.  In
  166.      order to use loadable fonts or VCOORD.H, a C++ compiler will be
  167.      required.
  168.  
  169.  
  170.  
  171. PACKING LIST
  172. ▀▀▀▀▀▀▀▀▀▀▀▀
  173.  
  174.      The current version of TGE consists of the following files:
  175.  
  176.      \TGE\               <DIR>
  177.          TGE.DOC                   TGE documentation.
  178.          QUICKREF.DOC              TGE function library quick reference.
  179.          REVISION.HST              Revision history.
  180.          ORDER.FRM                 Order form (shareware version only).
  181.          UNIVESA.DOC               Universal VESA TSR documentation.
  182.          UNIVESA.EXE               Universal VESA TSR executable.
  183.          README.NOW                Important information.
  184.          FILE_ID.DIZ               Archive description file used by some
  185.                                      bulletin board systems (shareware
  186.                                      version only).
  187.      \TGE\INCLUDE\       <DIR> TGE include files.
  188.          TGE.H                     TGE main header file.
  189.          TGEFONT.H                 TGE font system header file.
  190.          TGEMOUSE.H                Mouse header file.
  191.          VCOORD.H                  Virtual coordinate system (C++ only).
  192.        \TGE\LIB\         <DIR> Library directory.
  193.          BCL.MAK                   Makefile for Borland C++ large model
  194.                                      library.
  195.          BCH.MAK                   Makefile for Borland C++ huge model
  196.                                      library.
  197.          TGELIB.LST                Listfile used by library makefiles.
  198.          BCL.LIB                   Borland C++ large model library.
  199.          BCH.LIB                   Borland C++ huge model library.
  200.        \TGE\UTIL\        <DIR> PCX2RAW and MAKEFONT utilitites.
  201.          PCX2RAW.C                 Source for PCX2RAW.
  202.          PCX2RAW.EXE               Convert PCX files to RAW and PAL files.
  203.          MAKEFONT.C                Source for MAKEFONT.
  204.          MAKEFONT.EXE              Make a font from individual bitmaps.
  205.        \TGE\DRIVERS\     <DIR> Loadable drivers.
  206.          320X200.DRV               Driver for VGA 320x200x256.
  207.          320X240.DRV               Driver for VGA 320x240x256.
  208.          320X400.DRV               Driver for VGA 320x400x256.
  209.          360X480.DRV               Driver for VGA 360x480x256.
  210.          640X480.DRV               Driver for SuperVGA 640x480x256.
  211.          800X600.DRV               Driver for SuperVGA 800x600x256.
  212.          1024X768.DRV              Driver for SuperVGA 1024x768x256.
  213.        \TGE\FONTS\       <DIR> Loadable fonts.
  214.          BIGTEXT.FNT               Big letters (variable-sized).
  215.          8X8.FNT                   8x8 font (fixed-size).
  216.          8X14.FNT                  8x14 font (fixed-size).
  217.          8X16.FNT                  8x16 font (fixed-size).
  218.        \TGE\DEMO\        <DIR> Demo programs.
  219.          TGEDEMO.DOC               Documentation for demo program.
  220.          TGEDEMO.CPP               Source code for demo program.
  221.          MAKEFILE                  Makefile for the demo program.
  222.          TGEDEMO.EXE               TGE demo program executable.
  223.          TGELOGO.RAW               Data file used by the TGE demo program.
  224.          SIMPLE.CPP                A skeleton TGE program showing interface
  225.                                      basics.
  226.  
  227.      If you did not receive all of these files, you have an illegal copy of
  228.      The Graphics Engine.
  229.  
  230.  
  231.  
  232. RELEASE NOTES FOR VERSION 1.31
  233. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  234.  
  235.      If you are using Borland C++ 4.0, you may have trouble using
  236.      variable-sized fonts with this version of TGE; the source of the
  237.      problem appears to be linker version incompatibility.
  238.  
  239.      TGE version 1.32, in which I plan to add support for a wider variety
  240.      of compilers (including BC++ 4.0), and hopefully protected mode as
  241.      well, should be released within a few weeks of version 1.31.
  242.  
  243.      For a complete list of changes, refer to the REVISION.HST file.
  244.  
  245.      The drivers used with this release are not compatible with those from
  246.      version 1.20 or older, since many changes have been made to the driver
  247.      structure in order to allow for new features.
  248.  
  249.  
  250.  
  251. A CRASH COURSE IN GRAPHICS PROGRAMMING
  252. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  253.  
  254.      A graphics screen is composed of thousands or even hundreds of
  255.      thousands of coloured dots called "pixels".  Each pixel is referenced
  256.      according to its offset, in coordinate form, from the upper-left of
  257.      the screen:  (0,0), or the "origin".  The 'x' of a pixel's (x,y)
  258.      location signifies the column number, and the 'y' signifies the row
  259.      number; for example, a 640x480 screen would have (0,0) in the upper-
  260.      left and (639,479) in the lower-right.
  261.  
  262.      Each of these pixels has a colour which is recorded as a number,
  263.      ranging from 0..255 in 256-colour modes.  Each of these numbers is an
  264.      index into a table of colours which the video card maintains:  the
  265.      "palette".  The palette is what determines which colour is represented
  266.      by certain numbers; for instance, what colour is colour number 196?
  267.      Blue?  Green?  Purple?  It depends on the current setting of the
  268.      palette register for colour number 196.
  269.  
  270.      Each of these palette registers consists of three components:  the
  271.      red, green, and blue values, each of which is in the range 0..255.
  272.      All the displayable colours are composed of these three primary
  273.      colours in some proportion.  For instance, a purple would have lots of
  274.      red and blue, but little or no green.
  275.  
  276.      The palette can be a powerful tool, as changing palette register, say,
  277.      48, causes all pixels on-screen with the value of 48 to instantly
  278.      change to the new colour.  It is important to keep in mind that the
  279.      palette is a global palette; ie. it affects the entire screen.
  280.  
  281.      That's all there is to it!  <grin>
  282.  
  283.  
  284.  
  285. USING TGE IN A PROGRAM
  286. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  287.  
  288.      TGE now uses two environment variables:  TGEDRIVERS and TGEFONTS.
  289.      Though these environement variables are not necessary, it is
  290.      recommended that you add the following lines to your AUTOEXEC.BAT
  291.      file:
  292.           set TGEDRIVERS=drive:\tge\drivers\
  293.           set TGEFONTS=drive:\tge\fonts\
  294.      where 'drive:' is the drive on which you installed TGE.  The trailing
  295.      backslash is required.
  296.  
  297.  
  298.      Incorporating TGE into a program is an easy process involving three
  299.      simple steps.  First, you must be sure that TGE is recognized by the
  300.      program; to do so, #include the header file TGE.H into any source file
  301.      which accesses any of TGE's routines; you may also need to #include
  302.      other header files, such as TGEMOUSE.H if you use TGE's mouse code.
  303.      Also, ensure that the appropriate library file is linked in with the
  304.      program's OBJ files to make the EXE file; available library files are
  305.      BCL.LIB (Borland C++ large model) and BCH.LIB (Borland C++ huge
  306.      model).
  307.  
  308.      Second, a graphics driver MUST be loaded before any code or data
  309.      contained in the driver is accessed; results are undefined (though
  310.      almost certainly bad) if this step is not taken.  Code to load a
  311.      driver might look like this:
  312.  
  313.           if (loadGraphDriver(drvFileName) != TGE_SUCCESS)
  314.           {
  315.             printf("Error loading driver %s; aborting.\n\n", drvFileName);
  316.             exit(EXIT_FAILURE);
  317.           }
  318.           else
  319.             atexit(unloadGraphDriver);
  320.  
  321.      As its only parameter, loadGraphDriver() takes a string consisting of
  322.      the file name (which may include any valid DOS path) of the driver to
  323.      be loaded; note that if the specified filename cannot be found, TGE
  324.      will attempt to load it from the directory specified by the TGEDRIVERS
  325.      environment variable.  loadGraphDriver() returns TGE_SUCCESS if the
  326.      loading was successful, or one of TGE_OPEN_ERR (file not found),
  327.      TGE_FORMAT_ERR (file is not a valid TGE driver), TGE_ALLOC_ERR (out of
  328.      memory), and TGE_FILE_ERR (general file I/O error) if an error
  329.      occurred.  These macros are defined in TGE.H.
  330.  
  331.      Third, after TGE's graphical functions are no longer needed (usually
  332.      just before a program exit), the function unloadGraphDriver() should
  333.      be called.  It takes no parameters, and returns nothing.  It simply
  334.      frees the memory taken up by a driver after it has been loaded.  (With
  335.      some compilers it is not necessary to call this function, but it's
  336.      safer to call it just to be sure.)  It is generally a good idea to
  337.      place unloadGraphDriver() in the atexit() queue, as was done in the
  338.      above code fragment.
  339.  
  340.  
  341.      Note that the initGraphics() function must be called to enter graphics
  342.      mode; for more information, see the next section.  For more
  343.      information on how to use any particular feature, refer to the
  344.      appropriate section of this document.
  345.  
  346.  
  347.  
  348. TGE'S GRAPHICAL FUNCTION SET
  349. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  350.  
  351.      After a driver has been loaded, all of TGE's graphical functions can
  352.      be accessed.  To call a function, simply execute
  353.  
  354.           functionName(parameter_list);
  355.  
  356.      where "functionName" is the name of the desired function (eg.
  357.      "ellipse" or "filledRect") and "parameter_list" is all parameters to
  358.      that function, if any.
  359.  
  360.      A complete list of TGE's graphical functions follows.
  361.  
  362.  
  363.  *** Function:      initGraphics()
  364.      Syntax:        void initGraphics(void);
  365.      Purpose:       Initialize graphics mode.
  366.      Parameters:    None.
  367.      Return value:  1 on success or 0 on error.
  368.      Remarks:       None.
  369.      See also:      deInitGraphics()
  370.  
  371.  *** Function:      deInitGraphics()
  372.      Syntax:        void deInitGraphics(void);
  373.      Purpose:       Revert to 80x25 colour text mode.
  374.      Parameters:    None.
  375.      Return value:  None.
  376.      Remarks:       None.
  377.      See also:      initGraphics()
  378.  
  379.  *** Function:      putImage()
  380.      Syntax:        void huge putImage(int x, int y, void far *image);
  381.      Purpose:       Place a bitmap, or image, onto the screen.
  382.      Parameters:    The bitmap contained in 'image' will be placed onto the
  383.                     screen with its upper-left coordinate at ('x','y').
  384.      Return value:  None.
  385.      Remarks:            Clipping is performed; the image may be placed
  386.                     entirely on-screen, partially on-screen, or entirely
  387.                     off-screen.
  388.                          This function is declared as huge so that it will
  389.                     work properly when called from within an interrupt
  390.                     service routine.
  391.      See also:      putImageInv(), getImage(), imageSize(), imageSizeDim(),
  392.                     putLine(), putLineInv(), getLine()
  393.  
  394.  *** Function:      putImageInv()
  395.      Syntax:        void huge putImageInv(int x, int y, void far *image);
  396.      Purpose:       Place a bitmap, or image, on the screen.
  397.      Parameters:    The bitmap contained in 'image' will be placed onto the
  398.                     screen with its upper-left coordinate at ('x','y').
  399.      Return value:  None.
  400.      Remarks:            Clipping is performed; the image may be placed
  401.                     entirely on-screen, partially on-screen, or entirely
  402.                     off-screen.    putImageInv() differs from putImage()
  403.                     only in that it allows for transparent, or invisible,
  404.                     colours.  If any pixel in the image buffer has a value
  405.                     of zero, the corresponding pixel on-screen will not be
  406.                     modified.  Using putImageInv() can avoid having black
  407.                     borders around non-rectangular shapes.
  408.                          This function is declared as huge so that it will
  409.                     work properly when called from within an interrupt
  410.                     service routine.
  411.      See also:      putImage(), getImage(), imageSize(), imageSizeDim(),
  412.                     putLineInv(), putLine(), getLine()
  413.  
  414.  *** Function:      getImage()
  415.      Syntax:        void huge getImage(int ulx, int uly, int lrx, int lry,
  416.                     void far *image);
  417.      Purpose:       Copy the specified rectangular portion of the screen to
  418.                     memory.
  419.      Parameters:    The portion of the screen with its upper-left
  420.                     coordinate at ('ulx','uly') and its lower-left
  421.                     coordinate at ('lrx','lry') will be copied into the
  422.                     previously allocated memory region at 'image' (see
  423.                     imageSize()).
  424.      Return value:  None.
  425.      Remarks:            Clipping is performed.  Note that only the portion
  426.                     of the specified region which lies within the current
  427.                     viewport will be placed in the image buffer by
  428.                     getImage().  Be careful not to assume that a getImage()
  429.                     image has off-screen data in it.
  430.                          This function is declared as huge so that it will
  431.                     work properly when called from within an interrupt
  432.                     service routine.
  433.      See also:      putImage(), putImageInv(), imageSize(), imageSizeDim(),
  434.                     getLine(), putLine(), putLineInv()
  435.  
  436.  *** Function:      imageSize()
  437.      Syntax:        unsigned long imageSize(int ulx, int uly, int lrx, int
  438.                     lry);
  439.      Purpose:       Determine the amount of memory required to hold a
  440.                     rectangular portion of the screen.
  441.      Parameters:    imageSize() will calculate the amount of memory
  442.                     required to hold the porion of the screen whose upper-
  443.                     left coordinate is ('ulx','uly') and whose lower-left
  444.                     coordinate is ('lrx','lry').
  445.      Return value:  imageSize returns an unsigned long containing the size
  446.                     of the area in bytes.
  447.      Remarks:            Clipping is performed.
  448.                          imageSize() is designed for use with putImage(),
  449.                     putImageInv(), and getImage().  To use it with
  450.                     putLine() and getLine(), subtract 4 from the value it
  451.                     returns.  (Image buffers have four bytes of dimension
  452.                     information in them; line buffers do not.)
  453.      See also:      imageSizeDim(), putImage(), putImageInv(), getImage(),
  454.                     putLine(), getLine()
  455.  
  456.  *** Function:      imageSizeDim()
  457.      Syntax:        unsigned long imageSizeDim(unsigned wide, unsigned
  458.                     deep);
  459.      Purpose:       Determine the amount of memory required to hold a
  460.                     rectangular portion of the screen.
  461.      Parameters:    imageSize() will calculate the amount of memory
  462.                     required to hold the porion of the screen with width
  463.                     'wide' and depth 'deep'.
  464.      Return value:  imageSize returns an unsigned long containing the size
  465.                     of the area in bytes.
  466.      Remarks:            Clipping is not performed.
  467.                          imageSizeDim() is designed for use with
  468.                     putImage(), putImageInv(), and getImage().  To use it
  469.                     with putLine() and getLine(), subtract 4 from the value
  470.                     it returns.  (Image buffers have four bytes of
  471.                     dimension information in them; line buffers do not.)
  472.      See also:      imageSize(), putImage(), putImageInv(), getImage(),
  473.                     putLine(), getLine()
  474.  
  475.  *** Function:      putLine()
  476.      Syntax:        void putLine(int lineNum, int xOff, int lineLen, void
  477.                     far *buf);
  478.      Purpose:       Place one horizontal line of image data on the screen.
  479.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  480.                     pixels, will be placed on-screen starting at
  481.                     ('xOff','lineNum').
  482.      Return value:  None.
  483.      Remarks:       No clipping is performed.  Results are undefined if any
  484.                     coordinate on the line is off-screen.
  485.      See also:      putLineInv(), getLine(), putImage(), putImageInv(),
  486.                     getImage()
  487.  
  488.  *** Function:      putLineInv()
  489.      Syntax:        void putLineInv(int lineNum, int xOff, int lineLen,
  490.                     void far *buf);
  491.      Purpose:       Place one horizontal line of image data on the screen,
  492.                     leaving a pixel unchanged if the corresponding pixel in
  493.                     the source buffer has a value of zero.  This function
  494.                     is the single-line equivalent to putImageInv().
  495.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  496.                     pixels, will be placed on-screen starting at
  497.                     ('xOff','lineNum').
  498.      Return value:  None.
  499.      Remarks:       No clipping is performed.  Results are undefined if any
  500.                     coordinate on the line is off-screen.
  501.      See also:      putLine(), getLine(), putImage(), putImageInv(),
  502.                     getImage()
  503.  
  504.  *** Function:      getLine()
  505.      Syntax:        void getLine(int lineNum, int xOff, int lineLen, void
  506.                     far *buf);
  507.      Purpose:       Copy one horizontal line from the screen to memory.
  508.      Parameters:    The horizontal line whose left coordinate is
  509.                     ('xOff','lineNum') and whose length is 'lineLen' pixels
  510.                     will be copied into the previously allocated memory
  511.                     region at 'buf'.
  512.      Return value:  None.
  513.      Remarks:       No clipping is performed.  Results are undefined if any
  514.                     coordinate on the line is off-screen.
  515.      See also:      putLine(), putLineInv(), putImage(), putImageInv(),
  516.                     getImage()
  517.  
  518.  *** Function:      putPixel()
  519.      Syntax:        void putPixel(int x, int y, unsigned colour);
  520.      Purpose:       Place a single pixel on-screen.
  521.      Parameters:    The pixel located at ('x','y') will be set to the
  522.                     colour 'colour'.
  523.      Return value:  None.
  524.      Remarks:       Clipping is not performed; see clipPoint() and
  525.                     pointOnScreen() for details on clipping pixels.
  526.      See also:      getPixel()
  527.  
  528.  *** Function:      getPixel()
  529.      Syntax:        unsigned getPixel(int x, int y);
  530.      Purpose:       Return the value of a pixel.
  531.      Parameters:    The value of the pixel at ('x','y') is returned.
  532.      Return value:  The value of the pixel at ('x','y') is returned.
  533.      Remarks:       Clipping is not performed; see clipPoint() and
  534.                     pointOnScreen() for details on clipping pixels.
  535.      See also:      putPixel()
  536.  
  537.  *** Function:      line()
  538.      Syntax:        void line(int x1, int y1, int x2, int y2, unsigned
  539.                     colour);
  540.      Purpose:       Draw a line between two points.
  541.      Parameters:    The line will be drawn joining ('x1','y1') and
  542.                     ('x2','y2') in the colour 'colour'.
  543.      Return value:  None.
  544.      Remarks:       Clipping is not performed; see clipLine() for details
  545.                     on clipping lines.
  546.      See also:      horizLine(), vertLine()
  547.  
  548.  *** Function:      horizLine()
  549.      Syntax:        void horizLine(int y, int x1, int x2, unsigned colour);
  550.      Purpose:       Draw a horizontal line between two points.
  551.      Parameters:    The line will be drawn between ('x1','y') and
  552.                     ('x2','y') in the colour contained in colour.
  553.      Return value:  None.
  554.      Remarks:            Clipping is not performed.
  555.                          'x1' must be less than or equal to 'x2'.
  556.      See also:      vertLine(), line()
  557.  
  558.  *** Function:      vertLine()
  559.      Syntax:        void vertLine(int x, int y1, int y2, unsigned colour);
  560.      Purpose:       Draw a vertical line between two points.
  561.      Parameters:    The line will be drawn between ('x','y1') and
  562.                     ('x','y2') in the colour contained in colour.
  563.      Return value:  None.
  564.      Remarks:            Clipping is not performed.
  565.                          'y1' must be less than or equal to 'y2'.
  566.      See also:      horizLine(), line()
  567.  
  568.  *** Function:      drawRect()
  569.      Syntax:        void drawRect(int ulx, int uly, int lrx, int lry,
  570.                     unsigned colour);
  571.      Purpose:       Draw a rectangle.
  572.      Parameters:    The rectangle will be drawn with its upper-left
  573.                     coordinates at ('ulx','uly') and its lower-left
  574.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  575.      Return value:  None.
  576.      Remarks:       Clipping is performed.
  577.      See also:      filledRect()
  578.  
  579.  *** Function:      filledRect()
  580.      Syntax:        void filledRect(int ulx, int uly, int lrx, int lry,
  581.                     unsigned colour);
  582.      Purpose:       Draw a filled rectangle.
  583.      Parameters:    The rectangle will be drawn with its upper-left
  584.                     coordinates at ('ulx','uly') and its lower-left
  585.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  586.      Return value:  None.
  587.      Remarks:       Clipping is not performed; see clipFilledRect() for
  588.                     details on clipping filledRects.
  589.      See also:      drawRect()
  590.  
  591.  *** Function:      setPaletteReg()
  592.      Syntax:        void setPaletteReg(unsigned palReg, unsigned char red,
  593.                     unsigned char green, unsigned char blue);
  594.      Purpose:       Set a palette register.
  595.      Parameters:    The red, green, and blue components of the palette
  596.                     register palReg will be set to 'red', 'green', and
  597.                     'blue' respectively.
  598.      Return value:  None.
  599.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  600.                     should be in the range 0..255, not 0..63 as would be
  601.                     the case using a stock VGA.  The drivers will take care
  602.                     of converting 8-bit to 6-bit palette resolution if
  603.                     necessary.
  604.      See also:      getPaletteReg(), setBlockPalette(), getBlockPalette()
  605.  
  606.  *** Function:      getPaletteReg()
  607.      Syntax:        void getPaletteReg(unsigned palReg, unsigned char far
  608.                     *red, unsigned char far *green, unsigned char far
  609.                     *blue);
  610.      Purpose:       Return the current settings of a palette register.
  611.      Parameters:    The red, green, and blue contents of the palette
  612.                     register palReg will be stored in 'red', 'green', and
  613.                     'blue' respectively.
  614.      Return value:  The red, green, and blue components of the palette
  615.                     register are returned in 'red', 'green', and 'blue'.
  616.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  617.                     are in the range 0..255, not 0..63 as would be the case
  618.                     using a stock VGA card.  The drivers will take care of
  619.                     converting 8-bit to 6-bit palette resolution if
  620.                     necessary.
  621.      See also:      setPaletteReg(), setBlockPalette(), getBlockPalette()
  622.  
  623.  *** Function:      setBlockPalette()
  624.      Syntax:        void setBlockPalette(unsigned firstReg, unsigned
  625.                     lastReg, void far *data);
  626.      Purpose:       Set a block of palette registers.
  627.      Parameters:    The palette registers starting at 'firstReg' and ending
  628.                     at 'lastReg' will be set to the values contained in
  629.                     'data'.
  630.      Return value:  None.
  631.      Remarks:            The memory region at 'data' is organised in groups
  632.                     of three bytes; each group corresponds to one palette
  633.                     register, and each group is made up of, in order, the
  634.                     red, green, and blue components.  The first group is
  635.                     for the first register, the second for the second, and
  636.                     so on.
  637.                          Each of the colour components (red, green, blue)
  638.                     should be in the range 0..255, not 0..63 as would be
  639.                     the case using a stock VGA.  The drivers will take care
  640.                     of converting 8-bit to 6-bit palette resolution if
  641.                     necessary.
  642.                          Results are undefined if 'lastReg' is less than
  643.                     'firstReg'.
  644.      See also:      getBlockPalette(), setPaletteReg(), getPaletteReg()
  645.  
  646.  *** Function:      getBlockPalette()
  647.      Syntax:        void getBlockPalette(unsigned firstReg, unsigned
  648.                     lastReg, void far *data);
  649.      Purpose:       Get the values of a block of palette registers.
  650.      Parameters:    The values of the palette registers starting at
  651.                     'firstReg' and ending at 'lastReg' will be stored in
  652.                     the previously allocated 'data'.
  653.      Return value:  The values are returned in 'data'.
  654.      Remarks:            The memory region at 'data' is organised in groups
  655.                     of three bytes; each group corresponds to one palette
  656.                     register, and each group is made up of, in order, the
  657.                     red, green, and blue components.  The first group is
  658.                     for the first register, the second for the second, and
  659.                     so on.
  660.                          Each of the colour components (red, green, blue)
  661.                     is in the range 0..255, not 0..63 as would be the case
  662.                     using a stock VGA.  The drivers will take care of
  663.                     converting 8-bit to 6-bit palette resolution if
  664.                     necessary.
  665.                          Results are undefined if 'lastReg' is less than
  666.                     'firstReg'.
  667.      See also:      setBlockPalette(), setPaletteReg(), getPaletteReg()
  668.  
  669.  *** Function:      clearGraphics()
  670.      Syntax:        void clearGraphics(unsigned colour);
  671.      Purpose:       Clear the screen.
  672.      Parameters:    The screen will be cleared to the colour 'colour'.
  673.      Return value:  None.
  674.      Remarks:       This function clears the entire screen, not just the
  675.                     current viewport.
  676.      See also:      filledRect()
  677.  
  678.  *** Function:      ellipse()
  679.      Syntax:        void ellipse(int x, int y, int wide, int deep, unsigned
  680.                     colour);
  681.      Purpose:       Draw the outline of an ellipse.
  682.      Parameters:    An ellipse centered at ('x','y') and having width
  683.                     'wide' and depth 'deep' will be drawn in the colour
  684.                     'colour'.
  685.      Return value:  None.
  686.      Remarks:       Clipping is performed.
  687.      See also:      filledEllipse(), circle(), filledCircle()
  688.  
  689.  *** Function:      filledEllipse()
  690.      Syntax:        void filledEllipse(x, int y, int wide, int deep,
  691.                     unsigned colour);
  692.      Purpose:       Draw a filled ellipse.
  693.      Parameters:    An ellipse centered at ('x','y') and having width
  694.                     'wide' and depth 'deep' will be drawn in the colour
  695.                     'colour'.
  696.      Return value:  None.
  697.      Remarks:       Clipping is performed.
  698.      See also:      ellipse(), filledCircle(), circle()
  699.  
  700.  *** Function:      circle()
  701.      Syntax:        void circle(int x, int y, int radius, unsigned colour);
  702.      Purpose:       Draw the outline of a circle.
  703.      Parameters:    A circle centered at ('x','y') and having radius
  704.                     'radius' will be drawn in the colour 'colour'.
  705.      Return value:  None.
  706.      Remarks:            Clipping is performed.
  707.                          The 'radius' parameter is the radius in pixels
  708.                     measured horizontally.  Although there will be no
  709.                     difference in modes with square pixels, it will make a
  710.                     difference in other modes; to ensure accurate drawing
  711.                     of the circle with the given radius, make certain that
  712.                     the radius is measured horizontally.
  713.                          TGE uses an all-integer approach to coordinate
  714.                     scaling to ensure that the drawn shape will be circular
  715.                     in modes without square pixels.
  716.      See also:      filledCircle(), filledEllipse(), ellipse()
  717.  
  718.  *** Function:      filledCircle()
  719.      Syntax:        void filledCircle(int x, int y, int radius, unsigned
  720.                     colour);
  721.      Purpose:       Draw a filled circle.
  722.      Parameters:    A circle centered at ('x','y') and having radius
  723.                     'radius' will be drawn in the colour 'colour'.
  724.      Return value:  None.
  725.      Remarks:            Clipping is performed.
  726.                          The 'radius' parameter is the radius in pixels
  727.                     measured horizontally.  Although there will be no
  728.                     difference in modes with square pixels, it will make a
  729.                     difference in other modes; to ensure accurate drawing
  730.                     of the circle with the given radius, make certain that
  731.                     the radius is measured horizontally.
  732.                          TGE uses an all-integer approach to coordinate
  733.                     scaling to ensure that the drawn shape will be circular
  734.                     in modes without square pixels.
  735.      See also:      circle(), ellipse(), filledEllipse()
  736.  
  737.  *** Function:      fillRegion()
  738.      Syntax:        void fillRegion(int x, int y, unsigned colour);
  739.      Purpose:       Floods a region of the screen with the specified
  740.                     colour.
  741.      Parameters:    The fill will begin at the seed point ('x','y'), and
  742.                     will fill with the colour 'colour'.
  743.      Return value:  None.
  744.      Remarks:            The region to be filled is bounded by any colour
  745.                     not equal to the colour at ('x','y'); ie., the region
  746.                     to be filled consists of one colour only.
  747.                          Clipping is performed.
  748.      See also:      None.
  749.  
  750.  *** Function:      colourCloseTo()
  751.      Syntax:        unsigned colourCloseTo(unsigned char red, unsigned char
  752.                     green, unsigned char blue);
  753.      Purpose:       Given a 24-bit colour, find the colour from the current
  754.                     palette which most closely matches it.
  755.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  756.                     'blue' parameters.
  757.      Return value:  Returns the colour which most closely matches the
  758.                     specified 24-bit colour.
  759.      Remarks:       None.
  760.      See also:      colourCloseToX()
  761.  
  762.  *** Function:      colourCloseToX()
  763.      Syntax:        unsigned colourCloseToX(unsigned char red, unsigned
  764.                     char green, unsigned char blue, unsigned
  765.                     colourExclude);
  766.      Purpose:       Given a 24-bit colour, find the colour from the current
  767.                     palette which most closely matches it, with the
  768.                     specified colour disallowed from the search.
  769.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  770.                     'blue' parameters.  The colour 'colourExclude' is
  771.                     excluded from the search, and so will never be
  772.                     returned.
  773.      Return value:  Returns the colour which most closely matches the
  774.                     specified 24-bit colour.
  775.      Remarks:       Excluding zero from a search will ensure that the
  776.                     returned colour will be visible when it is used as part
  777.                     of a bitmap displayed using putImageInv().
  778.      See also:      colourCloseTo()
  779.  
  780.  
  781.      Note that since these function names are actually macros, they may
  782.      easily be changed to suit individual preferences by editing TGE.H.
  783.  
  784.  
  785.  
  786. VIEWPORTS AND CLIPPING
  787. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  788.  
  789.      A viewport is a rectangular region on the screen to which output is
  790.      clipped, so that graphics output will appear only within that region.
  791.      By default, this region is the entire screen; however, it can be set
  792.      to any rectangular portion of the screen.  (Note that when a viewport
  793.      is in use, coordinates are absolute, not relative to the viewport.)
  794.  
  795.      TGE now supports two viewports simultaneously:  an input viewport and
  796.      an output viewport.  This feature was added primarily so that virtual
  797.      screens (see the VIRTUAL SCREENS section) and the real screen could be
  798.      used simultaneously, though it may have other uses as well.  The
  799.      following functions are used to get and set the current input and
  800.      output viewports:
  801.  
  802.  *** Function:      setInputViewport()
  803.      Syntax:        void setInputViewport(int ulx, int uly, int lrx, int lry);
  804.      Purpose:       Set the defining coordinates of the current input
  805.                     viewport.
  806.      Parameters:    The upper-left corner of the input viewport will be set to
  807.                     ('ulx','uly'), and the lower-right corner to
  808.                     ('lrx','lry').
  809.      Return value:  None.
  810.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  811.      See also:      setOutputViewport(), setViewports(),
  812.                     getInputViewport(), getOutputViewport()
  813.  
  814.  *** Function:      setOutputViewport()
  815.      Syntax:        void setOutputViewport(int ulx, int uly, int lrx, int lry);
  816.      Purpose:       Set the defining coordinates of the current output
  817.                     viewport.
  818.      Parameters:    The upper-left corner of the output viewport will be set
  819.                     to ('ulx','uly'), and the lower-right corner to
  820.                     ('lrx','lry').
  821.      Return value:  None.
  822.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  823.      See also:      setInputViewport(), setViewports(),
  824.                     getOutputViewport(), getInputViewport()
  825.  
  826.  *** Function:      setViewports()
  827.      Syntax:        void setViewports(int ulx, int uly, int lrx, int lry);
  828.      Purpose:       Set the defining coordinates of the current input and
  829.                     output viewports.
  830.      Parameters:    The upper-left corner of the viewports will be set to
  831.                     ('ulx','uly'), and the lower-right corner to
  832.                     ('lrx','lry').
  833.      Return value:  None.
  834.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  835.      See also:      setInputViewport(), setOutputViewport(),
  836.                     getInputViewport(), getOutputViewport()
  837.  
  838.  *** Function:      getInputViewport()
  839.      Syntax:        void getInputViewport(int *ulx, int *uly, int *lrx, int
  840.                     *lry);
  841.      Purpose:       Get the defining coordinates of the current input
  842.                     viewport.
  843.      Parameters:    The upper-left corner of the input viewport will be stored
  844.                     in ('ulx','uly'), and the lower-right corner in
  845.                     ('lrx','lry').
  846.      Return value:  None.
  847.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  848.      See also:      getOutputViewport(), setInputViewport(),
  849.                     setOutputViewport()
  850.  
  851.  *** Function:      getOutputViewport()
  852.      Syntax:        void getOutputViewport(int *ulx, int *uly, int *lrx, int
  853.                     *lry);
  854.      Purpose:       Get the defining coordinates of the current output
  855.                     viewport.
  856.      Parameters:    The upper-left corner of the output viewport will be
  857.                     stored in ('ulx','uly'), and the lower-right corner in
  858.                     ('lrx','lry').
  859.      Return value:  None.
  860.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  861.      See also:      setOutputViewport(), getInputViewport(),
  862.                     getOutputViewport()
  863.  
  864.  
  865.      Note that not all of TGE's functions will clip to within the current
  866.      output viewport.  Some of the time-critical graphics primitives, such
  867.      as putPixel() and line(), do not clip in order to improve execution
  868.      time.  If it is necessary for such functions to have their output
  869.      clipped, the following routines may be used:
  870.  
  871.  *** Function:      clipRect()
  872.      Syntax:        int clipRect(int *x1, int *y1, int *x2, int *y2);
  873.      Purpose:       Clip the given rectangle to within the current output
  874.                     viewport.
  875.      Parameters:    The upper-left and lower-right corners of the rectangle
  876.                     are passed in ('x1','y1') and ('x2','y2').  If clipping
  877.                     is done, these points will be modified.
  878.      Return value:  Returns true if the rectangle lies entirely or
  879.                     partially within the current output viewport, or false
  880.                     if it is entirely outside the current output viewport.
  881.      Remarks:            It does not matter which of the corner coordinates
  882.                     is passed first; they will be swapped if necessary.
  883.                          This function is contained in CLIP.C.
  884.  
  885.  *** Function:      clipLine()
  886.      Syntax:        int clipLine(int *x1, int *y1, int *x2, int *y2);
  887.      Purpose:       Clip the given line to within the current output
  888.                     viewport.
  889.      Parameters:    The endpoints of the line are passed in ('x1','y1') and
  890.                     ('x2','y2').  If clipping is done, these endpoints will
  891.                     be modified.
  892.      Return value:  Returns true if the line lies entirely or partially
  893.                     within the current output viewport, or false if it is
  894.                     entirely outside the current output viewport.
  895.      Remarks:       This function is contained in CLIP.C.
  896.      See also:      None.
  897.  
  898.  *** Function:      clipInputPoint()
  899.      Syntax:        int clipInputPoint(int x, int y);
  900.      Purpose:       Return a flag indicating whether or not the specified
  901.                     coordinates lie within the current input viewport.
  902.      Parameters:    The point ('x','y') is tested.
  903.      Return value:  Returns true if ('x','y') is within the current
  904.                     input viewport, or 0 if it isn't.
  905.      Remarks:       This function is really a macro defined in TGE.H.
  906.      See also:      None.
  907.  
  908.  *** Function:      clipOutputPoint()
  909.      Syntax:        int clipOutputPoint(int x, int y);
  910.      Purpose:       Return a flag indicating whether or not the specified
  911.                     coordinates lie within the current output viewport.
  912.      Parameters:    The point ('x','y') is tested.
  913.      Return value:  Returns true if ('x','y') is within the current
  914.                     output viewport, or 0 if it isn't.
  915.      Remarks:       This function is really a macro defined in TGE.H.
  916.      See also:      None.
  917.  
  918.  *** Function:      pointOnScreen()
  919.      Syntax:        int pointOnScreen(int x, int y);
  920.      Purpose:       Return a flag indicating whether or not the specified
  921.                     coordinates lie on-screen.
  922.      Parameters:    The point ('x','y') is tested.
  923.      Return value:  Returns true if ('x','y') is on-screen, or 0 if it is
  924.                     off-screen.
  925.      Remarks:       This function is really a macro defined in TGE.H.
  926.      See also:      None.
  927.  
  928.  
  929.      Note that since these function names are actually macros, they may
  930.      easily be changed to suit individual preferences by editing TGE.H.
  931.  
  932.  
  933.  
  934. VIRTUAL COORDINATES
  935. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  936.  
  937.      One of the problems associated with device-independence is that
  938.      different display modes have different resolutions.  TGE provides a
  939.      simple way to ease this problem, simply by #including VCOORD.H.  Doing
  940.      so provides access to a simple yet powerful object-oriented virtual
  941.      coordinate system.
  942.  
  943.      For the sake of illustration, assume that you are writing an
  944.      application which ideally will be run in resolutions as high as
  945.      1024x768, but can also be run in 320x200.  You want a way to have
  946.      objects (eg., windows) retain the same sizes and positions on-screen
  947.      in any graphics mode.  TGE's virtual coordinate system makes it easy.
  948.      First, create an instance of the virtual coordinate object (I'll call
  949.      the object virtScreen):
  950.  
  951.           VirtualCoord virtScreen;
  952.  
  953.      Then, virtScreen must be configured; I'll assume that the virtual
  954.      screen is to be 1024x768, and that OUTMAXX and OUTMAXY have been
  955.      initialized by loading a driver.  (Note that these parameters may be
  956.      set during the class instantiation by using a different constructor.)
  957.  
  958.           virtScreen.virtParams(1023, 767);
  959.           virtScreen.realParams(OUTMAXX, OUTMAXY);
  960.  
  961.      As an example, assume that you want to draw a light gray rectangle
  962.      with upper-left coordinates (50,50) and lower-right coordinates
  963.      (600,600) on the virtual screen.  On, say, a 360x480 screen these
  964.      values will be quite different; to keep the proportions the same,
  965.      execute a line like the following:
  966.  
  967.           drawRect(virtScreen.realX(50), virtScreen.realY(50),
  968.                    virtScreen.realX(600), virtScreen.realY(600),
  969.                    colourCloseTo(200,200,200));
  970.  
  971.      That's all there is to it!  Keep in mind that there are other
  972.      applications of the VirtualCoord class, aside from a virtual screen;
  973.      it can also be useful when dealing with portions of the screen, scaled
  974.      bitmaps, etc..
  975.  
  976.      A complete list of the VirtualCoord member functions follows.
  977.  
  978.  
  979.  *** Function:      VirtualCoord::VirtualCoord()
  980.      Syntax:        VirtualCoord::VirtualCoord(void);
  981.      Purpose:       Create an instance of the VirtualCoord class.
  982.      Parameters:    None.
  983.      Return value:  None.
  984.      Remarks:       After an instantiation of a VirtualCoord using this
  985.                     constructor, ensure that the screen dimensions, both
  986.                     virtual and real, are initialized using the method
  987.                     illustrated above.
  988.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  989.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  990.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  991.  
  992.  *** Function:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  993.                     unsigned, unsigned)
  994.      Syntax:        VirtualCoord::VirtualCoord(unsigned virtMaxX, unsigned
  995.                     virtMaxY, unsigned realMaxX, unsigned realMaxY);
  996.      Purpose:       Create an instance of the VirtualCoord class, and
  997.                     initialize it.
  998.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  999.                     and the y-coordinate to 'virtMaxY'.  The maximum real
  1000.                     x-coordinate is set to 'realMaxX', and the y-coordinate
  1001.                     to 'realMaxY'.
  1002.      Return value:  None.
  1003.      Remarks:       Be sure that a driver has been loaded before passing
  1004.                     OUTMAXX and OUTMAXY to this constructor.
  1005.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1006.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  1007.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  1008.  
  1009.  *** Function:      VirtualCoord::virtParams(unsigned, unsigned)
  1010.      Syntax:        void VirtualCoord::virtParams(unsigned virtMaxX,
  1011.                     unsigned virtMaxY);
  1012.      Purpose:       Set the maximum virtual x- and y-coordinates.
  1013.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  1014.                     and the maximum y-coordinate to 'virtMaxY'.
  1015.      Return value:  None.
  1016.      Remarks:       None.
  1017.      See also:      VirtualCoord::realParams(unsigned, unsigned),
  1018.                     VirtualCoord::virtParams(unsigned*, unsigned*),
  1019.                     VirtualCoord::realParams(unsigned*, unsigned*)
  1020.  
  1021.  *** Function:      VirtualCoord::realParams(unsigned, unsigned)
  1022.      Syntax:        void VirtualCoord::realParams(unsigned virtMaxX,
  1023.                     unsigned virtMaxY);
  1024.      Purpose:       Set the maximum real x- and y-coordinates.
  1025.      Parameters:    The maximum real x-coordinate is set to 'realMaxX', and
  1026.                     the maximum y-coordinate to 'realMaxY'.
  1027.      Return value:  None.
  1028.      Remarks:       None.
  1029.      See also:      VirtualCoord::virtParams(unsigned, unsigned),
  1030.                     VirtualCoord::realParams(unsigned*, unsigned*),
  1031.                     VirtualCoord::virtParams(unsigned*, unsigned*)
  1032.  
  1033.  *** Function:      VirtualCoord::virtParams(unsigned*, unsigned*)
  1034.      Syntax:        void VirtualCoord::virtParams(unsigned *virtMaxX,
  1035.                     unsigned *virtMaxY);
  1036.      Purpose:       Get the maximum virtual x- and y-coordinates.
  1037.      Parameters:    The maximum virtual x-coordinate is stored in
  1038.                     'virtMaxX', and the maximum y-coordinate in 'virtMaxY'.
  1039.      Return value:  None.
  1040.      Remarks:       None.
  1041.      See also:      VirtualCoord::realParams(unsigned*, unsigned*),
  1042.                     VirtualCoord::virtParams(unsigned, unsigned),
  1043.                     VirtualCoord::realParams(unsigned, unsigned)
  1044.  
  1045.  *** Function:      VirtualCoord::realParams(unsigned*, unsigned*)
  1046.      Syntax:        void VirtualCoord::realParams(unsigned *virtMaxX,
  1047.                     unsigned *virtMaxY);
  1048.      Purpose:       Get the maximum real x- and y-coordinates.
  1049.      Parameters:    The maximum real x-coordinate is stored in 'realMaxX',
  1050.                     and the maximum y-coordinate in 'realMaxY'.
  1051.      Return value:  None.
  1052.      Remarks:       None.
  1053.      See also:      VirtualCoord::virtParams(unsigned*, unsigned*),
  1054.                     VirtualCoord::realParams(unsigned, unsigned),
  1055.                     VirtualCoord::virtParams(unsigned, unsigned)
  1056.  
  1057.  *** Function:      VirtualCoord::realCoords()
  1058.      Syntax:        void VirtualCoord::realCoords(unsigned virtX, unsigned
  1059.                     virtY, unsigned *realX, unsigned *realY);
  1060.      Purpose:       Calculate the real (x,y) coordinates given the virtual
  1061.                     coordinates.
  1062.      Parameters:    The real (x,y) coordinates are returned in
  1063.                     ('realX','realY'), and are calculated based on the
  1064.                     virtual (x,y) coordinates ('virtX','virtY').
  1065.      Return value:  None.
  1066.      Remarks:       None.
  1067.      See also:      VirtualCoord::realX(), VirtualCoord::realY(),
  1068.                     VirtualCoord::virtCoords(), VirtualCoord::virtX(),
  1069.                     VirtualCoord::virtY()
  1070.  
  1071.  *** Function:      VirtualCoord::realX()
  1072.      Syntax:        unsigned VirtualCoord::realX(unsigned virtX);
  1073.      Purpose:       Calculate the real x-coordinate given the virtual x-
  1074.                     coordinate.
  1075.      Parameters:    The real x-coordinate is returned, calculated based on
  1076.                     the virtual x-coordinate 'virtX'.
  1077.      Return value:  Returns the real x-coordinate.
  1078.      Remarks:       None.
  1079.      See also:      VirtualCoord::realY(), VirtualCoord::realCoords(),
  1080.                     VirtualCoord::virtX(), VirtualCoord::virtY(),
  1081.                     VirtualCoord::virtCoords()
  1082.  
  1083.  *** Function:      VirtualCoord::realY()
  1084.      Syntax:        unsigned VirtualCoord::realY(unsigned virtY);
  1085.      Purpose:       Calculate the real y-coordinate given the virtual y-
  1086.                     coordinate.
  1087.      Parameters:    The real y-coordinate is returned, calculated based on
  1088.                     the virtual y-coordinate 'virtY'.
  1089.      Return value:  Returns the real y-coordinate.
  1090.      Remarks:       None.
  1091.      See also:      VirtualCoord::realX(), VirtualCoord::realCoords(),
  1092.                     VirtualCoord::virtY(), VirtualCoord::virtX(),
  1093.                     VirtualCoord::virtCoords()
  1094.  
  1095.  *** Function:      VirtualCoord::virtCoords()
  1096.      Syntax:        void VirtualCoord::virtCoords(unsigned realX, unsigned
  1097.                     realY, unsigned *virtX, unsigned *virtY);
  1098.      Purpose:       Calculate the virtual (x,y) coordinates given the real
  1099.                     coordinates.
  1100.      Parameters:    The virtual (x,y) coordinates are returned in
  1101.                     ('virtX','virtY'), and are calculated based on the real
  1102.                     (x,y) coordinate ('realX','realY').
  1103.      Return value:  None.
  1104.      Remarks:       None.
  1105.      See also:      VirtualCoord::virtX(), VirtualCoord::virtY(),
  1106.                     VirtualCoord::realCoords(), VirtualCoord::realX(),
  1107.                     VirtualCoord::realY()
  1108.  
  1109.  *** Function:      VirtualCoord::virtX()
  1110.      Syntax:        unsigned VirtualCoord::virtX(unsigned realX);
  1111.      Purpose:       Calculate the virtual x-coordinate given the real x-
  1112.                     coordinate.
  1113.      Parameters:    The virtual x-coordinate is returned, calculated based
  1114.                     on the real x-coordinate 'realX'.
  1115.      Return value:  Returns the virtual x-coordinate.
  1116.      Remarks:       None.
  1117.      See also:      VirtualCoord::virtY(), VirtualCoord::virtCoords(),
  1118.                     VirtualCoord::realX(), VirtualCoord::realY(),
  1119.                     VirtualCoord::realCoords()
  1120.  
  1121.  *** Function:      VirtualCoord::virtY()
  1122.      Syntax:        unsigned VirtualCoord::virtY(unsigned realY);
  1123.      Purpose:       Calculate the virtual y-coordinate given the real y-
  1124.                     coordinate.
  1125.      Parameters:    The virtual y-coordinate is returned, calculated based
  1126.                     on the real y-coordinate 'realY'.
  1127.      Return value:  Returns the virtual y-coordinate.
  1128.      Remarks:       None.
  1129.      See also:      VirtualCoord::virtX(), VirtualCoord::virtCoords(),
  1130.                     VirtualCoord::realY(), VirtualCoord::realX(),
  1131.                     VirtualCoord::realCoords()
  1132.  
  1133.  
  1134.  
  1135. VIRTUAL SCREENS
  1136. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1137.  
  1138.      In early releases of TGE, all graphics input and output operations
  1139.      were done on the screen.  Now four different I/O arrangements are
  1140.      available:
  1141.         - Input and output on the real screen.
  1142.         - Input and output on a virtual screen (ie. in memory).
  1143.         - Input from the real screen, and output to a virtual screen.
  1144.         - Input from a virtual screen, and output to the real screen.
  1145.      As well, it is possible to switch between these four I/O modes at any
  1146.      time with one or two simple function calls.
  1147.  
  1148.      Virtual screens are useful for such tasks as building complex images
  1149.      off-screen, then displaying them quickly.  Since a virtual screen has
  1150.      exactly the same format as the images used by getImage() and its
  1151.      associated functions, they can be displayed using a putImage() or
  1152.      putImageInv() call, simply by passing the address of the virtual
  1153.      screen as the address of the image to be displayed.
  1154.  
  1155.  
  1156.      A virtual screen (or any bitmap, for that matter) may be created using
  1157.      the following function:
  1158.  
  1159.  *** Function:      makeVirtScreen()
  1160.      Syntax:        void far *makeVirtScreen(unsigned wide, unsigned deep);
  1161.      Purpose:       Allocate enough RAM to store a virtual screen with the
  1162.                     specified dimensions, then initialize it.
  1163.      Parameters:    A virtual screen with width 'wide' and depth 'deep' (in
  1164.                     pixels) will be created.
  1165.      Return value:  Returns the address of the newly allocated virtual
  1166.                     screen, or NULL if there is not enough memory to create
  1167.                     it.
  1168.      Remarks:            Memory for the virtual screen is alloated from
  1169.                     available conventional memory; don't forget to
  1170.                     de-allocate (using farfree()) the memory occupied by a
  1171.                     virtual screen when the screen is no longer needed.
  1172.                          After it is allocated, a virtual screen will
  1173.                     likely be filled with random pixels.  Clearing it using
  1174.                     clearGraphics() is often a good idea (after graphics
  1175.                     output has been set to the virtual screen).
  1176.      See also:      None.
  1177.      
  1178.  
  1179.      The functions used to establish input and output to and from real and
  1180.      virtual screens are:
  1181.  
  1182.  *** Function:      setGraphicsAddr()
  1183.      Syntax:        void setGraphicsAddr(void far *addr);
  1184.      Purpose:       Set the location upon which graphics input and output
  1185.                     will both be performed.
  1186.      Parameters:    If 'addr' is equal to NULL, input and output will be
  1187.                     performed on the real screen; if 'addr' is non-NULL,
  1188.                     input and output will be performed on the virtual
  1189.                     screen pointed to by 'addr'.
  1190.      Return value:  None.
  1191.      Remarks:       This function sets the currently active input and
  1192.                     output viewports to cover the entirety of the virtual
  1193.                     screen.  INMAXX, INMAXY, OUTMAXX, and OUTMAXY are also
  1194.                     changed appropriately.
  1195.      See also:      setGraphicsInputAddr(), setGraphicsOutputAddr()
  1196.  
  1197.  *** Function:      setGraphicsInputAddr()
  1198.      Syntax:        void setGraphicsInputAddr(void far *addr);
  1199.      Purpose:       Set the location upon which graphics input will be
  1200.                     performed.
  1201.      Parameters:    If 'addr' is equal to NULL, input will be performed on
  1202.                     the real screen; if 'addr' is non-NULL, input will be
  1203.                     performed on the virtual screen pointed to by 'addr'.
  1204.      Return value:  None.
  1205.      Remarks:       This function sets the currently active input viewport
  1206.                     to cover the entirety of the virtual screen.  INMAXX
  1207.                     and INMAXY are also changed appropriately.
  1208.      See also:      setGraphicsOutputAddr(), setGraphicsAddr()
  1209.  
  1210.  *** Function:      setGraphicsOutputAddr()
  1211.      Syntax:        void setGraphicsOutputAddr(void far *addr);
  1212.      Purpose:       Set the location upon which graphics output will be
  1213.                     performed.
  1214.      Parameters:    If 'addr' is equal to NULL, output will be performed on
  1215.                     the real screen; if 'addr' is non-NULL, output will be
  1216.                     performed on the virtual screen pointed to by 'addr'.
  1217.      Return value:  None.
  1218.      Remarks:       This function sets the currently active output viewport
  1219.                     to cover the entirety of the virtual screen.  OUTMAXX
  1220.                     and OUTMAXY are also changed appropriately.
  1221.      See also:      setGraphicsInputAddr(), setGraphicsAddr()
  1222.  
  1223.  *** Function:      getGraphicsInputAddr()
  1224.      Syntax:        void far *getGraphicsInputAddr(void);
  1225.      Purpose:       Get the location upon which graphics input is currently
  1226.                     being performed.
  1227.      Parameters:    None.
  1228.      Return value:  Returns NULL if graphics input is currently being
  1229.                     performed on the physical screen, or the address of the
  1230.                     virtual screen upon which input is being performed
  1231.                     otherwise.
  1232.      Remarks:       None.
  1233.      See also:      getGraphicsOutputAddr()
  1234.  
  1235.  *** Function:      getGraphicsOutputAddr()
  1236.      Syntax:        void far *getGraphicsOutputAddr(void);
  1237.      Purpose:       Get the location upon which graphics output is currently
  1238.                     being performed.
  1239.      Parameters:    None.
  1240.      Return value:  Returns NULL if graphics output is currently being
  1241.                     performed on the physical screen, or the address of the
  1242.                     virtual screen upon which output is being performed
  1243.                     otherwise.
  1244.      Remarks:       None.
  1245.      See also:      getGraphicsInputAddr()
  1246.  
  1247.  
  1248.  
  1249. GRAPHICAL OUTPUT MODES
  1250. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1251.  
  1252.      In early releases of TGE, all graphics output was copied to the
  1253.      screen.  Now output can be copied, ANDed, NOTed, ORed, or XORed, even
  1254.      to virtual screens.  A description of each of these output modes
  1255.      follows:
  1256.         - COPY:  This mode is the one which will likely be used most
  1257.           frequently.  In this mode, any output is copied directly,
  1258.           overwriting anything which was previously there.
  1259.         - AND:  In this mode, each pixel output is ANDed with the pixel
  1260.           already at the same location.
  1261.         - NOT:  In this mode, each pixel output is NOTed before being
  1262.           output.
  1263.         - OR:  In this mode, each pixel output is ORed with the pixel
  1264.           already at the same location.
  1265.         - XOR:  In this mode, each pixel output is XORed with the pixel
  1266.           already at the same location.
  1267.  
  1268.  
  1269.      The following function allows selection of the output mode:
  1270.  
  1271.  *** Function:      setGraphicsOutputMode()
  1272.      Syntax:        void setGraphicsOutputMode(int mode);
  1273.      Purpose:       Select the currently used output mode.
  1274.      Parameters:    The output mode will be set to COPY if 'mode' is
  1275.                     TGE_COPY_PUT, AND if it is TGE_AND_PUT, NOT if it is
  1276.                     TGE_NOT_PUT, OR if it is TGE_OR_PUT, or XOR if it is
  1277.                     TGE_XOR_PUT.  These macros are defined in TGE.H.
  1278.      Return value:  None.
  1279.      Remarks:       These output modes affect output to physical and
  1280.                     virtual screens.
  1281.      See also:      None.
  1282.  
  1283.  
  1284.  
  1285. USING FONTS
  1286. ▀▀▀▀▀▀▀▀▀▀▀
  1287.  
  1288.      TGE supports two types of loadable fonts:  fixed-size monochrome fonts
  1289.      (implemented with the FixedFont class), and variable-size 256-colour
  1290.      fonts (implemented with the VariableFont class).  Both high- and
  1291.      low-ASCII characters are supported.  As well, multiple fonts may be
  1292.      resident in memory simultaneously.
  1293.  
  1294.      For variable-size 256-colour fonts:
  1295.      ──────────────────────────────────
  1296.           In order to use a variable-size 256-colour font, an instance of
  1297.           the VariableFont class is necessary.  Font initialization will
  1298.           look something like this:
  1299.  
  1300.                VariableFont systemFont;
  1301.                char systemFontName[] = "BIGTEXT";
  1302.                     .
  1303.                     .
  1304.                     .
  1305.                if (!systemFont.load(systemFontName))
  1306.                {
  1307.                  printf("Error loading %s; aborting.\n\n", systemFontName);
  1308.                  exit(1);
  1309.                }
  1310.  
  1311.           Once a font has been loaded, it may be manipulated via its
  1312.           VariableFont class instance.  The class destructor automatically
  1313.           removes the font from memory.
  1314.  
  1315.           A complete list of the VariableFont member functions follows.
  1316.  
  1317.  
  1318.       *** Function:      VariableFont::load()
  1319.           Syntax:        int VariableFont::load(char *filename);
  1320.           Purpose:       Load a font from disk.
  1321.           Parameters:    The font file 'filename' will be loaded.
  1322.           Return value:  Returns 0 on error.
  1323.           Remarks:       None.
  1324.           See also:      None.
  1325.  
  1326.       *** Function:      VariableFont::put()
  1327.           Syntax:        void VariableFont::put(int x, int y, char
  1328.                          ch);
  1329.           Purpose:       Write a character on screen.
  1330.           Parameters:    The character 'ch' will be displayed with its
  1331.                          upper-left corner at ('x','y').
  1332.           Return value:  None.
  1333.           Remarks:       None.
  1334.           See also:      VariableFont::put(int, int, char*)
  1335.  
  1336.       *** Function:      VariableFont::put()
  1337.           Syntax:        void VariableFont::put(int x, int y, char
  1338.                          *string);
  1339.           Purpose:       Write a string on screen.
  1340.           Parameters:    The string 'string' will be displayed with its
  1341.                          upper-left corner at ('x','y').
  1342.           Return value:  None.
  1343.           Remarks:       None.
  1344.           See also:      VariableFont::put(int, int, char)
  1345.  
  1346.       *** Function:      VariableFont::width()
  1347.           Syntax:        unsigned VariableFont::width(char *string);
  1348.           Purpose:       Determine the width of a string.
  1349.           Parameters:    The width of the string 'string' will be
  1350.                          determined.
  1351.           Return value:  The width of the string, in pixels, will be
  1352.                          returned.
  1353.           Remarks:       None.
  1354.           See also:      VariableFont::width(char),
  1355.                          VariableFont::height(char*),
  1356.                          VariableFont::height(char)
  1357.  
  1358.       *** Function:      VariableFont::height()
  1359.           Syntax:        unsigned VariableFont::height(char *string);
  1360.           Purpose:       Determine the height of a string.
  1361.           Parameters:    The height of the string 'string' will be
  1362.                          determined.
  1363.           Return value:  The height of the string, in pixels, will be
  1364.                          returned.
  1365.           Remarks:       None.
  1366.           See also:      VariableFont::height(char),
  1367.                          VariableFont::width(char*),
  1368.                          VariableFont::width(char),
  1369.                          VariableFont::maxHeight()
  1370.  
  1371.       *** Function:      VariableFont::width()
  1372.           Syntax:        unsigned short VariableFont::width(char ch);
  1373.           Purpose:       Determine the width of a character.
  1374.           Parameters:    The width of the character 'ch' will be
  1375.                          determined.
  1376.           Return value:  The width of the string, in pixels, will be
  1377.                          returned.
  1378.           Remarks:       None.
  1379.           See also:      VariableFont::width(char*),
  1380.                          VariableFont::height(char),
  1381.                          VariableFont::width(char*)
  1382.  
  1383.       *** Function:      VariableFont::height()
  1384.           Syntax:        unsigned short VariableFont::height(char ch);
  1385.           Purpose:       Determine the height of a character.
  1386.           Parameters:    The height of the character 'ch' will be
  1387.                          determined.
  1388.           Return value:  The height of the string, in pixels, will be
  1389.                          returned.
  1390.           Remarks:       None.
  1391.           See also:      VariableFont::height(char*),
  1392.                          VariableFont::width(char),
  1393.                          VariableFont::height(char*),
  1394.                          VariableFont::maxHeight()
  1395.  
  1396.       *** Function:      VariableFont::maxHeight()
  1397.           Syntax:        unsigned short VariableFont::maxHeight(void);
  1398.           Purpose:       Determine the height of the tallest character.
  1399.           Parameters:    None.
  1400.           Return value:  The height of the tallest character, in pixels,
  1401.                          will be returned.
  1402.           Remarks:       None.
  1403.           See also:      VariableFont::height(char*),
  1404.                          VariableFont::height(char)
  1405.  
  1406.       *** Function:      VariableFont::matchColours()
  1407.           Syntax:        void VariableFont::matchColours(void);
  1408.           Purpose:       Match the font colours as closely as possible to
  1409.                          the currently selected font palette.
  1410.           Parameters:    None.
  1411.           Return value:  None.
  1412.           Remarks:       This function is really only useful after the
  1413.                          colour palette has been changed.
  1414.           See also:      VariableFont::palette(void*)
  1415.  
  1416.       *** Function:      VariableFont::palette(void*)
  1417.           Syntax:        void VariableFont::palette(void *palette);
  1418.           Purpose:       Change the currently active font palette.
  1419.           Parameters:    The currently active font palette will be set to
  1420.                          the palette at 'palette'.
  1421.           Return value:  None.
  1422.           Remarks:       VariableFont::matchColours() is autmatically
  1423.                          called by this function.
  1424.           See also:      VariableFont::palette(void),
  1425.                          VariableFont::palette(unsigned char, unsigned
  1426.                          char, unsigned char, unsigned char),
  1427.                          VariableFont::matchColours()
  1428.  
  1429.       *** Function:      VariableFont::palette(void)
  1430.           Syntax:        void *VariableFont::palette(void);
  1431.           Purpose:       Get the address of the currently active font
  1432.                          palette.
  1433.           Parameters:    None.
  1434.           Return value:  Returns the address of the font palette.
  1435.           Remarks:       If a change is made to this data directly, you
  1436.                          must call VariableFont::palette(void*) if the
  1437.                          changes are to take effect.
  1438.           See also:      VariableFont::palette(void),
  1439.                          VariableFont::palette(unsigned char, unsigned
  1440.                          char*, unsigned char*, unsigned char*)
  1441.  
  1442.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1443.                          char, unsigned char, unsigned char)
  1444.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1445.                          unsigned char red, unsigned char green, unsigned
  1446.                          char blue);
  1447.           Purpose:       Change one of the colours of the font palette.
  1448.           Parameters:    Colour number 'palReg' of the font palette will be
  1449.                          set to match the values passed in 'red', 'green',
  1450.                          and 'blue'.
  1451.           Return value:  None.
  1452.           Remarks:       The change will take effect immediately; there is
  1453.                          no need to explicitly update the palette.
  1454.           See also:      VariableFont::palette(void*)
  1455.  
  1456.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1457.                          char*, unsigned char*, unsigned char*)
  1458.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1459.                          unsigned char *red, unsigned char *green, unsigned
  1460.                          char *blue);
  1461.           Purpose:       Determine the contents of one of the colours of
  1462.                          the font palette.
  1463.           Parameters:    Colour number 'palReg' of the font palette will be
  1464.                          passed to the caller in 'red', 'green', and
  1465.                          'blue'.
  1466.           Return value:  None.  On return, however, the colour's components
  1467.                          will be present at the 'red', 'green', and 'blue'
  1468.                          buffers.
  1469.           Remarks:       None.
  1470.           See also:      VariableFont::palette(void)
  1471.  
  1472.       *** Function:      VariableFont::spacing()
  1473.           Syntax:        void VariableFont::spacing(unsigned numPixels);
  1474.           Purpose:       Change the spacing between characters.
  1475.           Parameters:    After calling this function, the number of pixels
  1476.                          left between characters output with
  1477.                          VariableFont::put(char*) will be set to
  1478.                          'numPixels'.
  1479.           Return value:  None.
  1480.           Remarks:       The spacing defaults to one pixel between each
  1481.                          character.
  1482.           See also:      VariableFont::spacing(void)
  1483.  
  1484.       *** Function:      VariableFont::spacing()
  1485.           Syntax:        unsigned VariableFont::spacing(void);
  1486.           Purpose:       Return the spacing between characters.
  1487.           Parameters:    None.
  1488.           Return value:  Returns the number of pixels used to space two
  1489.                          adjacent characters.
  1490.           Remarks:       The spacing defaults to one pixel between each
  1491.                          character.
  1492.           See also:      VariableFont::spacing(unsigned)
  1493.  
  1494.  
  1495.  
  1496.      For fixed-size monochrome fonts:
  1497.      ───────────────────────────────
  1498.           In order to use a fixed-size monochrome font, an instance of the
  1499.           FixedFont class is necessary.  Assuming instantiation of a
  1500.           FixedFont pointer, font initialization will look something like
  1501.           this:
  1502.  
  1503.                FixedFont *fixedFont;
  1504.                char fixedFontName[] = "8X16";
  1505.                          .
  1506.                          .
  1507.                          .
  1508.                fixedFont = new Font(fixedFontName);      // load font
  1509.                if (fixedFont==NULL || !fixedFont->status())
  1510.                {
  1511.                  printf("Error loading %s; aborting.\n\n", fixedFontName);
  1512.                  exit(1);
  1513.                }
  1514.  
  1515.           Once a font has been loaded, it may be manipulated via its
  1516.           FixedFont class instance.  The class destructor automatically
  1517.           removes the font from memory.
  1518.  
  1519.           A complete list of the FixedFont member functions follows.
  1520.  
  1521.       *** Function:      FixedFont::FixedFont()
  1522.           Syntax:        FixedFont::FixedFont(char *filename, unsigned char
  1523.                          fg=1, unsigned char bg=0);
  1524.           Purpose:       Load a font, and initiate a FixedFont class for
  1525.                          use with it.
  1526.           Parameters:    'filename' is the name of the font data file. 'fg'
  1527.                          (which defaults to 1) is the colour to be used as
  1528.                          the foreground colour.  'bg' (which defaults to 0)
  1529.                          is the colour to be used as the background colour.
  1530.           Return value:  None.
  1531.           Remarks:       After an instantiation of a FixedFont, ensure that
  1532.                          the loading and initialization was successful
  1533.                          using the method illustrated above.
  1534.           See also:      FixedFont::~FixedFont()
  1535.  
  1536.       *** Function:      FixedFont::status()
  1537.           Syntax:        int FixedFont::status(void);
  1538.           Purpose:       Return a flag indicating whether or not the font
  1539.                          loading and initialization were successful.
  1540.           Parameters:    None.
  1541.           Return value:  Returns 1 if the initialization was successful, or
  1542.                          0 if it wasn't.
  1543.           Remarks:       None.
  1544.           See also:      None.
  1545.  
  1546.       *** Function:      FixedFont::width(char*)
  1547.           Syntax:        unsigned FixedFont::width(char *str);
  1548.           Purpose:       Return the width, in pixels, of a string.
  1549.           Parameters:    The string 'str' is analyzed.
  1550.           Return value:  Returns the width of 'str', in pixels.
  1551.           Remarks:       None.
  1552.           See also:      FixedFont::width(char), FixedFont::height(char*),
  1553.                          FixedFont::height(char), FixedFont::maxWidth(),
  1554.                          FixedFont::maxHeight()
  1555.  
  1556.       *** Function:      FixedFont::width(char)
  1557.           Syntax:        unsigned FixedFont::width(char ch);
  1558.           Purpose:       Return the width, in pixels, of a single
  1559.                          character.
  1560.           Parameters:    The character 'ch' is analyzed.
  1561.           Return value:  Returns the width of 'ch', in pixels.
  1562.           Remarks:       None.
  1563.           See also:      FixedFont::width(char*), FixedFont::height(char),
  1564.                          FixedFont::height(char*), FixedFont::maxWidth(),
  1565.                          FixedFont::maxHeight()
  1566.  
  1567.       *** Function:      FixedFont::maxWidth()
  1568.           Syntax:        unsigned maxWidth(void);
  1569.           Purpose:       Return the width of the widest character.
  1570.           Parameters:    None.
  1571.           Return value:  Returns the width of the widest character.
  1572.           Remarks:       None.
  1573.           See also:      FixedFont::maxHeight(void),
  1574.                          FixedFont::width(char*), FixedFont::width(char),
  1575.                          FixedFont::height(char*), FixedFont::height(char)
  1576.  
  1577.       *** Function:      FixedFont::height(char*)
  1578.           Syntax:        unsigned FixedFont::height(char *str);
  1579.           Purpose:       Return the height, in pixels, of a string.
  1580.           Parameters:    The string 'str' is analyzed.
  1581.           Return value:  Returns the depth of 'str', in pixels.
  1582.           Remarks:       None.
  1583.           See also:      FixedFont::height(char), FixedFont::width(char*),
  1584.                          FixedFont::height(char), FixedFont::maxHeight(),
  1585.                          FixedFont::maxWidth()
  1586.  
  1587.       *** Function:      FixedFont::height(char)
  1588.           Syntax:        unsigned FixedFont::height(char ch);
  1589.           Purpose:       Return the height, in pixels, of a single
  1590.                          character.
  1591.           Parameters:    The character 'ch' is analyzed.
  1592.           Return value:  Returns the height of 'ch', in pixels.
  1593.           Remarks:       None.
  1594.           See also:      FixedFont::height(char*), FixedFont::width(char),
  1595.                          FixedFont::width(char*), FixedFont::maxWidth(),
  1596.                          FixedFont::maxHeight()
  1597.  
  1598.       *** Function:      FixedFont::maxHeight()
  1599.           Syntax:        unsigned maxHeight(void);
  1600.           Purpose:       Return the height of the tallest character.
  1601.           Parameters:    None.
  1602.           Return value:  Returns the height of the tallest character.
  1603.           Remarks:       None.
  1604.           See also:      FixedFont::maxWidth(void),
  1605.                          FixedFont::height(char*), FixedFont::height(char),
  1606.                          FixedFont::width(char*), FixedFont::width(char)
  1607.  
  1608.       *** Function:      FixedFont::put(int, int, char*)
  1609.           Syntax:        void FixedFont::put(int x, int y, char *str);
  1610.           Purpose:       Write a string to the screen.
  1611.           Parameters:    The string 'str' will be written starting at
  1612.                          ('x','y').
  1613.           Return value:  None.
  1614.           Remarks:       The coordinate passed to this function specifies
  1615.                          the upper-left coordinate of the string.
  1616.           See also:      FixedFont::put(char);
  1617.  
  1618.       *** Function:      FixedFont::put(int, int, char)
  1619.           Syntax:        void FixedFont::put(int x, int y, char ch);
  1620.           Purpose:       Write a single character to the screen.
  1621.           Parameters:    The character 'ch' will be written at
  1622.                          ('x','y').
  1623.           Return value:  None.
  1624.           Remarks:       The coordinate passed to this function specifies
  1625.                          the upper-left coordinate of the character.
  1626.           See also:      FixedFont::put(char*);
  1627.  
  1628.       *** Function:      FixedFont::foreground(unsigned)
  1629.           Syntax:        void FixedFont::foreground(unsigned colour);
  1630.           Purpose:       Set the current foreground colour.
  1631.           Parameters:    The foreground colour will be set to 'colour'.
  1632.           Return value:  None.
  1633.           Remarks:       None.
  1634.           See also:      FixedFont::background(unsigned),
  1635.                          FixedFont::foreground(void),
  1636.                          FixedFont::background(void)
  1637.  
  1638.       *** Function:      FixedFont::foreground(void)
  1639.           Syntax:        unsigned FixedFont::foreground(void);
  1640.           Purpose:       Return the current foreground colour.
  1641.           Parameters:    None.
  1642.           Return value:  Returns the current foreground colour.
  1643.           Remarks:       None.
  1644.           See also:      FixedFont::background(void),
  1645.                          FixedFont::foreground(unsigned),
  1646.                          FixedFont::foreground(unsigned)
  1647.  
  1648.       *** Function:      FixedFont::background(unsigned)
  1649.           Syntax:        void FixedFont::background(unsigned colour);
  1650.           Purpose:       Set the current background colour.
  1651.           Parameters:    The background colour will be set to 'colour'.
  1652.           Return value:  None.
  1653.           Remarks:       None.
  1654.           See also:      FixedFont::foreground(unsigned),
  1655.                          FixedFont::background(void),
  1656.                          FixedFont::foreground(void)
  1657.  
  1658.       *** Function:      FixedFont::background(void)
  1659.           Syntax:        unsigned FixedFont::background(void);
  1660.           Purpose:       Return the current background colour.
  1661.           Parameters:    None.
  1662.           Return value:  Returns the current background colour.
  1663.           Remarks:       None.
  1664.           See also:      FixedFont::foreground(void),
  1665.                          FixedFont::background(unsigned),
  1666.                          FixedFont::foreground(unsigned)
  1667.  
  1668.  
  1669.      Note that, at present, TGE's fonts are designed for use in 256-colour
  1670.      modes only.
  1671.  
  1672.  
  1673.  
  1674. BITMAP MANIPULATION
  1675. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1676.  
  1677.      Bitmaps can get boring when all you can do is display them.  TGE can
  1678.      scale bitmaps to different sizes, using the following function:
  1679.  
  1680.  *** Function:      scaleBitmap()
  1681.      Syntax:        void far *scaleBitmap(void *srcImage, unsigned newWide,
  1682.                     unsigned newDeep, void *destImage)
  1683.      Purpose:       Scale the given bitmap to the specified size.
  1684.      Parameters:    The image in 'srcImage' will be scaled to 'newWide'
  1685.                     pixels wide and 'newDeep' pixels deep.  The resulting
  1686.                     scaled image will be placed in 'destImage' if
  1687.                     'destImage' is non-NULL, or in a newly allocated block
  1688.                     of memory if 'destImage' is NULL.
  1689.      Return value:  Returns the address of the scaled image on success, or
  1690.                     NULL on error.  Note that NULL will never be returned
  1691.                     if 'destImage' is non-NULL.
  1692.      Remarks:       Results are undefined if either 'newWide' or 'newDeep'
  1693.                     is equal to zero.
  1694.      See also:      None.
  1695.  
  1696.  
  1697.      TGE also provides routines for determining an image's dimensions given
  1698.      its address:
  1699.  
  1700.  *** Function:      imageWidth
  1701.      Syntax:        unsigned imageWidth(void *image);
  1702.      Purpose:       Determine an image's width.
  1703.      Parameters:    This routine will determine the width of 'image'.
  1704.      Return value:  Returns the width, in pixels, of 'image'.
  1705.      Remarks:       This routine is implemented as a macro in TGE.H.
  1706.      See also:      imageHeight
  1707.  
  1708.  *** Function:      imageHeight
  1709.      Syntax:        unsigned imageHeight(void *image);
  1710.      Purpose:       Determine an image's height.
  1711.      Parameters:    This routine will determine the height of 'image'.
  1712.      Return value:  Returns the height, in pixels, of 'image'.
  1713.      Remarks:       This routine is implemented as a macro in TGE.H.
  1714.      See also:      imageWidth
  1715.  
  1716.  
  1717.  
  1718. PALETTE MANIPULATION
  1719. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1720.  
  1721.      TGE provides some palette manipulation routines, described below:
  1722.  
  1723.  
  1724.  *** Function:      fadePalette
  1725.      Syntax:        int fadePalette(unsigned step, void *inPal, void
  1726.                     *outPal, void *targetPal);
  1727.      Purpose:       Fade one palette into another.
  1728.      Parameters:    The palette at 'inPal' will be faded closer to the
  1729.                     palette at 'targetPal'.  The resulting palette will be
  1730.                     stored at 'outPal'.  Each of the colour components
  1731.                     which compose a palette colour will be incremented or
  1732.                     decremented by no more than the value in 'step'; thus,
  1733.                     higher 'step' values produce more rapid fading.
  1734.      Return value:  Returns 0 if fading is complete, or 1 if it isn't.
  1735.      Remarks:       Note that this function does not always complete the
  1736.                     fading with one call.  Code like this could be used:
  1737.                          while (fadePalette(1, in, out, target))
  1738.                          {
  1739.                            delay(10);
  1740.                            setBlockPalette(0, 255, out);
  1741.                            swap(in, out);
  1742.                            doSomeOtherProcessing();
  1743.                          }
  1744.      See also:      None.
  1745.  
  1746.  *** Function:      greyPalette
  1747.      Syntax:        void greyPalette(void *inPal, void *outPal);
  1748.      Purpose:       Produce a greyscale version of a palette.
  1749.      Parameters:    A greyscale version of the palette at 'inPal' will be
  1750.                     calculated, and stored at 'outPal'.
  1751.      Return value:  None, but the calculated greyscale palette will be at
  1752.                     'outPal' on return.
  1753.      Remarks:       Images designed with the input palette in mind will
  1754.                     look the same under the output greyscale palette,
  1755.                     except that they will be composed entirely of greys,
  1756.                     black, and white.
  1757.      See also:      None.
  1758.  
  1759.  *** Function:      rotatePalette
  1760.      Syntax:        void rotatePalette(int howMuch, void *inPal, void
  1761.                     *outPal)
  1762.      Purpose:       Rotate a palette.
  1763.      Parameters:    The palette at 'inPal' will be rotated by the value
  1764.                     'howMuch', and the resulting palette will be placed at
  1765.                     'outPal'.  'howMuch' can be negative or positive,
  1766.                     depending on which direction rotation will be
  1767.                     performed; for instance, a 'howMuch' value of 1 would
  1768.                     cause the value of colour 0 to move to colour 1, while
  1769.                     a 'howMuch' value of -1 would have the opposite effect.
  1770.      Return value:  None, but the rotated palette will be at 'outPal' on
  1771.                     return.
  1772.      Remarks:       This function will still operate correctly with
  1773.                     'howMuch' values which are greater than 255 or less
  1774.                     than -255.
  1775.      See also:      None.
  1776.  
  1777.  
  1778.  
  1779. USING THE MOUSE
  1780. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1781.  
  1782.      TGE now provides support for interrupt-driven, definable mouse
  1783.      pointers.  In order to make use of this feature, some simple steps
  1784.      must be taken.
  1785.  
  1786.      The new mouse handler is designed to work in tandem with TGE's
  1787.      graphical functions.  Programs using the new mouse handler must first
  1788.      have successfully initialized graphics mode using TGE.  Both TGE.H and
  1789.      TGEMOUSE.H must be #included into a program using the mouse services.
  1790.  
  1791.      The mouse handler has to be initialized.  To do so, one function call
  1792.      is required:
  1793.  
  1794.           initNewMouse();
  1795.  
  1796.      For more information on initNewMouse(), refer to the mouse functions
  1797.      reference section.
  1798.  
  1799.      Next, the mouse driver must be informed of the screen dimensions, like
  1800.      this:
  1801.  
  1802.           setHorizLimitsMouse(0, OUTMAXX);
  1803.           setVertLimitsMouse(0, OUTMAXY);
  1804.  
  1805.      If desired, the pointer may then be positioned.  To center it on the
  1806.      screen, do this:
  1807.  
  1808.           setPosMouse(OUTMAXX/2, OUTMAXY/2);
  1809.  
  1810.      A pointer shape must then be selected.  TGE, as shipped, includes two
  1811.      arrow pointers and two target pointers; the file MOUSEPTR.C may easily
  1812.      be modified to allow more.  To select, for instance, the big arrow
  1813.      pointer, do this:
  1814.  
  1815.           setupMousePointer(BIG_ARROW_POINTER);
  1816.  
  1817.      The macro BIG_ARROW_POINTER is defined in TGEMOUSE.H; it expands to a
  1818.      number which is used by MOUSEPTR.C to identify which bitmap to use.
  1819.      Note that if exceptionally large (ie. larger than 512 bytes) pointers
  1820.      are used, a change must be made in NEWMOUSE.ASM; see that file for
  1821.      details.  If you would like to directly set a particular bitmap as the
  1822.      mouse pointer, you may use setPointerMouse(), described in the next
  1823.      section.
  1824.  
  1825.      Once things have been initialized, the use of the new mouse handler
  1826.      over the standard mouse driver can essentially be ignored; mouse
  1827.      driver services are obtained in exactly the same way.  The mouse
  1828.      interface functions are prototyped in TGEMOUSE.H, also using the macro
  1829.      method which allows function names to be changed simply by editing
  1830.      TGEMOUSE.H.
  1831.  
  1832.      Before exiting the program, the function deInitNewMouse() _must_ be
  1833.      called.  It is usually a very good idea to place deInitNewMouse() in
  1834.      the atexit() queue immediately after calling initNewMouse().
  1835.  
  1836.      Note that, since the pointer is drawn using TGE's putImageInv()
  1837.      function, the pointer will only appear when it is within the current
  1838.      viewport.
  1839.  
  1840.  
  1841.  
  1842. TGE'S MOUSE FUNCTION SET
  1843. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1844.  
  1845.  *** Function:      initNewMouse()
  1846.      Syntax:        void initNewMouse(void);
  1847.      Purpose:       Initializes the new mouse handler.
  1848.      Parameters:    The new mouse handler will be configured for use with
  1849.                     TGE.
  1850.      Return value:  None.
  1851.      Remarks:            A graphics driver must have been loaded prior to a
  1852.                     call to initNewMouse().
  1853.                          The new mouse handler requires that a Microsoft or
  1854.                     compatible mouse driver already be resident.  It
  1855.                     assumes that a mouse driver's presence will have been
  1856.                     tested beforehand.
  1857.                          initNewMouse() is really a simple macro; refer to
  1858.                     TGEMOUSE.H for the expansion of initNewMouse(void);
  1859.      See also:      deInitNewMouse(), enableNewMouse(), disableNewMouse()
  1860.  
  1861.  *** Function:      deInitNewMouse()
  1862.      Syntax:        void deInitNewMouse(void);
  1863.      Purpose:       Deactivate the new mouse handler, and leave all the
  1864.                     work up to the old driver.
  1865.      Parameters:    None.
  1866.      Return value:  None.
  1867.      Remarks:       This function must be called prior to program exit if
  1868.                     initNewMouse() had previously been called.
  1869.      See also:      initNewMouse(), enableNewMouse(), disableNewMouse()
  1870.  
  1871.  *** Function:      enableNewMouse()
  1872.      Syntax:        void enableNewMouse(void);
  1873.      Purpose:       Reactivate the new mouse handler following a call to
  1874.                     disableNewMouse().
  1875.      Parameters:    None.
  1876.      Return value:  None.
  1877.      Remarks:       None.
  1878.      See also:      disableNewMouse(), initNewMouse(), deInitNewMouse()
  1879.  
  1880.  *** Function:      disableNewMouse()
  1881.      Syntax:        void disableNewMouse(void);
  1882.      Purpose:       Temporarily deactivate the new mouse handler, to be
  1883.                     reactivated later by a call to enableNewMouse().
  1884.      Parameters:    None.
  1885.      Return value:  None.
  1886.      Remarks:       Following a call to this function, the new mouse
  1887.                     handler will cease trapping mouse driver interrupts and
  1888.                     moving the pointer.
  1889.      See also:      enableNewMouse(), initNewMouse(), deInitNewMouse()
  1890.  
  1891.  *** Function:      resetMouse()
  1892.      Syntax:        int resetMouse(void);
  1893.      Purpose:       Reset the mouse driver and hardware.
  1894.      Parameters:    None.
  1895.      Return value:  1 if mouse driver available, 0 otherwise.
  1896.      Remarks:       Following a call to this function, the mouse pointer is
  1897.                     hidden and positioned at the center of the screen.
  1898.      See also:      softResetMouse(), initNewMouse()
  1899.  
  1900.  *** Function:      getButtonsMouse()
  1901.      Syntax:        int getButtonsMouse(void);
  1902.      Purpose:       Return the number of buttons on the mouse.
  1903.      Parameters:    None.
  1904.      Return value:  Returns the number of buttons on the mouse.
  1905.      Remarks:       This function calls resetMouse(), and so the mouse
  1906.                     driver and hardware are re-initialized.
  1907.      See also:      resetMouse()
  1908.  
  1909.  *** Function:      showMouse()
  1910.      Syntax:        void showMouse(void);
  1911.      Purpose:       Show the mouse pointer.
  1912.      Parameters:    None.
  1913.      Return value:  None.
  1914.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1915.                     ie., if showMouse() is called twice, hideMouse() must
  1916.                     be called twice to hide the pointer again.
  1917.      See also:      hideMouse()
  1918.  
  1919.  *** Function:      hideMouse()
  1920.      Syntax:        void hideMouse(void);
  1921.      Purpose:       Hide the mouse pointer.
  1922.      Parameters:    None.
  1923.      Return value:  None.
  1924.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1925.                     ie., if showMouse() is called twice, hideMouse() must
  1926.                     be called twice to hide the pointer again.
  1927.      See also:      showMouse()
  1928.  
  1929.  *** Function:      getPosMouse()
  1930.      Syntax:        void getPosMouse(int far *x, int far *y);
  1931.      Purpose:       Get the current pointer coordinates.
  1932.      Parameters:    The current pointer x- and y-coordinates will be stored
  1933.                     in 'x' and 'y', respectively.
  1934.      Return value:  None.
  1935.      Remarks:       None.
  1936.      See also:      setPosMouse()
  1937.  
  1938.  *** Function:      setPosMouse()
  1939.      Syntax:        void setPosMouse(unsigned x, unsigned y);
  1940.      Purpose:       Set the current pointer coordinates.
  1941.      Parameters:    The pointer will be positioned at ('x','y').
  1942.      Return value:  None.
  1943.      Remarks:       None.
  1944.      See also:      getPosMouse()
  1945.  
  1946.  *** Function:      buttonMouse()
  1947.      Syntax:        int buttonMouse(void);
  1948.      Purpose:       Return whether or not any of the mouse buttons is down.
  1949.      Parameters:    None.
  1950.      Return value:  Returns true if at least one button is down, or zero if
  1951.                     none of them is down.
  1952.      Remarks:       None.
  1953.      See also:      leftButtonMouse(), rightButtonMouse(),
  1954.                     centerButtonMouse(), waitReleaseMouse()
  1955.  
  1956.  *** Function:      leftButtonMouse()
  1957.      Syntax:        int leftButtonMouse(void);
  1958.      Purpose:       Return the status of the left mouse button.
  1959.      Parameters:    None.
  1960.      Return value:  Returns true if the button is down, or zero if it is
  1961.                     up.
  1962.      Remarks:       None.
  1963.      See also:      buttonMouse(), rightButtonMouse(), centerButtonMouse(),
  1964.                     waitReleaseMouse()
  1965.  
  1966.  *** Function:      rightButtonMouse()
  1967.      Syntax:        int rightButtonMouse(void);
  1968.      Purpose:       Return the status of the right mouse button.
  1969.      Parameters:    None.
  1970.      Return value:  Returns true if the button is down, or zero if it is
  1971.                     up.
  1972.      Remarks:       None.
  1973.      See also:      buttonMouse(), leftButtonMouse(), centerButtonMouse(),
  1974.                     waitReleaseMouse()
  1975.  
  1976.  *** Function:      centerButtonMouse()
  1977.      Syntax:        int centerButtonMouse(void);
  1978.      Purpose:       Return the status of the center mouse button.
  1979.      Parameters:    None.
  1980.      Return value:  Returns true if the button is down, or zero if it is
  1981.                     up.
  1982.      Remarks:       None.
  1983.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  1984.                     waitReleaseMouse()
  1985.  
  1986.  *** Function:      buttonPressMouse()
  1987.      Syntax:        unsigned buttonPressMouse(unsigned button, int far *x,
  1988.                     int far *y);
  1989.      Purpose:       Return the number of times the specified button has
  1990.                     been pressed since the last call to this function (with
  1991.                     the same button parameter), and store the coordinates
  1992.                     of the last press.
  1993.      Parameters:    The button 'button' is checked, and may be any of
  1994.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  1995.                     defined in TGEMOUSE.H.  The position of the last press
  1996.                     will be stored in ('x','y').
  1997.      Return value:  Returns the number of times the specified button has
  1998.                     been pressed since the last call to this function (with
  1999.                     the same button parameter).
  2000.      Remarks:       None.
  2001.      See also:      buttonReleaseMouse()
  2002.  
  2003.  *** Function:      buttonReleaseMouse()
  2004.      Syntax:        unsigned buttonReleaseMouse(unsigned button, int far
  2005.                     *x, int far *y);
  2006.      Purpose:       Return the number of times the specified button has
  2007.                     been released since the last call to this function
  2008.                     (with the same button parameter), and store the
  2009.                     coordinates of the last press.
  2010.      Parameters:    The button 'button' is checked, and may be any of
  2011.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2012.                     defined in TGEMOUSE.H.  The position of the last
  2013.                     release will be stored in ('x','y').
  2014.      Return value:  Returns the number of times the specified button has
  2015.                     been released since the last call to this function
  2016.                     (with the same button parameter).
  2017.      Remarks:       None.
  2018.      See also:      buttonPressMouse()
  2019.  
  2020.  *** Function:      waitReleaseMouse()
  2021.      Syntax:        void waitReleaseMouse(int button);
  2022.      Purpose:       If the specified button is not already up, wait until
  2023.                     it is released, then return.
  2024.      Parameters:    The button 'button' is checked, and may be any of
  2025.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2026.                     defined in TGEMOUSE.H.
  2027.      Return value:  None.
  2028.      Remarks:       None.
  2029.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  2030.                     centerButtonMouse()
  2031.  
  2032.  *** Function:      setHorizLimitsMouse()
  2033.      Syntax:        void setHorizLimitsMouse(unsigned min, unsigned max);
  2034.      Purpose:       Set the minimum and maximum horizontal coordinates for
  2035.                     the pointer.
  2036.      Parameters:    The minimum horizontal coordinate will be set to 'min',
  2037.                     and the maximum to 'max'.
  2038.      Return value:  None.
  2039.      Remarks:       None.
  2040.      See also:      setVertLimitsMouse()
  2041.  
  2042.  *** Function:      setVertLimitsMouse()
  2043.      Syntax:        void setVertLimitsMouse(unsigned min, unsigned max);
  2044.      Purpose:       Set the minimum and maximum vertical coordinates for
  2045.                     the pointer.
  2046.      Parameters:    The minimum vertical coordinate will be set to 'min',
  2047.                     and the maximum to 'max'.
  2048.      Return value:  None.
  2049.      Remarks:       None.
  2050.      See also:      setHorizLimitsMouse()
  2051.  
  2052.  *** Function:      setPointerMouse()
  2053.      Syntax:        void setPointerMouse(int xOff, int yOff, void far *p);
  2054.      Purpose:       Set the shape of the pointer.
  2055.      Parameters:    The image pointed to by 'p' will be the pointer bitmap. 
  2056.                     ('xOff','yOff') is the offset, relative to the upper-
  2057.                     left corner of the bitmap, of the "hot spot" -- the
  2058.                     pixel where the pointer is actually registered as
  2059.                     being.  (For instance, the standard arrow pointer has
  2060.                     its hot spot in the upper-left, while a crosshairs
  2061.                     pointer would have it towards the middle.)
  2062.      Return value:  None.
  2063.      Remarks:       The mouse pointer should be hidden when a call to this
  2064.                     function is made.
  2065.      See also:      None.
  2066.  
  2067.  *** Function:      getSaveSizeMouse()
  2068.      Syntax:        unsigned getSaveSizeMouse(void);
  2069.      Purpose:       Return the size of the buffer necessary to store the
  2070.                     state of the mouse driver.
  2071.      Parameters:    None.
  2072.      Return value:  Returns the size of the buffer.
  2073.      Remarks:       If a program using TGE and the new mouse handling
  2074.                     routines is to run another program, for instance
  2075.                     shelling to DOS, the ensuing procedure should be
  2076.                     followed:  call disableNewMouse(), call
  2077.                     getSaveSizeMouse(), allocate a block of memory with the
  2078.                     size returned by getSaveSizeMouse(), call
  2079.                     saveStateMouse(), run the program, call
  2080.                     restoreStateMouse(), free the block of memory, then
  2081.                     call enableNewMouse().
  2082.      See also:      saveStateMouse(), restoreStateMouse()
  2083.  
  2084.  *** Function:      saveStateMouse()
  2085.      Syntax:        void saveStateMouse(void far *buf);
  2086.      Purpose:       Save the current state of the mouse driver.
  2087.      Parameters:    The block of memory pointed to by 'buf' will be used to
  2088.                     store the state data.  Its length should be obtained by
  2089.                     calling getSaveSizeMouse().
  2090.      Return value:  None.
  2091.      Remarks:       If a program using TGE and the new mouse handling
  2092.                     routines is to run another program, for instance
  2093.                     shelling to DOS, the ensuing procedure should be
  2094.                     followed:  call disableNewMouse(), call
  2095.                     getSaveSizeMouse(), allocate a block of memory with the
  2096.                     size returned by getSaveSizeMouse(), call
  2097.                     saveStateMouse(), run the program, call
  2098.                     restoreStateMouse(), free the block of memory, then
  2099.                     call enableNewMouse().
  2100.      See also:      getSaveSizeMouse(), restoreStateMouse()
  2101.  
  2102.  *** Function:      restoreStateMouse()
  2103.      Syntax:        void restoreStateMouse(void far *buf);
  2104.      Purpose:       Restore the state of the mouse driver from a buffer
  2105.                     previously filled by saveStateMouse().
  2106.      Parameters:    The block of memory pointed to by 'buf' stores the
  2107.                     state data.
  2108.      Return value:  None.
  2109.      Remarks:       If a program using TGE and the new mouse handling
  2110.                     routines is to run another program, for instance
  2111.                     shelling to DOS, the ensuing procedure should be
  2112.                     followed:  call disableNewMouse(), call
  2113.                     getSaveSizeMouse(), allocate a block of memory with the
  2114.                     size returned by getSaveSizeMouse(), call
  2115.                     saveStateMouse(), run the program, call
  2116.                     restoreStateMouse(), free the block of memory, then
  2117.                     call enableNewMouse().
  2118.      See also:      getSaveSizeMouse, saveStateMouse
  2119.  
  2120.  *** Function:      setRatioMouse()
  2121.      Syntax:        void setRatioMouse(unsigned horiz, unsigned vert);
  2122.      Purpose:       Set the mouse sensitivity, in units of mickeys per 8
  2123.                     pixels of pointer movement.  (A mickey is the unit used
  2124.                     to measure mouse movement.)
  2125.      Parameters:    The horizontal mickeys to pixels ratio will be set to
  2126.                     'horiz', and the vertical to 'vert'.
  2127.      Return value:  None.
  2128.      Remarks:       None.
  2129.      See also:      getSensitivityMouse()
  2130.  
  2131.  *** Function:      getSensitivityMouse()
  2132.      Syntax:        void getSensitivityMouse(unsigned *horiz, unsigned
  2133.                     *vert, unsigned *doubleSpeed);
  2134.      Purpose:       Get the mouse sensitivity, in units of mickeys per 8
  2135.                     pixels of pointer movement.  (A mickey is the unit used
  2136.                     to measure mouse movement.)  The mouse double speed
  2137.                     threshold (the minimum number of mickeys per second of
  2138.                     motion before pointer movement is doubled) is retrieved
  2139.                     as well.
  2140.      Parameters:    The horizontal mickeys to pixels ratio will be stored
  2141.                     in 'horiz', the vertical in 'vert', and the double
  2142.                     speed threshold in 'doubleSpeed'.
  2143.      Return value:  None.
  2144.      Remarks:       None.
  2145.      See also:      setRatioMouse()
  2146.  
  2147.  *** Function:      softResetMouse()
  2148.      Syntax:        void softResetMouse(void);
  2149.      Purpose:       Reset the mouse driver, but not the hardware.
  2150.      Parameters:    None.
  2151.      Return value:  None.
  2152.      Remarks:       This function is equivalent to resetMouse(), except in
  2153.                     that it performs no initialization of the mouse
  2154.                     hardware.
  2155.      See also:      resetMouse()
  2156.  
  2157.  
  2158.      Note that since these function names are actually macros, they may
  2159.      easily be changed to suit individual preferences by editing
  2160.      TGEMOUSE.H.
  2161.  
  2162.  
  2163.  
  2164. ADDITIONAL FEATURES IN THE REGISTERED VERSION
  2165. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2166.  
  2167.      In addition to technical support and usage rights, registered users
  2168.      may use the registered version of TGE.  Not only does the registered
  2169.      version of TGE include complete source code for the TGE library and an
  2170.      extra font not found in the shareware version, it also includes some
  2171.      features not available in the shareware verion:
  2172.  
  2173.      Registered users can save up to about 22 kb of memory by selectively
  2174.      commenting out #defines in TGE.H and compiling the TGE library.
  2175.      Following is a list of symbols and the features they disable when
  2176.      they're not #defined:
  2177.           TGE_USE_VIRTUAL_SCREENS       Virtual screen support.
  2178.           TGE_USE_OUTPUT_MODES          Output mode support.
  2179.           TGE_USE_REGION_FILLS          fillRegion().
  2180.           TGE_USE_IMAGES                Bitmap-related functions.
  2181.           TGE_USE_ELLIPSES              ellipse- and circle-drawing.
  2182.           TGE_USE_COLOUR_APPROXIMATION  colourCloseTo() and
  2183.                                         colourCloseToX().
  2184.           TGE_USE_LOADGRAPHDRIVER       loadGraphDriver() and
  2185.                                         unloadGraphDriver().
  2186.      The source for the disabled features is simply not compiled, and so
  2187.      does not waste space in the executable or in memory.  Remember to
  2188.      recompile the TGE library after making a change!
  2189.  
  2190.  
  2191.  
  2192. CREATING FONTS
  2193. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2194.  
  2195.      Creating fonts is not easy, but the necessary information is outlined
  2196.      below.
  2197.  
  2198.      For variable-size 256-colour fonts:
  2199.      ──────────────────────────────────
  2200.           First, you should make a working directory for your font's data
  2201.           files.  For the sake of example, I will assume that you are
  2202.           trying to create MYFONT.FNT.
  2203.  
  2204.           Second, draw a bitmap for each of the 256 ASCII characters which
  2205.           you would like to exist in the font; if you won't be using a
  2206.           character, feel free to not bother drawing a bitmap for it.  Each
  2207.           bitmap should be as small as possible, so be sure not to leave
  2208.           any extra space around the character.  Use colour zero as the
  2209.           background colour, or some other colour if you would like the
  2210.           font to have a coloured background.  Save each of these bitmaps
  2211.           as a PCX file in the working directory.  Note that all character
  2212.           bitmaps must use the same colour palette.
  2213.  
  2214.           Third, convert the PCX files to RAW files by using PCX2RAW; to do
  2215.           so, type 'PCX2RAW *'.
  2216.  
  2217.           Fourth, you must rename one of the PAL files produced by PCX2RAW
  2218.           to MYFONT.PAL (remember MYFONT.FNT is the font you're creating).
  2219.           If you wish, you may delete all the other PAL files, so long as
  2220.           you leave MYFONT.PAL intact.
  2221.  
  2222.           Fifth, you must create MYFONT.OFF, the character offset
  2223.           description file.  This text file consists of 256 lines, each
  2224.           containing a single integer (either positive or zero), followed
  2225.           by a newline.  Each line contains its corresponding character's
  2226.           "offset from top" value; the first line is for character 0, the
  2227.           second is for character 1, and so on.  Given the (x,y)
  2228.           coordinates at which to put a character from the font, the
  2229.           "offset from top" is the value to add to the y coordinate before
  2230.           putImageInv() is called to display the character's bitmap.  The
  2231.           "offset from top" is used to make character bitmaps be written
  2232.           lower down on the screen than other bitmaps; for instance, the
  2233.           period character's offset would be greater than an asterisk's
  2234.           offset, because a period is lower down than an asterisk.
  2235.  
  2236.           Finally, you must create the font file MYFONT.FNT; to do so, type
  2237.           'MAKEFONT myfont'.
  2238.  
  2239.  
  2240.      For fixed-size monochrome fonts:
  2241.      ───────────────────────────────
  2242.           TGE's font definition files must have a certain format which will
  2243.           be outlined below.  (Note that a fixed font consists of 256
  2244.           monochrome characters, each with the same dimensions.)
  2245.  
  2246.           The font file header consists of three fields of defined length.
  2247.           The first of these fields is the eight-byte font definition file
  2248.           signature string, which must be "TGEFONT1", without quotes or
  2249.           terminating null character.  The next field is a two-byte
  2250.           unsigned integer which holds the width of a character in pixels.
  2251.           The last field is also a two-byte integer, holding the height of
  2252.           a character in pixels.
  2253.  
  2254.           The remainder of the file consists of font data.  (If you have
  2255.           done advanced text programming before, you may recognize this
  2256.           data organization as the format used by the video BIOS.)  The
  2257.           characters are stored starting at character 0, all the way up to
  2258.           255.  Each of the characters is stored starting with the
  2259.           uppermost row, all the way down to the bottom row.  Each row is
  2260.           stored left to right, with the leftmost pixel in the most
  2261.           significant bit of the first byte in the row, and the rightmost
  2262.           pixel in the least significant bit of the last byte in the row.
  2263.           A 1 bit represents a foreground pixel, while a 0 bit represents a
  2264.           background pixel.  Note that, at present, font row widths must be
  2265.           evenly divisible by 8; pad with 0 bits if necessary.
  2266.  
  2267.           Image data for all 256 of the ASCII characters must be present in
  2268.           the file; if you won't be needing some of them, feel free to
  2269.           store zero bytes (or random bytes, if you're imaginative) as
  2270.           their image data.
  2271.  
  2272.  
  2273.  
  2274. USING PCX2RAW AND GRAPHICS FILES
  2275. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2276.  
  2277.      The PCX2RAW utility provides a simple way to convert 256-colour images
  2278.      in PCX format into a format usable by TGE.  It is used like this:
  2279.  
  2280.           pcx2raw filename[.pcx]
  2281.  
  2282.      Given the PCX file FILENAME.PCX, PCX2RAW will create two new files in
  2283.      the same directory as FILENAME.PCX:  FILENAME.PAL which contains the
  2284.      colour palette from FILENAME.PCX, and FILENAME.RAW which is a TGE
  2285.      format bitmap of the image in FILENAME.PCX.  Following is a discussion
  2286.      of the PAL and RAW file formats, and how to use TGE's functions to
  2287.      access them.
  2288.  
  2289.  
  2290.      The PAL file is organized like this:
  2291.  
  2292.          Element size    Element description
  2293.          ------------    -------------------
  2294.            3 bytes           colour 0
  2295.            3 bytes           colour 1
  2296.                         .
  2297.                         .
  2298.                         .
  2299.            3 bytes           colour 254
  2300.            3 bytes           colour 255
  2301.  
  2302.      Each 3-byte element consists of the red, green, and blue colour
  2303.      components, in that order.  Each of these components is an unsigned
  2304.      char.  Code to load a PAL file is included in RAWFILE.C; the function
  2305.      description follows:
  2306.  
  2307.  *** Function:      loadPalFile()
  2308.      Syntax:        void far *loadPalFile(char *filename, void far *addr);
  2309.      Purpose:       Load a 768-byte palette file into memory.
  2310.      Parameters:    The palette data file 'filename' will be loaded into
  2311.                     the memory block at 'addr' (if 'addr' != NULL), or into
  2312.                     a newly allocated memory block (if 'addr' == NULL).
  2313.      Return value:  Returns the address of the loaded palette on success,
  2314.                     or NULL on error.
  2315.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2316.                     memory block when the palette information is no longer
  2317.                     needed.
  2318.      See also:      loadPcxFilePal(), loadRawFile(), displayRawFile(),
  2319.                     loadPcxFile(), displayPcxFile()
  2320.  
  2321.  
  2322.      The RAW file is organized in exactly the same way as the bitmaps used
  2323.      by putImage() and its associated functions:  2 bytes for the image
  2324.      width, then 2 bytes for the image height, then width*height bytes (one
  2325.      per pixel) for the image information itself; the pixels are in order
  2326.      from left to right and from top to bottom, as one would read a book.
  2327.      The image dimension fields are both unsigned shorts, and are measured
  2328.      in pixels.  Code to load a RAW file is included in RAWFILE.C; the
  2329.      function descriptions follow:
  2330.  
  2331.  *** Function:      loadRawFile()
  2332.      Syntax:        void far *loadRawFile(char *filename);
  2333.      Purpose:       Load a RAW image file into memory.
  2334.      Parameters:    The RAW image file 'filename' will be loaded into a
  2335.                     newly allocated memory block.
  2336.      Return value:  Returns the address of the loaded image on success, or
  2337.                     NULL on error.
  2338.      Remarks:       Be sure to free() the allocated memory block when the
  2339.                     image information is no longer needed.
  2340.      See also:      displayRawFile(), loadPcxFile(), displayPcxFile(),
  2341.                     loadPalFile(), loadPcxFilePal()
  2342.  
  2343.  *** Function:      displayRawFile()
  2344.      Syntax:        int displayRawFile(int x, int y, char *filename);
  2345.      Purpose:       Display a RAW image file.
  2346.      Parameters:    The RAW image file 'filename' will be displayed with
  2347.                     its upper-left corner at ('x','y').  Clipping is
  2348.                     performed.
  2349.      Return value:  Returns the 1 on success, or 0 on error.
  2350.      Remarks:       Since this function uses standard TGE output routines,
  2351.                     it can display to virtual screens as well as the real
  2352.                     screen.
  2353.      See also:      loadRawFile(), displayPcxFile(), loadPcxFile(),
  2354.                     loadPalFile(), loadPcxFilePal()
  2355.  
  2356.  
  2357.      TGE also includes routines to deal directly with PCX files:
  2358.  
  2359.  *** Function:      loadPcxFilePal()
  2360.      Syntax:        void far *loadPcxFilePal(char *filename, void far *addr);
  2361.      Purpose:       Load a 768-byte palette from a PCX file into memory.
  2362.      Parameters:    The palette data 'filename' will be loaded into the
  2363.                     memory block at 'addr' (if 'addr' != NULL), or into a
  2364.                     newly allocated memory block (if 'addr' == NULL).
  2365.      Return value:  Returns the address of the loaded palette on success,
  2366.                     or NULL on error.
  2367.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2368.                     memory block when the palette information is no longer
  2369.                     needed.
  2370.      See also:      loadPalFile(), loadPcxFile(), displayPcxFile(),
  2371.                     loadRawFile(), displayRawFile()
  2372.  
  2373.  *** Function:      loadPcxFile()
  2374.      Syntax:        void far *loadPalFile(char *filename, void *palette);
  2375.      Purpose:       Load a PCX image file, and its palette if requested,
  2376.                     into memory.
  2377.      Parameters:    The PCX image file 'filename' will be loaded into a
  2378.                     newly allocated memory block.  If 'palette' is
  2379.                     non-NULL, the 768 bytes of palette data from the PCX
  2380.                     file will be loaded into the memory area at 'palette'.
  2381.      Return value:  Returns the address of the loaded image on success, or
  2382.                     NULL on error.  If 'palette' was non-NULL, a copy of
  2383.                     the palette will be at the memory area pointed to by
  2384.                     'palette' on return.
  2385.      Remarks:       Be sure to free() the allocated memory block when the
  2386.                     image information is no longer needed.
  2387.      See also:      displayPcxFile(), loadPcxFilePal(), loadRawFile(),
  2388.                     displayRawFile(), loadPalFile()
  2389.  
  2390.  *** Function:      displayPcxFile()
  2391.      Syntax:        int displayPcxFile(int x, int y, char *filename);
  2392.      Purpose:       Display a PCX image file.
  2393.      Parameters:    The PCX image file 'filename' will be displayed with
  2394.                     its upper-left corner at ('x','y').  Clipping is
  2395.                     performed.
  2396.      Return value:  Returns the 1 on success, or 0 on error.
  2397.      Remarks:            Since this function uses standard TGE output
  2398.                     routines, it can display to virtual screens as well as
  2399.                     the real screen.
  2400.                          The image is displayed using the current palette,
  2401.                     which is not necessarily the same as that of the PCX
  2402.                     file.
  2403.      See also:      loadPcxFile(), displayRawFile(), loadRawFile()
  2404.  
  2405.  
  2406.  
  2407. CONTACTING THE AUTHOR
  2408. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2409.  
  2410.      I would appreciate hearing any questions, comments, bug reports, or
  2411.      suggestions for improvement.  If you have any, feel free to contact
  2412.      me; I can be reached via any of the methods below.  When reporting
  2413.      bugs, please be sure to mention the version of TGE to which you are
  2414.      referring; also, if possible, please include detailed descriptions of
  2415.      the problem and of your video hardware configuration.  If you have a
  2416.      video card which is not directly supported by TGE, I would appreciate
  2417.      it if you would send me programming information about your card and/or
  2418.      code to deal with it.
  2419.  
  2420.           Snail mail:      Matthew Hildebrand
  2421.                            4 College St.
  2422.                            St. Catharines, ON
  2423.                            Canada
  2424.                            L2R 2W7
  2425.  
  2426.           Fidonet mail:    1:247/128.2
  2427.                Please do not post personal messages to me in any of the
  2428.                Fidonet echos, such as C_ECHO or C_PLUSPLUS; such messages
  2429.                are off-topic and liable to annoy the moderator and other
  2430.                echo participants.  Use netmail instead.  If I find any such
  2431.                personal messages in Fidonet programming echos, I reply by
  2432.                netmail only.  If the matter being discussed would be of
  2433.                interest to other echo participants, I will reply in that
  2434.                echo.
  2435.  
  2436.           Internet mail:   Matthew.Hildebrand@p2.f128.n247.z1.fidonet.org
  2437.                Internet-Fidonet mail routing sometimes goes awry; if you
  2438.                don't get a reply from me after a reasonable amount of time,
  2439.                send the message again.  If you still don't receive a reply,
  2440.                either persist until you do or contact me via a different
  2441.                method.
  2442.  
  2443.           BBS:             (905)-935-6628
  2444.                I am not the sysop of idiot savant BBS, but I will receive
  2445.                messages left there for me.  The BBS runs a 14400 bps
  2446.                V.32bis modem.
  2447.  
  2448.           Telephone:       (905)-687-8736
  2449.                You may have to try a few times to reach me, as I'm in and
  2450.                out quite a bit.  Please keep in mind the time zone
  2451.                difference, if any, when calling; I'm in Eastern Standard
  2452.                Time.
  2453.  
  2454.  
  2455.  
  2456. OBTAINING THE NEWEST VERSION OF TGE
  2457. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2458.  
  2459.      The most recent distributed copy of TGE is available via first-call
  2460.      download from (905)-935-6628 (14400 bps V.32bis), or via file request
  2461.      from Fidonet node 1:247/128 (14400 bps V.32bis) using the magic file
  2462.      name "TGE"; unlisted nodes and points are welcome.  TGE is also
  2463.      distributed through the Fidonet file echo PDNCEE.
  2464.  
  2465.      If, after you have registered, you are interested in receiving new
  2466.      versions of TGE as they are released, an easy method is now available.
  2467.      For $3 per mailing (to cover the disk, envelope, and postage), I will
  2468.      mail copies of new versions as they are released, on either a 3.5" or
  2469.      a 5.25" disk.  The $3 per mailing may be included with the initial
  2470.      registration fee, with instructions to mail newer versions as they are
  2471.      released, or mailed later with a request for a copy of the newest
  2472.      version.  Please ensure that the $3 is paid in either US or Canadian
  2473.      funds; payment by cash, money order (use an international money order
  2474.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2475.  
  2476.      Alternatively, it is possible to receive notifications of updates but
  2477.      not the updates themselves.  For $1 per mailing (to cover the envelope
  2478.      and postage), I will mail notifications of new versions when they are
  2479.      released.  The $1 per mailing may be included with the initial
  2480.      registration fee, with instructions to mail notifications as new
  2481.      versions are released, or mailed later with similar instructions.
  2482.      Again, please ensure that the $1 is paid in either US or Canadian
  2483.      funds; payment by cash, money order (use an international money order
  2484.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2485.  
  2486.  
  2487.  
  2488. KNOWN PROBLEMS USING TGE
  2489. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2490.  
  2491.      At present, the following problems may be experienced when using TGE:
  2492.  
  2493.           1.   (Registered users only.)  When TGEFUNCS.C is compiled by
  2494.                Turbo C++ 3.0, putImage() and putImageInv() do not work
  2495.                correctly. When informed of this bug, I stepped through the
  2496.                offending code at the assembly level, and discovered that
  2497.                this problem is caused by a bug in TC++, not TGE.  The
  2498.                miscompiled lines of TGE.C are perfectly legal C statements;
  2499.                when TGE.C is compiled by my compiler (Borland C++ 2.0), TGE
  2500.                works beautifully.  Using one of the TGE library files
  2501.                included in the TGE package, rather than OBJ files compiled
  2502.                by Turbo C++ 3.0, should solve the problem.
  2503.           2.   A very small number of users may experience an odd pattern
  2504.                of blue lines when TGE is run in an SVGA mode on some older
  2505.                ATI cards.  I have been informed that this problem is caused
  2506.                by a bug in the video card itself.  ATI has confirmed the
  2507.                presence of this bug, and has implemented a software patch
  2508.                in its Windows 3.1 SVGA driver, but ATI has not released
  2509.                information on how this bug was squashed.
  2510.  
  2511.  
  2512.  
  2513. ACKNOWLEDGEMENT
  2514. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2515.  
  2516.      There are many people whom I would like to thank for their
  2517.      suggestions, beta-testing, patience, registrations, and help with
  2518.      distribution.  You know who you are.
  2519.  
  2520.  
  2521.  
  2522. LEGAL STUFF
  2523. ▀▀▀▀▀▀▀▀▀▀▀
  2524.  
  2525.      The Graphics Engine and its documentation are Copyright (c) 1993-1994
  2526.      by Matthew Hildebrand.
  2527.  
  2528.      All software and documentation associated with The Graphics Engine is
  2529.      provided "as is":  ie., it is provided without warranty of any kind,
  2530.      not even an implied warranty of merchantability or fitness for any
  2531.      purpose.  The Author (Matthew Hildebrand) disclaims all warranties,
  2532.      both express and implied, including but not limited to warranties
  2533.      regarding The Graphics Engine's merchantability or fitness for any
  2534.      particular purpose.
  2535.  
  2536.      The author may not be held liable for any damage or misfortune related
  2537.      to the use of this software.  Any usage of any or all of The Graphics
  2538.      Engine is done entirely at the user's risk.
  2539.  
  2540.      All registered trademarks in this document belong to their respective
  2541.      owners.
  2542.  
  2543.  
  2544.  
  2545. End of document.
  2546.