home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / manuals.arj / USER01.DOC < prev    next >
Text File  |  1995-02-06  |  77KB  |  1,587 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. Fastgraph (tm)
  18.  
  19.  
  20.  
  21.  
  22.  
  23. User's Guide                                                                   
  24. Copyright (c) 1991-1995 by Ted Gruber Software, Inc.
  25.  
  26. All rights reserved. No part of this publication may be reproduced, stored in
  27. a retrieval system, or transmitted by any means, electronic, mechanical,
  28. photocopying, recording, or otherwise, without express written permission from
  29. Ted Gruber Software. The software described in this publication is furnished
  30. under a license agreement and may be used or copied only in accordance with
  31. the terms of that agreement.
  32.  
  33. This publication and its associated software are sold without warranties,
  34. either expressed or implied, regarding their merchantability or fitness for
  35. any particular application or purpose. The information in this publication is
  36. subject to change without notice and does not represent a commitment on the
  37. part of Ted Gruber Software. In no event shall Ted Gruber Software be liable
  38. for any loss of profit or any other commercial damage, including but not
  39. limited to special, incidental, consequential, or other damages resulting from
  40. the use of or the inability to use this product, even if Ted Gruber Software
  41. has been notified of the possibility of such damages.
  42.  
  43.  
  44. First Printing, August 1994
  45.  
  46. Fastgraph version 4.0
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. All brand and product names mentioned in this publication are trademarks or
  59. registered trademarks of their respective holders.                             
  60.  
  61.                        T a b l e   o f   C o n t e n t s
  62.  
  63.  
  64. Chapter 1  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .    1
  65.      What is Fastgraph? . . . . . . . . . . . . . . . . . . . . . . . . .    2
  66.      Fastgraph/Light  . . . . . . . . . . . . . . . . . . . . . . . . . .    2
  67.      Prerequisite Knowledge . . . . . . . . . . . . . . . . . . . . . . .    3
  68.      Supported Compilers  . . . . . . . . . . . . . . . . . . . . . . . .    3
  69.      Real Mode, Protected Mode, and DOS Extenders . . . . . . . . . . . .    4
  70.      Memory Models  . . . . . . . . . . . . . . . . . . . . . . . . . . .    5
  71.      Installing Fastgraph . . . . . . . . . . . . . . . . . . . . . . . .    6
  72.      The READ.ME File . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  73.      The WHATS.NEW File . . . . . . . . . . . . . . . . . . . . . . . . .    7
  74.      Fastgraph Naming Conventions . . . . . . . . . . . . . . . . . . . .    7
  75.      Compilation and Linking  . . . . . . . . . . . . . . . . . . . . . .    7
  76.           Borland C++ . . . . . . . . . . . . . . . . . . . . . . . . . .   10
  77.           Borland Pascal  . . . . . . . . . . . . . . . . . . . . . . . .   12
  78.           MetaWare High C/C++ . . . . . . . . . . . . . . . . . . . . . .   13
  79.           Microsoft BASIC Professional Development System . . . . . . . .   14
  80.           Microsoft C/C++ . . . . . . . . . . . . . . . . . . . . . . . .   15
  81.           Microsoft FORTRAN . . . . . . . . . . . . . . . . . . . . . . .   16
  82.           Microsoft FORTRAN PowerStation  . . . . . . . . . . . . . . . .   17
  83.           Microsoft QuickBASIC  . . . . . . . . . . . . . . . . . . . . .   18
  84.           Microsoft QuickC  . . . . . . . . . . . . . . . . . . . . . . .   19
  85.           Microsoft Visual Basic for DOS  . . . . . . . . . . . . . . . .   20
  86.           Microsoft Visual C++  . . . . . . . . . . . . . . . . . . . . .   21
  87.           Microsoft Visual C++ 32-bit Edition . . . . . . . . . . . . . .   22
  88.           Power C . . . . . . . . . . . . . . . . . . . . . . . . . . . .   23
  89.           Turbo C and Turbo C++ . . . . . . . . . . . . . . . . . . . . .   24
  90.           Turbo Pascal  . . . . . . . . . . . . . . . . . . . . . . . . .   25
  91.           WATCOM C/C++  . . . . . . . . . . . . . . . . . . . . . . . . .   26
  92.           WATCOM C32 for DOS  . . . . . . . . . . . . . . . . . . . . . .   26
  93.           Zortech C++ . . . . . . . . . . . . . . . . . . . . . . . . . .   27
  94.      Fastgraph/Light Video Driver . . . . . . . . . . . . . . . . . . . .   28
  95.  
  96. Chapter 2  PC and PS/2 Video Modes  . . . . . . . . . . . . . . . . . . .   29
  97.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   30
  98.      Text Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   31
  99.      Graphics Modes . . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  100.           CGA Graphics Modes  . . . . . . . . . . . . . . . . . . . . . .   33
  101.           Tandy 1000 and PCjr Graphics Modes  . . . . . . . . . . . . . .   34
  102.           Hercules Graphics Modes . . . . . . . . . . . . . . . . . . . .   34
  103.           EGA Graphics Modes  . . . . . . . . . . . . . . . . . . . . . .   35
  104.           VGA and MCGA Graphics Modes . . . . . . . . . . . . . . . . . .   36
  105.           Extended VGA (XVGA) Graphics Modes  . . . . . . . . . . . . . .   37
  106.           SuperVGA (SVGA) Graphics Modes  . . . . . . . . . . . . . . . .   38
  107.  
  108. Chapter 3  Initializing the Video Environment . . . . . . . . . . . . . .   41
  109.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   42
  110.      Establishing a Text Mode . . . . . . . . . . . . . . . . . . . . . .   42
  111.      43-line and 50-line Text Modes . . . . . . . . . . . . . . . . . . .   45
  112.      Establishing a Graphics Mode . . . . . . . . . . . . . . . . . . . .   46
  113.      SuperVGA Graphics Modes  . . . . . . . . . . . . . . . . . . . . . .   50
  114.      Summary of Video Initialization Routines . . . . . . . . . . . . . .   55
  115.  
  116.  
  117.  
  118.                                       iii                                      
  119. Chapter 4  Coordinate Systems . . . . . . . . . . . . . . . . . . . . . .   57
  120.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   58
  121.      Character Space  . . . . . . . . . . . . . . . . . . . . . . . . . .   58
  122.      Screen Space . . . . . . . . . . . . . . . . . . . . . . . . . . . .   59
  123.      Viewports  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   60
  124.      World Space  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   62
  125.      Conversion Routines  . . . . . . . . . . . . . . . . . . . . . . . .   64
  126.      Summary of Coordinate Routines . . . . . . . . . . . . . . . . . . .   64
  127.  
  128. Chapter 5  The Use of Color . . . . . . . . . . . . . . . . . . . . . . .   67
  129.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   68
  130.      Text Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   68
  131.           Color Text Modes  . . . . . . . . . . . . . . . . . . . . . . .   68
  132.           Monochrome Text Mode  . . . . . . . . . . . . . . . . . . . . .   69
  133.      Graphics Modes . . . . . . . . . . . . . . . . . . . . . . . . . . .   70
  134.           CGA Color Modes . . . . . . . . . . . . . . . . . . . . . . . .   70
  135.           CGA Two-Color Mode  . . . . . . . . . . . . . . . . . . . . . .   72
  136.           Tandy and PCjr Modes  . . . . . . . . . . . . . . . . . . . . .   73
  137.           Hercules Mode . . . . . . . . . . . . . . . . . . . . . . . . .   74
  138.           Hercules Low-Resolution Mode  . . . . . . . . . . . . . . . . .   75
  139.           EGA 200-Line Modes  . . . . . . . . . . . . . . . . . . . . . .   76
  140.           EGA Monochrome Mode . . . . . . . . . . . . . . . . . . . . . .   78
  141.           EGA Enhanced Mode . . . . . . . . . . . . . . . . . . . . . . .   79
  142.           VGA and MCGA Two-Color Mode . . . . . . . . . . . . . . . . . .   81
  143.           VGA/SVGA 16-Color Modes . . . . . . . . . . . . . . . . . . . .   83
  144.           256-Color Modes . . . . . . . . . . . . . . . . . . . . . . . .   83
  145.      Using Video DAC Registers in EGA Modes . . . . . . . . . . . . . . .   87
  146.      RGB Color Mapping  . . . . . . . . . . . . . . . . . . . . . . . . .   89
  147.      Defining All Palette Registers . . . . . . . . . . . . . . . . . . .   90
  148.      Virtual Colors . . . . . . . . . . . . . . . . . . . . . . . . . . .   90
  149.      A Multiple-Mode Example  . . . . . . . . . . . . . . . . . . . . . .   92
  150.      Summary of Color-Related Routines  . . . . . . . . . . . . . . . . .   94
  151.  
  152. Chapter 6  Graphics Fundamentals  . . . . . . . . . . . . . . . . . . . .   97
  153.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   98
  154.      Clearing the Screen  . . . . . . . . . . . . . . . . . . . . . . . .   98
  155.      Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   98
  156.      Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   99
  157.      The Graphics Cursor  . . . . . . . . . . . . . . . . . . . . . . . .  100
  158.      Solid Lines  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  101
  159.      Dashed Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . .  103
  160.      Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  104
  161.      Circles and Ellipses . . . . . . . . . . . . . . . . . . . . . . . .  107
  162.      Solid Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . .  109
  163.      Unfilled Rectangles  . . . . . . . . . . . . . . . . . . . . . . . .  110
  164.      Dithered Rectangles  . . . . . . . . . . . . . . . . . . . . . . . .  112
  165.      Region Fill  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  119
  166.      Summary of Fundamental Graphics Routines . . . . . . . . . . . . . .  121
  167.  
  168. Chapter 7  Character Display Routines . . . . . . . . . . . . . . . . . .  125
  169.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  126
  170.      Character Space  . . . . . . . . . . . . . . . . . . . . . . . . . .  126
  171.      Hardware Characters  . . . . . . . . . . . . . . . . . . . . . . . .  127
  172.      Character Height . . . . . . . . . . . . . . . . . . . . . . . . . .  135
  173.      Conversion Routines  . . . . . . . . . . . . . . . . . . . . . . . .  137
  174.      Software Characters  . . . . . . . . . . . . . . . . . . . . . . . .  138
  175.  
  176.  
  177.                                       iv                                       
  178.      Bitmapped Characters . . . . . . . . . . . . . . . . . . . . . . . .  143
  179.      Summary of Character Display Routines  . . . . . . . . . . . . . . .  144
  180.  
  181. Chapter 8  Video Pages and Virtual Buffers  . . . . . . . . . . . . . . .  147
  182.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  148
  183.      Physical Pages and Virtual Pages . . . . . . . . . . . . . . . . . .  148
  184.      Pages With Special Meanings  . . . . . . . . . . . . . . . . . . . .  150
  185.      Some Simple Examples . . . . . . . . . . . . . . . . . . . . . . . .  150
  186.      Text Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . .  157
  187.      Obtaining Video Page Information . . . . . . . . . . . . . . . . . .  158
  188.      Considerations for Virtual Pages . . . . . . . . . . . . . . . . . .  159
  189.      Considerations for SuperVGA Pages  . . . . . . . . . . . . . . . . .  160
  190.      Logical Pages  . . . . . . . . . . . . . . . . . . . . . . . . . . .  161
  191.      Extended Video Pages . . . . . . . . . . . . . . . . . . . . . . . .  163
  192.      Video Page Resizing  . . . . . . . . . . . . . . . . . . . . . . . .  166
  193.      Preserving Video Page Contents Across Mode Switches  . . . . . . . .  167
  194.      Controlling Page Allocation  . . . . . . . . . . . . . . . . . . . .  169
  195.      Virtual Buffers  . . . . . . . . . . . . . . . . . . . . . . . . . .  171
  196.      Summary of Video Page and Virtual Buffer Routines  . . . . . . . . .  180
  197.  
  198. Chapter 9  Image Files  . . . . . . . . . . . . . . . . . . . . . . . . .  183
  199.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  184
  200.      PCX Files  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  184
  201.      GIF Files  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  189
  202.      FLI and FLC files  . . . . . . . . . . . . . . . . . . . . . . . . .  192
  203.      Pixel Run Files  . . . . . . . . . . . . . . . . . . . . . . . . . .  196
  204.      Display Patterns . . . . . . . . . . . . . . . . . . . . . . . . . .  200
  205.      Controlling the Image Buffer Size  . . . . . . . . . . . . . . . . .  206
  206.      Summary of Image File Routines . . . . . . . . . . . . . . . . . . .  208
  207.  
  208. Chapter 10  Bitmapped Images  . . . . . . . . . . . . . . . . . . . . . .  211
  209.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  212
  210.      Mode-Independent Bitmapped Images  . . . . . . . . . . . . . . . . .  212
  211.      Mode-Specific Bitmapped Images . . . . . . . . . . . . . . . . . . .  217
  212.           Regular Images  . . . . . . . . . . . . . . . . . . . . . . . .  217
  213.           Clipped Images  . . . . . . . . . . . . . . . . . . . . . . . .  225
  214.           Reversed Images . . . . . . . . . . . . . . . . . . . . . . . .  225
  215.           Reversed Clipped Images . . . . . . . . . . . . . . . . . . . .  226
  216.           Images Without Transparent Pixels . . . . . . . . . . . . . . .  226
  217.           Some Examples . . . . . . . . . . . . . . . . . . . . . . . . .  226
  218.      Retrieving Images  . . . . . . . . . . . . . . . . . . . . . . . . .  229
  219.      Inverting Bitmaps  . . . . . . . . . . . . . . . . . . . . . . . . .  234
  220.      Converting Mode-Specific Bitmaps . . . . . . . . . . . . . . . . . .  236
  221.      Bitmap Scaling and Shearing  . . . . . . . . . . . . . . . . . . . .  239
  222.      Pixel Run Maps . . . . . . . . . . . . . . . . . . . . . . . . . . .  244
  223.      Masking Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . .  248
  224.      Summary of Bitmapped Image Display Routines  . . . . . . . . . . . .  251
  225.  
  226. Chapter 11  Block Transfer Routines . . . . . . . . . . . . . . . . . . .  255
  227.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  256
  228.      Full Page Transfer . . . . . . . . . . . . . . . . . . . . . . . . .  256
  229.      Byte Boundaries  . . . . . . . . . . . . . . . . . . . . . . . . . .  257
  230.      Dual SVGA Banks  . . . . . . . . . . . . . . . . . . . . . . . . . .  259
  231.      The "Hidden" Video Page  . . . . . . . . . . . . . . . . . . . . . .  259
  232.      Saving and Restoring Blocks  . . . . . . . . . . . . . . . . . . . .  259
  233.      A More General Block Transfer Routine  . . . . . . . . . . . . . . .  262
  234.  
  235.  
  236.                                        v                                       
  237.      Block Transfer Routines for Virtual Buffers  . . . . . . . . . . . .  266
  238.      Blocks with Transparent Colors . . . . . . . . . . . . . . . . . . .  267
  239.      Transparent Block Transfers for Virtual Buffers  . . . . . . . . . .  269
  240.      Transferring Blocks to and from Conventional Memory  . . . . . . . .  270
  241.      Summary of Block Transfer Routines . . . . . . . . . . . . . . . . .  271
  242.  
  243. Chapter 12  Animation Techniques  . . . . . . . . . . . . . . . . . . . .  273
  244.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  274
  245.      Simple Animation . . . . . . . . . . . . . . . . . . . . . . . . . .  274
  246.      XOR Animation  . . . . . . . . . . . . . . . . . . . . . . . . . . .  276
  247.      Static Frame Animation . . . . . . . . . . . . . . . . . . . . . . .  278
  248.      Dynamic Frame Animation  . . . . . . . . . . . . . . . . . . . . . .  280
  249.      Page Flipping  . . . . . . . . . . . . . . . . . . . . . . . . . . .  282
  250.      An Animation Example: The Fastgraph Fish Tank  . . . . . . . . . . .  284
  251.      Summary of Animation Techniques  . . . . . . . . . . . . . . . . . .  284
  252.  
  253. Chapter 13  Special Effects . . . . . . . . . . . . . . . . . . . . . . .  287
  254.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  288
  255.      Screen Dissolving  . . . . . . . . . . . . . . . . . . . . . . . . .  288
  256.      Scrolling  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  290
  257.      Changing the Screen Origin . . . . . . . . . . . . . . . . . . . . .  293
  258.      Panning With Virtual Buffers . . . . . . . . . . . . . . . . . . . .  296
  259.      Split Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . .  298
  260.      Summary of Special Effects Routines  . . . . . . . . . . . . . . . .  300
  261.  
  262. Chapter 14  Input Device Support  . . . . . . . . . . . . . . . . . . . .  301
  263.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  302
  264.      Keyboard Support . . . . . . . . . . . . . . . . . . . . . . . . . .  302
  265.           Reading Keystrokes  . . . . . . . . . . . . . . . . . . . . . .  304
  266.           Testing and Setting Key States  . . . . . . . . . . . . . . . .  305
  267.           Low-Level Keyboard Handler  . . . . . . . . . . . . . . . . . .  307
  268.      Mouse Support  . . . . . . . . . . . . . . . . . . . . . . . . . . .  309
  269.           Initializing the Mouse  . . . . . . . . . . . . . . . . . . . .  309
  270.           XVGA and SVGA Mouse Considerations  . . . . . . . . . . . . . .  310
  271.           Controlling the Mouse Cursor  . . . . . . . . . . . . . . . . .  311
  272.           Reporting the Mouse Status  . . . . . . . . . . . . . . . . . .  313
  273.           Defining the Mouse Cursor . . . . . . . . . . . . . . . . . . .  315
  274.      Joystick Support . . . . . . . . . . . . . . . . . . . . . . . . . .  323
  275.           Initializing Joysticks  . . . . . . . . . . . . . . . . . . . .  323
  276.           Reporting Joystick Status . . . . . . . . . . . . . . . . . . .  324
  277.           Keyboard Emulation  . . . . . . . . . . . . . . . . . . . . . .  325
  278.           Special Joystick Considerations . . . . . . . . . . . . . . . .  326
  279.      Summary of Input Routines  . . . . . . . . . . . . . . . . . . . . .  326
  280.  
  281. Chapter 15  Sound Effects . . . . . . . . . . . . . . . . . . . . . . . .  329
  282.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  330
  283.      Sound Sources  . . . . . . . . . . . . . . . . . . . . . . . . . . .  330
  284.      Synchronous Sound  . . . . . . . . . . . . . . . . . . . . . . . . .  330
  285.      Asynchronous Sound . . . . . . . . . . . . . . . . . . . . . . . . .  335
  286.      Summary of Sound Routines  . . . . . . . . . . . . . . . . . . . . .  340
  287.  
  288. Chapter 16  Program Timing  . . . . . . . . . . . . . . . . . . . . . . .  343
  289.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  344
  290.      Real-Time Routines . . . . . . . . . . . . . . . . . . . . . . . . .  344
  291.      Routines Dependent on the System Speed . . . . . . . . . . . . . . .  345
  292.      Summary of Timing Routines . . . . . . . . . . . . . . . . . . . . .  347
  293.  
  294.  
  295.                                       vi                                       
  296.  
  297. Chapter 17  Miscellaneous Routines  . . . . . . . . . . . . . . . . . . .  349
  298.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  350
  299.      Determining Available Memory . . . . . . . . . . . . . . . . . . . .  350
  300.      Choosing the Video Memory Update Function  . . . . . . . . . . . . .  351
  301.      Controlling Vertical Retrace Synchronization . . . . . . . . . . . .  352
  302.      External SVGA Bank Switching . . . . . . . . . . . . . . . . . . . .  353
  303.      Saving and Restoring the Video State . . . . . . . . . . . . . . . .  353
  304.      Summary of Miscellaneous Routines  . . . . . . . . . . . . . . . . .  354
  305.  
  306. Appendix A  Fastgraph Utilities . . . . . . . . . . . . . . . . . . . . .  355
  307.      Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  356
  308.      SNAPSHOT Utility . . . . . . . . . . . . . . . . . . . . . . . . . .  356
  309.      CLIP Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . .  357
  310.      CONVERT Utility  . . . . . . . . . . . . . . . . . . . . . . . . . .  358
  311.      EDITSPR Utility  . . . . . . . . . . . . . . . . . . . . . . . . . .  359
  312.      GrabRGB Utility  . . . . . . . . . . . . . . . . . . . . . . . . . .  359
  313.      HERCFIX Utility  . . . . . . . . . . . . . . . . . . . . . . . . . .  360
  314.      PCXHEAD Utility  . . . . . . . . . . . . . . . . . . . . . . . . . .  361
  315.  
  316. Appendix B  Using Fastgraph from Assembly Language  . . . . . . . . . . .  363
  317.  
  318. Appendix C  Interrupts and Fastgraph  . . . . . . . . . . . . . . . . . .  367
  319.      Interrupts Used by Fastgraph . . . . . . . . . . . . . . . . . . . .  368
  320.      Extending the Time-of-Day Interrupt  . . . . . . . . . . . . . . . .  368
  321.  
  322. Appendix D  Contents of the Compiler-Specific Libraries . . . . . . . . .  373
  323.  
  324. Appendix E  Contents of the Pascal Unit Files . . . . . . . . . . . . . .  375
  325.  
  326. Appendix F  Integrating Fastgraph With Other Graphics Software  . . . . .  379
  327.  
  328. Appendix G  Converting Programs to Protected Mode . . . . . . . . . . . .  381
  329.      Protected Mode Initialization  . . . . . . . . . . . . . . . . . . .  382
  330.      Considerations for Logical Pages . . . . . . . . . . . . . . . . . .  382
  331.      Considerations for Virtual Buffers . . . . . . . . . . . . . . . . .  382
  332.      Mouse Cursor Definition  . . . . . . . . . . . . . . . . . . . . . .  382
  333.      FORTRAN Data Types . . . . . . . . . . . . . . . . . . . . . . . . .  383
  334.      Incompatible Real Mode Behavior  . . . . . . . . . . . . . . . . . .  383
  335.  
  336. Appendix H  Image File Header Formats . . . . . . . . . . . . . . . . . .  385
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.                                       vii                                      
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.                                      viii                                      
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419. Chapter 1
  420.  
  421.  
  422.  
  423.  
  424.  
  425. Introduction                                                                   
  426. 2   Fastgraph User's Guide
  427.  
  428.  
  429. What is Fastgraph?
  430.  
  431.      Fastgraph is a library of more than 275 highly-optimized routines that
  432. are callable from high-level and assembly language programs running under the
  433. MS-DOS or PC-DOS operating systems. This collection of routines provides a
  434. programmer with proven, powerful tools to take command of the PC and PS/2
  435. video environment. In addition to its video support, Fastgraph also includes
  436. routines to perform keyboard, mouse, and joystick control, as well as music
  437. and sound capabilities. Fastgraph is an ideal development tool for
  438. entertainment and educational software, presentation graphics products,
  439. scientific and engineering applications, CAD/CAM, animation, or any
  440. application that demands robust graphics.
  441.  
  442.      As its name implies, the most notable feature of Fastgraph is its speed.
  443. Virtually all of Fastgraph is written in assembly language, and each routine
  444. has been optimized by hand to provide maximum performance. Fastgraph's
  445. protected mode libraries take advantage of the features offered by the 80286
  446. and 80386 instruction sets.
  447.  
  448.      Fastgraph supports all the standard text and graphics video modes used by
  449. the IBM PC and compatible systems (PC, PC/XT, and PC/AT, 80386, 80486, and
  450. Pentium) and IBM PS/2 family. In addition, Fastgraph provides support for six
  451. SuperVGA (SVGA) graphics modes, four extended VGA (XVGA) graphics modes, and a
  452. 16-color graphics mode unique to Tandy 1000 series computers and the PCjr.
  453. Even though the graphics mode of the Hercules Graphics Card is not an IBM
  454. standard, its one-time popularity has made it a de facto standard, and for
  455. this reason Fastgraph also supports it. In total, Fastgraph supports 23
  456. graphics modes and 5 text modes. A complete discussion of these video modes
  457. appears in the next chapter.
  458.  
  459.  
  460. Fastgraph/Light
  461.  
  462.      Fastgraph/Light is a subset of Fastgraph. It includes all of Fastgraph's
  463. features except the GIF file support routines, redefinable world space
  464. coordinate system, and the routines pertaining to software characters.
  465. Programs created using Fastgraph/Light are 100% source code compatible with
  466. Fastgraph.
  467.  
  468.      The most important difference between Fastgraph/Light and Fastgraph is
  469. the method of running a program created with the two products. With Fastgraph,
  470. any of its routines used in your program are linked directly into the
  471. resulting EXE file. With Fastgraph/Light, however, this is not the case.
  472. Instead, the Fastgraph/Light routines provide an interface to an external
  473. driver, called the Fastgraph/Light Video Driver, which must be loaded
  474. separately before running programs that call any Fastgraph/Light routines. See
  475. the last section of this chapter for more information.
  476.  
  477.      Another important difference between Fastgraph and Fastgraph/Light is the
  478. name of the library (LIB) files. All Fastgraph libraries begin with the two
  479. characters FG, while the equivalent Fastgraph/Light libraries begin with the
  480. three characters FGL. For example, FGS.LIB is the small model Fastgraph
  481. library used with most C compilers, but FGLS.LIB is the equivalent
  482. Fastgraph/Light library name. Note that the Pascal unit files always begin
  483. with FG, whether you're using Fastgraph or Fastgraph/Light.                    
  484.                                                   Chapter 1:  Introduction   3
  485.  
  486.  
  487.      In the Fastgraph User's Guide and the accompanying Fastgraph Reference
  488. Manual, references to Fastgraph also apply to Fastgraph/Light unless stated
  489. otherwise.
  490.  
  491.  
  492. Prerequisite Knowledge
  493.  
  494.      Fastgraph is a programming tool, which means programmers are its intended
  495. audience. For this reason, the Fastgraph User's Guide and Fastgraph Reference
  496. Manual assume you have a knowledge of programming. Additionally, a knowledge
  497. of converting numbers between binary, decimal, and hexadecimal is assumed.
  498.  
  499.      Virtually all the examples in this manual are written in the C
  500. programming language, so a knowledge of C would be especially helpful. The
  501. examples intentionally avoid using any of C's features and idioms that might
  502. not be readily apparent to a programmer unfamiliar with C. If you're
  503. programming in real mode, don't be confused by the fact that all the examples
  504. call Fastgraph's fg_initpm routine for protected mode initialization -- in
  505. real mode, fg_initpm simply returns to the caller. Finally, we'd like to point
  506. out that the examples should be read not by themselves, but as part of the
  507. surrounding text.
  508.  
  509.  
  510. Supported Compilers
  511.  
  512.      You can use Fastgraph with any compilers or assemblers that use the same
  513. calling and naming conventions as the small, medium, large, or flat memory
  514. models of the supported compilers. Mixed language programming is allowed where
  515. supported by the language translators, linker, and DOS extender being used.
  516. Fastgraph supports the following compilers:
  517.  
  518.      * Borland C++ (version 2.0 or later)
  519.      * Borland Pascal (version 7.0 or later)
  520.      * MetaWare High C/C++ (version 3.0 or later)
  521.      * Microsoft BASIC Professional Development System (version 7.0 or 7.1)
  522.      * Microsoft C/C++ (version 5.1 or later)
  523.      * Microsoft FORTRAN (version 4.0 or later)
  524.      * Microsoft FORTRAN PowerStation (version 1.0 or later)
  525.      * Microsoft QuickBASIC (version 4.0 or later)
  526.      * Microsoft QuickC (version 2.0 or later)
  527.      * Microsoft Visual Basic for DOS (version 1.0 or later)
  528.      * Microsoft Visual C++ (version 1.0 or later)
  529.      * Microsoft Visual C++ 32-bit Edition (version 1.0 or later)
  530.      * Power C (version 2.0 or later)
  531.      * Turbo C (version 2.0 or later)
  532.      * Turbo C++ (version 1.0 or later)
  533.      * Turbo Pascal (version 6.0 or later)
  534.      * WATCOM C/C++ (version 9.5 or later)
  535.      * WATCOM C32 for DOS (version 9.5 or later)
  536.      * Zortech C++ (version 3.0 or later)
  537.  
  538. The listed version numbers are the compiler versions under which Fastgraph was
  539. developed and tested. Fastgraph may or may not work with earlier versions of
  540. these compilers. As we constantly add support for new compilers, please check
  541. the READ.ME file in the \FG directory for possible additions to the above      
  542. 4   Fastgraph User's Guide
  543.  
  544. list. The use of Fastgraph from assembly language programs is addressed in
  545. Appendix B.
  546.  
  547.  
  548. Real Mode, Protected Mode, and DOS Extenders
  549.  
  550.      DOS is inherently a real mode operating system. Real mode is the native
  551. (and only) operating mode of the 8086 and 8088 microprocessors, upon which the
  552. original IBM PC and PC/XT systems were based. While these processors provided
  553. the ability to address one megabyte of memory, IBM reserved the upper 384K of
  554. this one megabyte address space for such things as video memory and the ROM
  555. BIOS. This left a maximum of 640K for DOS applications.
  556.  
  557.      Intel's later microprocessors (80286, 80386, 80486, and Pentium) provide
  558. a second operating mode called protected mode. Perhaps the most important
  559. aspect of protected mode is its ability to use much more memory. When running
  560. in protected mode, the 16-bit 80286 processor has a 16 megabyte
  561. addressability, while the 32-bit 80386 and later processors can address four
  562. gigabytes. Expanded and extended memory services provide limited access to
  563. this larger address space, but a program must run in protected mode if it
  564. wants to treat this memory like conventional DOS memory. Because DOS is a real
  565. mode operating system, DOS applications running on 80286 and later processors
  566. are still restricted to DOS's ubiquitous 640K barrier. In this case, these
  567. systems function merely as faster 8086 or 8088 systems.
  568.  
  569.      When a DOS-compatible protected mode operating system did not appear, DOS
  570. extenders arrived instead. A DOS extender is a product, a "mini-operating
  571. system" if you will, that can run protected mode applications under DOS. The
  572. DOS extender accomplishes this by executing a real mode stub program that
  573. switches the processor to protected mode and passes control to your program.
  574. Your program continues to run in protected mode until it issues a DOS service
  575. such as a file I/O request. The extender then switches back to real mode to
  576. satisfy the request, and upon completion reverts to protected mode. When your
  577. program terminates, the DOS extender switches back to real mode and returns
  578. control to DOS. This is of course an oversimplification of how a DOS extender
  579. works, but these behind the scenes tasks are transparent to your program's end
  580. users. From their perspective, an extended DOS application executes just like
  581. any ordinary DOS application.
  582.  
  583.      DOS extenders come in two flavors: 16-bit and 32-bit. Programs written
  584. for 16-bit DOS extenders require at least an 80286-based system, while those
  585. written for 32-bit extenders require an 80386 or better. Many real mode
  586. compilers can create 16-bit extended DOS applications, but you'll need special
  587. 32-bit compilers to create 32-bit extended DOS applications. Fastgraph
  588. supports the following 16-bit DOS extenders:
  589.  
  590.      * Borland Pascal 7 (built in DPMI extender)
  591.      * Borland PowerPack for DOS
  592.      * Phar Lap 286|Dos-Extender SDK
  593.      * Phar Lap 286|Dos-Extender Lite
  594.      * Rational Systems DOS/16M
  595.  
  596. Fastgraph supports the following 32-bit DOS extenders:
  597.  
  598.      * Borland PowerPack for DOS
  599.      * DOSXMSF (supplied with Microsoft FORTRAN PowerStation)                  
  600.                                                   Chapter 1:  Introduction   5
  601.  
  602.      * Phar Lap TNT Dos-Extender SDK (formerly 386|Dos-Extender SDK)
  603.      * Phar Lap TNT Dos-Extender Lite
  604.      * Rational Systems DOS/4G
  605.      * Rational Systems DOS/4GW (supplied with 32-bit WATCOM compilers)
  606.      * Rational Systems DOS/4GW Professional
  607.  
  608. Please check the READ.ME file in the \FG directory for possible additions to
  609. the above lists.
  610.  
  611.      Note that some DOS extenders require licensing fees or royalty payments
  612. before you can include or bind their components with applications you
  613. distribute. We recommend checking your DOS extender manuals or license
  614. agreement for details, or if you're not sure, contacting the DOS extender
  615. manufacturer directly.
  616.  
  617.  
  618. Memory Models
  619.  
  620.      Fastgraph's supported real mode C, C++, and FORTRAN compilers offer
  621. several memory models. A memory model defines how memory is set up for a
  622. program's code and data segments. Fastgraph includes real mode libraries for
  623. the small, medium, and large memory models and protected mode libraries for
  624. 16-bit and 32-bit environments. The 16-bit protected mode libraries use an
  625. extension of the large memory model, while the 32-bit libraries use a special
  626. flat memory model.
  627.  
  628.      The small memory model allows for one code segment and one data segment.
  629. Programs that use the small model can thus have a maximum of 64K bytes of code
  630. and 64K bytes of data. Because the small model implements call instructions
  631. and data references through near pointers, it produces the most efficient code
  632. of the three supported real mode memory models. The small memory model is
  633. specific to real mode compilers.
  634.  
  635.      The medium memory model allows for multiple code segments and one data
  636. segment. Programs that use the medium model thus have no compiler-imposed
  637. limit to the code size (although no one segment can exceed 64K bytes) and a
  638. maximum of 64K bytes of data. Like the small model, the medium model
  639. implements data references through near pointers, but it implements call
  640. instructions through far pointers. The use of far pointers adds two bytes of
  641. code and 13 clock cycles for each subprogram call. The medium model is a
  642. popular choice for real mode programs and is specific to real mode compilers.
  643.  
  644.      The large memory model supports multiple code and data segments. Programs
  645. that use the large model do not have any compiler-imposed limits for code and
  646. data sizes. However, no single code or data segment can exceed 64K bytes.
  647. Because the large model implements call instructions and data references
  648. through far pointers, it produces the least efficient code of the three
  649. supported memory models. In real mode, the total size of all code and data
  650. segments is limited by the DOS 640K barrier, though in reality the true limit
  651. will be somewhat less depending on the target system's configuration and
  652. resident programs. In 16-bit protected mode, the total size of all code and
  653. data segments can reach 16 megabytes, although no one segment can exceed 64K
  654. bytes.
  655.  
  656.      The flat memory model allows for one code segment and one data segment,
  657. just like the small memory model. The flat model differs in that the segment   
  658. 6   Fastgraph User's Guide
  659.  
  660. sizes can be up to four gigabytes instead of 64K. By default, the flat model
  661. implements call instructions and data references through 32-bit near pointers,
  662. virtually eliminating the need for segments. The flat memory model is specific
  663. to 32-bit protected mode compilers.
  664.  
  665.      For more information about memory models, please refer to the user's
  666. guide or reference manual supplied with your compiler.
  667.  
  668.  
  669. Installing Fastgraph
  670.  
  671.      This section explains how to use the INSTALL program to load Fastgraph
  672. (or Fastgraph/Light) and its related files on a hard disk. The installation
  673. program lets you select the compilers, memory models, and DOS extenders you
  674. wish to use with Fastgraph. It also gives you the opportunity to load many
  675. example Fastgraph programs specific to the compilers you choose.
  676.  
  677.      Before you start the installation, we recommend using the DOS commands
  678. COPY or DISKCOPY to make working copies of the Fastgraph distribution disks
  679. (refer to your DOS reference manual if you are unfamiliar with these
  680. commands). Once you have created the working copies, store the original disks
  681. in a safe place. Install Fastgraph from the working copies you just created.
  682.  
  683.      For simplicity, we'll assume you are installing Fastgraph from the
  684. diskette drive A: to the hard drive C:, but you of course can use any
  685. available drives. The Fastgraph distribution disk labeled Installation and
  686. Utilities contains Fastgraph's INSTALL program. Place this disk in the A:
  687. drive, make A: your current drive, and enter the command INSTALL, as shown
  688. here:
  689.  
  690.                                   C> A:
  691.                                   A> INSTALL
  692.  
  693. From this point, just follow the directions on each screen. At any time, you
  694. can press the Escape key to abort the installation.
  695.  
  696.      The INSTALL program will ask you for the compilers, memory models, and
  697. DOS extenders you'll use with Fastgraph, as well as the directory names for
  698. the Fastgraph utilities, libraries, and include files. For the utilities, the
  699. default directory is C:\FG. For the include files and libraries, we recommend
  700. using directories where the compiler you've chosen normally searches for such
  701. files. INSTALL will automatically try to determine these directories and
  702. propose them as defaults.
  703.  
  704.      You can install support for additional compilers, memory models, or DOS
  705. extenders at any time. If you choose to do this, you should use the command
  706. INSTALL /L to avoid copying the files common to all environments.
  707.  
  708.  
  709. The READ.ME File
  710.  
  711.      The READ.ME file contains additions and changes that may have been made
  712. to Fastgraph since the publication of the manuals. We encourage you to examine
  713. the READ.ME file immediately after installing Fastgraph. READ.ME is an ASCII
  714. text file, suitable for any printer or text editor. The INSTALL program places
  715. the READ.ME file in the Fastgraph utilities directory (C:\FG by default).      
  716.                                                   Chapter 1:  Introduction   7
  717.  
  718.  
  719.  
  720. The WHATS.NEW File
  721.  
  722.      The WHATS.NEW file contains information about new features added in
  723. Fastgraph version 4.0. Programmers who've used earlier versions of Fastgraph
  724. may want to examine the WHATS.NEW file to learn about Fastgraph's new
  725. functionality and possible changes needed when converting applications to
  726. version 4.0. WHATS.NEW is an ASCII text file, suitable for any printer or text
  727. editor. The INSTALL program places the WHATS.NEW file in the Fastgraph
  728. utilities directory (C:\FG by default).
  729.  
  730.  
  731. Fastgraph Naming Conventions
  732.  
  733.      The names of all Fastgraph routines begin with the three characters
  734. "fg_". This prefix helps identify Fastgraph routines within a program, and it
  735. also reduces the chance of name conflicts that might otherwise occur between
  736. Fastgraph and other third party libraries.
  737.  
  738.      Because BASIC does not permit underscores in identifiers, the BASIC
  739. versions of Fastgraph routines begin with the two characters "FG". For
  740. example, the fg_version routine is named FGversion in the BASIC libraries. All
  741. future references to Fastgraph routines in the Fastgraph User's Guide and the
  742. Fastgraph Reference Manual will use the fg_ naming convention instead of the
  743. BASIC names.
  744.  
  745.  
  746. Compilation and Linking
  747.  
  748.      To build an executable (EXE) file for a program that uses Fastgraph
  749. routines, first compile or assemble the program using one of the supported
  750. memory models. This step produces an object file, which you then link with one
  751. or more Fastgraph libraries (or Pascal unit files) and possibly other
  752. libraries to produce an executable file. When creating protected mode
  753. executables, additional binding steps may be needed as described in your
  754. compiler or DOS extender manuals. The Fastgraph libraries or Pascal unit files
  755. must reside in a directory where the linker normally searches for such files.
  756.  
  757.      Example 1-1 uses the Fastgraph routine fg_version to display the version
  758. number for your copy of Fastgraph. It also uses one other Fastgraph routine,
  759. fg_initpm, to set up Fastgraph's protected mode kernel for the selected DOS
  760. extender (when using the real mode Fastgraph libraries, fg_initpm does
  761. nothing). Versions of this program are presented for each high-level language
  762. Fastgraph supports: C/C++, BASIC, FORTRAN, and Pascal. If you loaded the
  763. example programs when you installed Fastgraph, the files \FG\EXAMPLES\01-01.C,
  764. 01-01.BAS, 01-01.FOR, and 01-01.PAS contain the source code for these
  765. examples. You can use them to test the compilation and linking process for the
  766. compilers you'll be using with Fastgraph.
  767.  
  768.                          Example 1-1 (C/C++ version).
  769.  
  770.       #include <fastgraf.h>
  771.       #include <stdio.h>
  772.       void main(void);                                                         
  773. 8   Fastgraph User's Guide
  774.  
  775.       void main()
  776.       {
  777.          int major;
  778.          int minor;
  779.  
  780.          fg_initpm();
  781.          fg_version(&major,&minor);
  782.          printf("This is version %d.%2.2d of Fastgraph.\n",major,minor);
  783.       }
  784.  
  785.  
  786.      The header file FASTGRAF.H contains the C and C++ function prototypes for
  787. each Fastgraph routine. It must reside in a directory where the compiler
  788. normally searches for other header files. When creating 32-bit protected mode
  789. applications, FASTGRAF.H will define the symbol FG32. This symbol is useful
  790. for controlling conditional compilation when creating applications that run in
  791. both 16-bit and 32-bit environments.
  792.  
  793.                          Example 1-1 (BASIC version).
  794.  
  795.           REM $INCLUDE: 'fastgraf.bi'
  796.  
  797.           DEFINT A-Z
  798.  
  799.           FGversion Major, Minor
  800.           Version! = Major + Minor*0.01
  801.  
  802.           PRINT USING "This is version #.## of Fastgraph."; Version!
  803.  
  804.           END
  805.  
  806.  
  807.      You must include the DECLARE commands in the file FASTGRAF.BI at the
  808. beginning of each BASIC module. This file should reside in a directory where
  809. the compiler normally searches for BI files, or in any of the directories
  810. specified by the INCLUDE environment variable. The DECLARE commands in this
  811. file automatically provide the calling convention and naming convention for
  812. each Fastgraph routine. In addition, they relieve the BASIC programmer of
  813. distinguishing arguments passed by value from those passed by reference.
  814.  
  815.                         Example 1-1 (FORTRAN version).
  816.  
  817.       $INCLUDE: '\FG\FASTGRAF.FI'
  818.  
  819.             PROGRAM MAIN
  820.  
  821.             INTEGER MAJOR
  822.             INTEGER MINOR
  823.  
  824.             CALL FG_INITPM
  825.             CALL FG_VERSION (MAJOR, MINOR)
  826.  
  827.             WRITE (6,10) MAJOR, MINOR
  828.       10    FORMAT (' This is version ', I1, '.', I2.2, ' of Fastgraph.')
  829.  
  830.             STOP ' '                                                           
  831.                                                   Chapter 1:  Introduction   9
  832.  
  833.             END
  834.  
  835.  
  836.      You must include the INTERFACE statements in the file FASTGRAF.FI at the
  837. beginning of FORTRAN programs (this file should reside in the \FG directory).
  838. The INTERFACE statements in this file automatically provide the calling
  839. convention and naming convention for each Fastgraph routine. In addition, they
  840. relieve the FORTRAN programmer of distinguishing arguments passed by value
  841. from those passed by reference.
  842.  
  843.                          Example 1-1 (Pascal version).
  844.  
  845.        program main;
  846.        uses fgmain;
  847.  
  848.        var
  849.          Major : integer;
  850.          Minor : integer;
  851.  
  852.        begin
  853.          fg_initpm;
  854.          fg_version(Major,Minor);
  855.          writeln('This is version ',Major,'.',Minor:2,' of Fastgraph.');
  856.        end.
  857.  
  858.  
  859.      Pascal programs that use Fastgraph or Fastgraph/Light must include a uses
  860. statement specifying the names of the unit files (TPU or TPP files) needed in
  861. the program. This list must always include the fgmain unit; for protected mode
  862. programs that call GlobalAllocPtr, GlobalFreePtr, or other functions in
  863. WinAPI, it also must include the WinAPI unit. All unit files must reside in a
  864. directory where the compiler normally searches for such files. Appendix E
  865. lists the Fastgraph functions in each unit.
  866.  
  867.      The following sections show the simplest procedures for compiling a
  868. program and linking it with Fastgraph. Information is presented for each
  869. supported compiler, listed alphabetically by the compiler name. In what
  870. follows, items enclosed in angle brackets, such as <source_file>, are
  871. placeholders for parameters you must supply (the name of a file in this case).
  872. Items enclosed in square brackets, such as [/E], are optional. For simplicity,
  873. we'll only show the Fastgraph library names. If you're using Fastgraph/Light,
  874. the library names will begin with "FGL" instead of "FG". For example, FGS.LIB
  875. is the real mode small model Fastgraph for most C compilers, while FGLS.LIB is
  876. the equivalent library for Fastgraph/Light. Note that Fastgraph/Light does not
  877. support protected mode environments.                                           
  878. 10   Fastgraph User's Guide
  879.  
  880.  
  881. Borland C++
  882.  
  883.      Borland C++ can create real mode, 16-bit protected mode, and 32-bit
  884. protected mode applications (Borland C++ 4.0 or later is required for 32-bit
  885. protected mode). You can compile and link programs directly from the DOS
  886. command line or from the Borland C++ integrated development environment (IDE).
  887. The following Fastgraph libraries are compatible with Borland C++:
  888.  
  889.      FGS.LIB        Real mode small model general library
  890.      FGM.LIB        Real mode medium model general library
  891.      FGL.LIB        Real mode large model general library
  892.      FGTCS.LIB      Real mode small model auxiliary library
  893.      FGTCM.LIB      Real mode medium model auxiliary library
  894.      FGTCL.LIB      Real mode large model auxiliary library
  895.      FG16.LIB       16-bit protected mode general library
  896.      FG16BC.LIB     16-bit protected mode auxiliary library
  897.      FG16DPMI.LIB   16-bit DPMI-compliant DOS extender support library
  898.      FG16PHAR.LIB   Phar Lap 286|Dos-Extender support library
  899.      FG32.LIB       32-bit protected mode general library
  900.      FG32BC.LIB     32-bit protected mode auxiliary library
  901.      FG32DPMI.LIB   32-bit DPMI-compliant DOS extender support library
  902.      FG32PHAR.LIB   Phar Lap TNT|Dos-Extender support library
  903.  
  904.      To build real mode Fastgraph applications in the Borland C++ IDE, the
  905. compiler options must match one of Fastgraph's available memory models (small,
  906. medium, or large). 16-bit protected mode programs must use the large memory
  907. model, while 32-bit protected mode programs must be compiled as console
  908. applications. In any case, you also must create a project file that includes
  909. the name of each C, CPP, and LIB file required by your application (refer to
  910. your Borland C++ manuals for information about project files). For Borland C++
  911. 4.0 and above, the project file also specifies the platform: DOS for real mode
  912. applications, DOS (16-bit DPMI) for 16-bit protected mode applications, or
  913. DOS (32-bit DPMI) for 32-bit protected mode applications. Project files are
  914. only needed when using the IDE.
  915.  
  916.      You can also compile and link programs from the DOS command line using
  917. the BCC or BCC32 commands. Here are example BCC and BCC32 commands for
  918. compiling a Borland C++ program and linking it with Fastgraph. The compiler-
  919. specific auxiliary library names only need to be included when your program
  920. uses any of the Fastgraph routines listed in Appendix D.
  921.  
  922.      Real mode, small memory model:
  923.         BCC -ms <source_file> FGS.LIB [FGTCS.LIB]
  924.  
  925.      Real mode, medium memory model:
  926.         BCC -mm <source_file> FGM.LIB [FGTCM.LIB]
  927.  
  928.      Real mode, large memory model:
  929.         BCC -ml <source_file> FGL.LIB [FGTCL.LIB]
  930.  
  931.      16-bit protected mode, Borland PowerPack DOS extender:
  932.         BCC -ml -WX <source_file> FG16.LIB FG16DPMI.LIB [FG16BC.LIB]
  933.  
  934.      16-bit protected mode, Phar Lap 286|Dos-Extender:
  935.         BCC286 <source_file> FG16.LIB FG16PHAR.LIB [FG16BC.LIB]                
  936.                                                  Chapter 1:  Introduction   11
  937.  
  938.  
  939.      32-bit protected mode, Borland PowerPack DOS extender:
  940.         BCC32 -WX <source_file> FG32.LIB FG32DPMI.LIB [FG32BC.LIB]
  941.  
  942. To create Borland C++ 16-bit protected mode programs using the Rational
  943. Systems DOS/16M extender, please refer to the DOS/16M User's Guide. To create
  944. Borland C++ 32-bit protected mode programs using the Phar Lap
  945. TNT|Dos-Extender, please refer to Phar Lap's C/C++ User's Guide to TNT
  946. Dos-Extender.
  947.  
  948.      For more information about memory models or other compilation and linking
  949. options, please refer to the Borland C++ User's Guide, Borland PowerPack for
  950. DOS User's Guide, Phar Lap's Borland C++ User's Guide to 286 Dos-Extender, or
  951. the DOS/16M User's Guide.                                                      
  952. 12   Fastgraph User's Guide
  953.  
  954.  
  955. Borland Pascal
  956.  
  957.      Borland Pascal can create real mode and 16-bit protected mode
  958. applications. Protected mode applications can be built without a third party
  959. DOS extender, as the necessary protected mode extensions are implemented
  960. through a DOS Protected Mode Interface (DPMI) server and a run-time manager.
  961. You can compile real mode and protected mode programs directly from the DOS
  962. command line or from the Borland Pascal integrated development environment
  963. (IDE).
  964.  
  965.      To build Fastgraph applications in the Borland Pascal IDE, just start the
  966. IDE as you would for any other Pascal program, making sure the Fastgraph unit
  967. files reside in one of the directories listed in the IDE's "Unit Directories"
  968. option. If you're creating a protected mode application from the IDE, choose
  969. Compile|Target and select "Protected-mode Application" from the Target
  970. Platform dialog box.
  971.  
  972.      You can also compile Borland Pascal programs from the DOS command line
  973. using the BPC or TPC commands, as shown here. Real mode programs can use
  974. either BPC or TPC, while protected mode programs must use BPC.
  975.  
  976.      Real mode:
  977.         BPC <source_file>
  978.         TPC <source_file>
  979.  
  980.      16-bit protected mode:
  981.         BPC /CP <source_file>
  982.  
  983.      For more information about other compilation and linking options, please
  984. refer to the Borland Pascal With Objects User's Guide.
  985.  
  986.      All remaining example programs in the Fastgraph User's Guide are written
  987. in the C programming language. However, when you install Fastgraph for Borland
  988. Pascal, the installation procedure copies Pascal versions of the example
  989. programs to the \FG\EXAMPLES directory.                                        
  990.                                                  Chapter 1:  Introduction   13
  991.  
  992.  
  993. MetaWare High C/C++
  994.  
  995.      MetaWare High C/C++ is strictly a 32-bit protected mode compiler. It
  996. supports the Phar Lap TNT|Dos-Extender SDK and the Rational Systems DOS/4G
  997. extender. The following Fastgraph libraries are compatible with MetaWare High
  998. C/C++:
  999.  
  1000.      FG32.LIB       32-bit protected mode general library
  1001.      FG32HC.LIB     32-bit protected mode auxiliary library
  1002.      FG32DPMI.LIB   32-bit DPMI-compliant DOS extender support library
  1003.      FG32PHAR.LIB   Phar Lap TNT|Dos-Extender support library
  1004.  
  1005.      Programs are compiled and linked from the DOS command line using the
  1006. HC386 command. Here are example HC386 commands for compiling a MetaWare High
  1007. C/C++ program and linking it with Fastgraph. The compiler-specific auxiliary
  1008. library (FG32HC) only needs to be included when your program uses any of the
  1009. Fastgraph routines listed in Appendix D.
  1010.  
  1011.      32-bit protected mode, Phar Lap TNT|Dos-Extender:
  1012.         HC386 <source_file> -lFG32 -lFG32PHAR [-lFG32HC] -nomap -onecase
  1013.  
  1014.      32-bit protected mode, Rational Systems DOS/4G extender:
  1015.         HC386 <source_file> -Hdos4g -lFG32 -lFG32DPMI [-lFG32HC]
  1016.  
  1017.      For more information about other compilation and linking options, please
  1018. refer to the MetaWare High C/C++ Programmer's Guide, Phar Lap's C/C++ User's
  1019. Guide to TNT Dos-Extender, or the DOS/4G User's Manual.                        
  1020. 14   Fastgraph User's Guide
  1021.  
  1022.  
  1023. Microsoft BASIC Professional Development System
  1024.  
  1025.      You can compile and link Microsoft BASIC Professional Development System
  1026. (PDS) programs directly from the DOS command line or from the PDS programming
  1027. environment. In either case, BASIC PDS always creates real mode programs. The
  1028. following Fastgraph libraries are compatible with BASIC PDS:
  1029.  
  1030.      FGQBX.LIB      Stand-alone library for BASIC PDS
  1031.      FGQBX.QLB      Quick library for BASIC PDS
  1032.  
  1033.      To build Fastgraph applications in the PDS programming environment, just
  1034. specify the quick library name FGQBX when starting BASIC PDS:
  1035.  
  1036.         QBX /LFGQBX [<source_file>]
  1037.  
  1038. You must use the default "Far Strings" setting within the PDS environment.
  1039. There are no near string Fastgraph libraries available for BASIC PDS.
  1040.  
  1041.      To compile a BASIC PDS program from the DOS command line and link it with
  1042. Fastgraph, use the BC and LINK commands:
  1043.  
  1044.         BC /Fs [/O] <source_file>;
  1045.         LINK [/E] <object_file>,,NUL,FGQBX;
  1046.  
  1047. The /O option on the BC command is recommended because it creates EXE files
  1048. that do not require the BASIC PDS run-time module. The /E linker option is not
  1049. required but will produce a smaller EXE file if specified. For more
  1050. information about other compilation and linking options, please refer to the
  1051. Microsoft BASIC Professional Development System Programmer's Guide.
  1052.  
  1053.      All remaining example programs in the Fastgraph User's Guide are written
  1054. in the C programming language. However, when you install Fastgraph for
  1055. Microsoft BASIC PDS, the installation procedure copies BASIC versions of the
  1056. example programs to the \FG\EXAMPLES directory.                                
  1057.                                                  Chapter 1:  Introduction   15
  1058.  
  1059.  
  1060. Microsoft C/C++
  1061.  
  1062.      Microsoft C/C++ can create real mode and 16-bit protected mode
  1063. applications. For protected mode, it supports the Phar Lap 286|Dos-Extender
  1064. (both SDK and Lite versions) and the Rational Systems DOS/16M extender. The
  1065. following Fastgraph libraries are compatible with Microsoft C/C++:
  1066.  
  1067.      FGS.LIB        Real mode small model general library
  1068.      FGM.LIB        Real mode medium model general library
  1069.      FGL.LIB        Real mode large model general library
  1070.      FGMSCS.LIB     Real mode small model auxiliary library
  1071.      FGMSCM.LIB     Real mode medium model auxiliary library
  1072.      FGMSCL.LIB     Real mode large model auxiliary library
  1073.      FG16.LIB       16-bit protected mode general library
  1074.      FG16MSC.LIB    16-bit protected mode auxiliary library
  1075.      FG16DPMI.LIB   16-bit DPMI-compliant DOS extender support library
  1076.      FG16PHAR.LIB   Phar Lap 286|Dos-Extender support library
  1077.  
  1078.      Programs are compiled and linked from the DOS command line using the CL
  1079. command. Here are example CL commands for compiling a Microsoft C/C++ program
  1080. and linking it with Fastgraph. The compiler-specific auxiliary library names
  1081. only need to be included when your program uses any of the Fastgraph routines
  1082. listed in Appendix D. In the real mode examples, the /E linker option is not
  1083. required but will produce a smaller EXE file if specified.
  1084.  
  1085.      Real mode, small memory model:
  1086.         CL /AS <source_file> /link FGS.LIB [FGMSCS.LIB] [/E]
  1087.  
  1088.      Real mode, medium memory model:
  1089.         CL /AM <source_file> /link FGM.LIB [FGMSCM.LIB] [/E]
  1090.  
  1091.      Real mode, large memory model:
  1092.         CL /AL <source_file> /link FGL.LIB [FGMSCL.LIB] [/E]
  1093.  
  1094.      16-bit protected mode, Phar Lap 286 SDK or Lite extender:
  1095.         CL /AL /Lp <source_file> /link FG16.LIB FG16PHAR.LIB [FG16MSC.LIB]
  1096.  
  1097. To create Microsoft C/C++ protected mode programs using the Rational Systems
  1098. DOS/16M extender, please refer to the DOS/16M User's Guide.
  1099.  
  1100.      For more information about memory models or other compilation and linking
  1101. options, please refer to the Microsoft C Optimizing Compiler User's Guide,
  1102. Phar Lap's Microsoft C & C++ User's Guide to 286|Dos-Extender, or the DOS/16M
  1103. User's Guide.                                                                  
  1104. 16   Fastgraph User's Guide
  1105.  
  1106.  
  1107. Microsoft FORTRAN
  1108.  
  1109.      Microsoft FORTRAN creates real mode applications. The following Fastgraph
  1110. libraries are compatible with Microsoft FORTRAN:
  1111.  
  1112.      FGM.LIB        Real mode medium model general library
  1113.      FGL.LIB        Real mode large model general library
  1114.      FGMSFM.LIB     Real mode medium model auxiliary library
  1115.      FGMSFL.LIB     Real mode large model auxiliary library
  1116.  
  1117.      Programs are compiled and linked from the DOS command line using the FL
  1118. command. Here are example FL commands for compiling a Microsoft FORTRAN
  1119. program and linking it with Fastgraph. The compiler-specific auxiliary library
  1120. names only need to be included when your program uses any of the Fastgraph
  1121. routines listed in Appendix D. The /E linker option is not required but will
  1122. produce a smaller EXE file if specified.
  1123.  
  1124.      Medium memory model:
  1125.         FL /AM /FPi /4I2 /4Nt <source_file> /link FGM.LIB [FGMSFM.LIB] [/E]
  1126.  
  1127.      Large memory model:
  1128.         FL /AL /FPi /4I2 /4Nt <source_file> /link FGL.LIB [FGMSFL.LIB] [/E]
  1129.  
  1130.      For more information about memory models or other compilation and linking
  1131. options, please refer to the Microsoft FORTRAN Optimizing Compiler User's
  1132. Guide.
  1133.  
  1134.      All remaining example programs in the Fastgraph User's Guide are written
  1135. in the C programming language. However, when you install Fastgraph for the
  1136. Microsoft FORTRAN compiler, the installation procedure copies FORTRAN versions
  1137. of the example programs to the \FG\EXAMPLES directory.                         
  1138.                                                  Chapter 1:  Introduction   17
  1139.  
  1140.  
  1141. Microsoft FORTRAN PowerStation
  1142.  
  1143.      Microsoft FORTRAN PowerStation is strictly a 32-bit protected mode
  1144. compiler. It supports the DOSXMSF DOS extender included with the compiler and
  1145. the Phar Lap TNT|Dos-Extender SDK (DOSXMSF is a subset of the
  1146. TNT|Dos-Extender). The following Fastgraph library is compatible with
  1147. Microsoft FORTRAN PowerStation:
  1148.  
  1149.      FG32MSF.LIB    32-bit PM library for Microsoft FORTRAN PowerStation
  1150.  
  1151. FG32MSF.LIB includes Fastgraph's Phar Lap support functions normally found in
  1152. the FG32PHAR.LIB library.
  1153.  
  1154.      Programs are compiled and linked from the DOS command line using the FL32
  1155. command:
  1156.  
  1157.         FL32 <source_file> FG32MSF.LIB
  1158.  
  1159. This command invokes the PowerStation compiler and Microsoft Portable
  1160. Executable Linker (LINK32) to create a 32-bit protected mode executable.
  1161.  
  1162.      For more information about other compilation and linking options, please
  1163. refer to the Microsoft FORTRAN PowerStation User's Guide or Phar Lap's FORTRAN
  1164. User's Guide to TNT Dos-Extender.                                              
  1165. 18   Fastgraph User's Guide
  1166.  
  1167.  
  1168. Microsoft QuickBASIC
  1169.  
  1170.      You can compile and link Microsoft QuickBASIC programs directly from the
  1171. DOS command line or from the QuickBASIC programming environment. In either
  1172. case, QuickBASIC always creates real mode programs. The following Fastgraph
  1173. libraries are compatible with QuickBASIC:
  1174.  
  1175.      FGQB.LIB       Stand-alone library for QuickBASIC
  1176.      FGQB.QLB       Quick library for QuickBASIC
  1177.  
  1178.      To build Fastgraph applications in QuickBASIC's programming environment,
  1179. just specify the quick library name FGQB when starting QuickBASIC:
  1180.  
  1181.         QB /LFGQB [<source_file>]
  1182.  
  1183. To compile a QuickBASIC program from the DOS command line and link it with
  1184. Fastgraph, use the BC and LINK commands:
  1185.  
  1186.         BC [/O] <source_file>;
  1187.         LINK [/E] <object_file>,,NUL,FGQB;
  1188.  
  1189. The /O option on the BC command is recommended because it creates EXE files
  1190. that do not require the QuickBASIC run-time module. The /E linker option is
  1191. not required but will produce a smaller EXE file if specified. For more
  1192. information about other compilation and linking options, please refer to the
  1193. Microsoft QuickBASIC: Programming in BASIC manual.
  1194.  
  1195.      All remaining example programs in the Fastgraph User's Guide are written
  1196. in the C programming language. However, when you install Fastgraph for
  1197. Microsoft QuickBASIC, the installation procedure copies BASIC versions of the
  1198. example programs to the \FG\EXAMPLES directory.                                
  1199.                                                  Chapter 1:  Introduction   19
  1200.  
  1201.  
  1202. Microsoft QuickC
  1203.  
  1204.      You can compile and link Microsoft QuickC programs directly from the DOS
  1205. command line or from the QuickC programming environment. In either case,
  1206. QuickC always creates real mode programs. The following Fastgraph libraries
  1207. are compatible with QuickC:
  1208.  
  1209.      FGS.LIB        Real mode small model general library
  1210.      FGM.LIB        Real mode medium model general library
  1211.      FGL.LIB        Real mode large model general library
  1212.      FGMSCS.LIB     Real mode small model auxiliary library
  1213.      FGMSCM.LIB     Real mode medium model auxiliary library
  1214.      FGMSCL.LIB     Real mode large model auxiliary library
  1215.  
  1216.      To build Fastgraph applications in the QuickC programming environment,
  1217. you must make sure the compiler options match one of Fastgraph's available
  1218. memory models (small, medium, or large) and then create a make file that
  1219. includes the corresponding Fastgraph library names.
  1220.  
  1221.      To compile a QuickC program from the DOS command line and link it with
  1222. Fastgraph, use the QCL command. Here are example QCL commands for compiling a
  1223. QuickC program and linking it with Fastgraph. The compiler-specific auxiliary
  1224. library names only need to be included when your program uses any of the
  1225. Fastgraph routines listed in Appendix D. The /E linker option is not required
  1226. but will produce a smaller EXE file if specified.
  1227.  
  1228.      Small memory model:
  1229.         QCL /AS <source_file> /link FGS.LIB [FGMSCS.LIB] [/E]
  1230.  
  1231.      Medium memory model:
  1232.         QCL /AM <source_file> /link FGM.LIB [FGMSCM.LIB] [/E]
  1233.  
  1234.      Large memory model:
  1235.         QCL /AL <source_file> /link FGL.LIB [FGMSCL.LIB] [/E]
  1236.  
  1237.      For more information about make files, memory models, or other
  1238. compilation and linking options, please refer to the Microsoft QuickC Tool Kit
  1239. manual.                                                                        
  1240. 20   Fastgraph User's Guide
  1241.  
  1242.  
  1243. Microsoft Visual Basic for DOS
  1244.  
  1245.      You can compile and link Microsoft Visual Basic for DOS programs directly
  1246. from the DOS command line or from the Visual Basic programming environment. In
  1247. either case, Visual Basic always creates real mode programs. The following
  1248. Fastgraph libraries are compatible with Visual Basic:
  1249.  
  1250.      FGVBDOS.LIB    Stand-alone library for Visual Basic
  1251.      FGVBDOS.QLB    Quick library for Visual Basic
  1252.  
  1253.      To build Fastgraph applications in Visual Basic's programming
  1254. environment, just specify the quick library name FGVBDOS when starting Visual
  1255. Basic:
  1256.  
  1257.         VBDOS /LFGVBDOS [<source_file>]
  1258.  
  1259. When using the programming environment, you may get an "Out of Memory" or "Out
  1260. of String Space" error message when trying to build an EXE file or run an
  1261. application within the environment. Should this occur, you must specify the /S
  1262. option on the VBDOS command line to increase the amount of memory available to
  1263. your application. If you have EMS or XMS memory installed on your system, it's
  1264. also useful to specify the /E or /X options to make portions of the
  1265. programming environment resident in EMS or XMS. For more information about
  1266. these options, refer to Appendix B of the Microsoft Visual Basic Programmer's
  1267. Guide.
  1268.  
  1269.      To compile a Visual Basic program from the DOS command line and link it
  1270. with Fastgraph, use the BC and LINK commands:
  1271.  
  1272.         BC [/O] <source_file>;
  1273.         LINK [/E] <object_file>,,NUL,FGVBDOS;
  1274.  
  1275. The /O option on the BC command is recommended because it creates EXE files
  1276. that do not require the Visual Basic run-time module. The /E linker option is
  1277. not required but will produce a smaller EXE file if specified. For more
  1278. information about other compilation and linking options, please refer to the
  1279. Microsoft Visual Basic Programmer's Guide.
  1280.  
  1281.      When linking Visual Basic for DOS programs that call Fastgraph's world
  1282. space or software character routines (that is, any of the routines listed in
  1283. Appendix D), you may need to increase the number of segments available to the
  1284. linker. Use the /SEG:n option on the LINK command to do this. The default
  1285. value of n is 128 segments; usually a slightly larger value, such as 144, will
  1286. be enough.
  1287.  
  1288.      All remaining example programs in the Fastgraph User's Guide are written
  1289. in the C programming language. However, when you install Fastgraph for Visual
  1290. Basic, the installation procedure copies BASIC versions of the example
  1291. programs to the \FG\EXAMPLES directory.                                        
  1292.                                                  Chapter 1:  Introduction   21
  1293.  
  1294.  
  1295. Microsoft Visual C++
  1296.  
  1297.      Microsoft Visual C++ can create real mode and 16-bit protected mode
  1298. applications. For protected mode, it supports the Phar Lap 286|Dos-Extender
  1299. (both SDK and Lite versions) and the Rational Systems DOS/16M extender. The
  1300. following Fastgraph libraries are compatible with Visual C++:
  1301.  
  1302.      FGS.LIB        Real mode small model general library
  1303.      FGM.LIB        Real mode medium model general library
  1304.      FGL.LIB        Real mode large model general library
  1305.      FGMSCS.LIB     Real mode small model auxiliary library
  1306.      FGMSCM.LIB     Real mode medium model auxiliary library
  1307.      FGMSCL.LIB     Real mode large model auxiliary library
  1308.      FG16.LIB       16-bit protected mode general library
  1309.      FG16MSC.LIB    16-bit protected mode auxiliary library
  1310.      FG16DPMI.LIB   16-bit DPMI-compliant DOS extender support library
  1311.      FG16PHAR.LIB   Phar Lap 286|Dos-Extender support library
  1312.  
  1313.      Programs are compiled and linked from the DOS command line using the CL
  1314. command. Here are example CL commands for compiling a Visual C++ program and
  1315. linking it with Fastgraph. The compiler-specific auxiliary library names only
  1316. need to be included when your program uses any of the Fastgraph routines
  1317. listed in Appendix D. In the real mode examples, the /E linker option is not
  1318. required but will produce a smaller EXE file if specified.
  1319.  
  1320.      Real mode, small memory model:
  1321.         CL /AS <source_file> /link FGS.LIB [FGMSCS.LIB] [/E]
  1322.  
  1323.      Real mode, medium memory model:
  1324.         CL /AM <source_file> /link FGM.LIB [FGMSCM.LIB] [/E]
  1325.  
  1326.      Real mode, large memory model:
  1327.         CL /AL <source_file> /link FGL.LIB [FGMSCL.LIB] [/E]
  1328.  
  1329.      16-bit protected mode, Phar Lap 286 SDK or Lite extender:
  1330.         CL /AL /Lp <source_file> /link FG16.LIB FG16PHAR.LIB [FG16MSC.LIB]
  1331.  
  1332. To create Visual C++ protected mode programs using the Rational Systems
  1333. DOS/16M extender, please refer to the DOS/16M User's Guide.
  1334.  
  1335.      For more information about memory models or other compilation and linking
  1336. options, please refer to the Visual C++ Command-Line Utilities User's Guide,
  1337. Phar Lap's Microsoft C & C++ User's Guide to 286|Dos-Extender, or the DOS/16M
  1338. User's Guide.                                                                  
  1339. 22   Fastgraph User's Guide
  1340.  
  1341.  
  1342. Microsoft Visual C++ 32-bit Edition
  1343.  
  1344.      As its name suggests, Microsoft Visual C++ 32-bit Edition is strictly a
  1345. 32-bit protected mode compiler. It supports the Phar Lap TNT|Dos-Extender SDK
  1346. and the Phar Lap TNT|Dos-Extender Lite. The following Fastgraph library is
  1347. compatible with the 32-bit Edition of Visual C++:
  1348.  
  1349.      FG32VC.LIB     32-bit PM library for Microsoft Visual C++ 32-bit Edition
  1350.  
  1351. FG32VC.LIB includes Fastgraph's Phar Lap support functions normally found in
  1352. the FG32PHAR.LIB library.
  1353.  
  1354.      There are two basic methods of creating 32-bit protected mode executables
  1355. with Visual C++ 32-bit Edition. The first method compiles and links the
  1356. program in a single command and uses the Microsoft 32-bit linker:
  1357.  
  1358.         CL <source_file> /link /stub:\TNT\BIN\GOTNT.EXE FG32VC.LIB
  1359.  
  1360. The second method compiles and links the program in separate commands and uses
  1361. Phar Lap's 386|Link utility:
  1362.  
  1363.         CL /c <source_file>
  1364.         386LINK <obj_file> @MSVC32.DOS -lib FG32VC -nomap -onecase
  1365.  
  1366. The Phar Lap linker has problems with Fastgraph's world space routines. If
  1367. your program uses any of the Fastgraph routines listed in Appendix D, you
  1368. should use the Microsoft 32-bit linker.
  1369.  
  1370.      For more information about other compilation and linking options, please
  1371. refer to Phar Lap's C/C++ User's Guide to TNT Dos-Extender.                    
  1372.                                                  Chapter 1:  Introduction   23
  1373.  
  1374.  
  1375. Power C
  1376.  
  1377.      Power C is an inexpensive real mode command-line compiler. The following
  1378. Fastgraph libraries are compatible with Power C:
  1379.  
  1380.      FGS.MIX        Small model general library
  1381.      FGM.MIX        Medium model general library
  1382.      FGL.MIX        Large model general library
  1383.      FGPCS.MIX      Small model auxiliary library
  1384.      FGPCM.MIX      Medium model auxiliary library
  1385.      FGPCL.MIX      Large model auxiliary library
  1386.  
  1387.      To compile a Power C program from the DOS command line and link it with
  1388. Fastgraph, use the PC and PCL commands. Here are example command sequences for
  1389. compiling a Power C program and linking it with Fastgraph. The compiler-
  1390. specific auxiliary library names only need to be included when your program
  1391. uses any of the Fastgraph routines listed in Appendix D.
  1392.  
  1393.      Small memory model:
  1394.         PC /ms <source_file>
  1395.         PCL <mix_file> ;FGS [;FGPCS]
  1396.  
  1397.      Medium memory model:
  1398.         PC /mm <source_file>
  1399.         PCL <mix_file> ;FGM [;FGPCM]
  1400.  
  1401.      Large memory model:
  1402.         PC /ml <source_file>
  1403.         PCL <mix_file> ;FGL [;FGPCL]
  1404.  
  1405. For more information about memory models or other compilation and linking
  1406. options, please refer to the Power C manual, published by Mix Software, Inc.   
  1407. 24   Fastgraph User's Guide
  1408.  
  1409.  
  1410. Turbo C and Turbo C++
  1411.  
  1412.      Turbo C and Turbo C++ can create real mode and 16-bit protected mode
  1413. applications. For protected mode, only the Rational Systems DOS/16M extender
  1414. is supported. You can compile and link programs directly from the DOS command
  1415. line or from the Turbo C/C++ integrated development environment (IDE). The
  1416. following Fastgraph libraries are compatible with Turbo C/C++:
  1417.  
  1418.      FGS.LIB        Real mode small model general library
  1419.      FGM.LIB        Real mode medium model general library
  1420.      FGL.LIB        Real mode large model general library
  1421.      FGTCS.LIB      Real mode small model auxiliary library
  1422.      FGTCM.LIB      Real mode medium model auxiliary library
  1423.      FGTCL.LIB      Real mode large model auxiliary library
  1424.      FG16.LIB       16-bit protected mode general library
  1425.      FG16BC.LIB     16-bit protected mode auxiliary library
  1426.      FG16DPMI.LIB   16-bit DPMI-compliant DOS extender support library
  1427.  
  1428.      To build Fastgraph applications in the Turbo C/C++ IDE, the compiler
  1429. options must match one of Fastgraph's available memory models (small, medium,
  1430. or large). You also must create a project file that includes the name of each
  1431. C, CPP, and LIB file required by your application (refer to your Turbo C or
  1432. Turbo C++ manuals for information about project files). Project files are only
  1433. needed when using the IDE.
  1434.  
  1435.      You can also compile and link programs from the DOS command line using
  1436. the TCC command. Here are example TCC commands for compiling a Turbo C or
  1437. Turbo C++ program and linking it with Fastgraph. The compiler-specific
  1438. auxiliary library names only need to be included when your program uses any of
  1439. the Fastgraph routines listed in Appendix D.
  1440.  
  1441.      Real mode, small memory model:
  1442.         TCC -ms <source_file> FGS.LIB [FGTCS.LIB]
  1443.  
  1444.      Real mode, medium memory model:
  1445.         TCC -mm <source_file> FGM.LIB [FGTCM.LIB]
  1446.  
  1447.      Real mode, large memory model:
  1448.         TCC -ml <source_file> FGL.LIB [FGTCL.LIB]
  1449.  
  1450. To create Turbo C/C++ protected mode programs using the Rational Systems
  1451. DOS/16M extender, please refer to the DOS/16M User's Guide.
  1452.  
  1453.      For more information about memory models or other compilation and linking
  1454. options, please refer to the Turbo C User's Guide, Turbo C Reference Guide, or
  1455. the DOS/16M User's Guide.                                                      
  1456.                                                  Chapter 1:  Introduction   25
  1457.  
  1458.  
  1459. Turbo Pascal
  1460.  
  1461.      Turbo Pascal can build real mode programs directly from the DOS command
  1462. line or from the Turbo Pascal integrated development environment (IDE).
  1463.  
  1464.      To build Fastgraph applications in the Turbo Pascal IDE, just start the
  1465. IDE as you would for any other Pascal program, making sure the Fastgraph unit
  1466. files reside in one of the directories listed in the IDE's "Unit Directories"
  1467. option.
  1468.  
  1469.      You also can compile Turbo Pascal programs from the DOS command line
  1470. using the TPC command, as shown here:
  1471.  
  1472.         TPC <source_file>
  1473.  
  1474. For more information about other compilation and linking options, please refer
  1475. to the Turbo Pascal User's Guide.
  1476.  
  1477.      All remaining example programs in the Fastgraph User's Guide are written
  1478. in the C programming language. However, when you install Fastgraph for Turbo
  1479. Pascal, the installation procedure copies Pascal versions of the example
  1480. programs to the \FG\EXAMPLES directory.                                        
  1481. 26   Fastgraph User's Guide
  1482.  
  1483.  
  1484. WATCOM C/C++
  1485. WATCOM C32 for DOS
  1486.  
  1487.      WATCOM C/C++ and WATCOM C32 for DOS both are 16-bit real mode and 32-bit
  1488. protected mode compilers (for simplicity, we'll use the term WATCOM C/C++ to
  1489. refer to either compiler). Both compilers support the DOS/4G, DOS/4GW, and
  1490. DOS/4GW Professional DOS extenders from Rational Systems (DOS/4GW is supplied
  1491. with both compilers), as well as the Phar Lap TNT|Dos-Extender SDK. The
  1492. following Fastgraph libraries are compatible with the WATCOM compilers:
  1493.  
  1494.      FGS.LIB        Real mode small model general library
  1495.      FGM.LIB        Real mode medium model general library
  1496.      FGL.LIB        Real mode large model general library
  1497.      FGWCS.LIB      Real mode small model auxiliary library
  1498.      FGWCM.LIB      Real mode medium model auxiliary library
  1499.      FGWCL.LIB      Real mode large model auxiliary library
  1500.      FG32.LIB       32-bit protected mode general library
  1501.      FG32WC.LIB     32-bit protected mode auxiliary library
  1502.      FG32DPMI.LIB   32-bit DPMI-compliant DOS extender support library
  1503.      FG32PHAR.LIB   Phar Lap TNT|Dos-Extender support library
  1504.  
  1505.      Programs are compiled and linked from the DOS command line using the WCL
  1506. or WCL386 commands. Here are example commands for compiling a WATCOM C/C++
  1507. program and linking it with Fastgraph. The compiler-specific auxiliary
  1508. libraries (FGWCS, FGWCM, FGWCL, and FG32WC) only need to be included when your
  1509. program uses any of the Fastgraph routines listed in Appendix D.
  1510.  
  1511. Real mode, small memory model:
  1512.      WCL /ms <source_file> FGS.LIB [FGWCS.LIB]
  1513.  
  1514. Real mode, medium memory model:
  1515.      WCL /mm <source_file> FGM.LIB [FGWCM.LIB]
  1516.  
  1517. Real mode, large memory model:
  1518.      WCL /ml <source_file> FGL.LIB [FGWCL.LIB]
  1519.  
  1520. 32-bit protected mode, any Rational Systems DOS/4G extender:
  1521.      WCL386 /l=dos4g <source_file> FG32.LIB FG32DPMI.LIB [FG32WC.LIB]
  1522.  
  1523. 32-bit protected mode, Phar Lap TNT|Dos-Extender:
  1524.      WCL386 /l=pharlap <source_file> FG32.LIB FG32PHAR.LIB [FG32WC.LIB]
  1525.  
  1526.      For more information about other compilation and linking options, please
  1527. refer to the WATCOM C/C++ User's Guide, Phar Lap's C/C++ User's Guide to TNT
  1528. Dos-Extender, or the DOS/4G User's Manual.                                     
  1529.                                                  Chapter 1:  Introduction   27
  1530.  
  1531.  
  1532. Zortech C++
  1533.  
  1534.      Zortech C++ creates real mode applications. The following Fastgraph
  1535. libraries are compatible with Zortech C++:
  1536.  
  1537.      FGS.LIB        Real mode small model general library
  1538.      FGM.LIB        Real mode medium model general library
  1539.      FGL.LIB        Real mode large model general library
  1540.      FGZCS.LIB      Real mode small model auxiliary library
  1541.      FGZCM.LIB      Real mode medium model auxiliary library
  1542.      FGZCL.LIB      Real mode large model auxiliary library
  1543.  
  1544.      Programs are compiled and linked from the DOS command line using the ZTC
  1545. command. Here are example ZTC commands for compiling a Zortech C++ program and
  1546. linking it with Fastgraph. The compiler-specific auxiliary library names only
  1547. need to be included when your program uses any of the Fastgraph routines
  1548. listed in Appendix D.
  1549.  
  1550.      Small memory model:
  1551.         ZTC -ms <source_file> FGS.LIB [FGZCS.LIB]
  1552.  
  1553.      Medium memory model:
  1554.         ZTC -mm <source_file> FGM.LIB [FGZCM.LIB]
  1555.  
  1556.      Large memory model:
  1557.         ZTC -ml <source_file> FGL.LIB [FGZCL.LIB]
  1558.  
  1559. For more information about memory models or other compilation and linking
  1560. options, please refer to the manuals supplied with your Zortech C++ compiler.  
  1561. 28   Fastgraph User's Guide
  1562.  
  1563.  
  1564. Fastgraph/Light Video Driver
  1565.  
  1566.      As mentioned earlier, running any program created with Fastgraph/Light
  1567. requires an external program called the Fastgraph/Light Video Driver. The
  1568. video driver is a terminate and stay resident program (TSR) that provides an
  1569. interface between your program and Fastgraph.
  1570.  
  1571.      To load the video driver, enter the command FGDRIVER at the DOS command
  1572. prompt (assuming FGDRIVER.EXE is in the current directory, or the \FG
  1573. directory is in your DOS path specification). The driver will display a
  1574. message indicating whether or not it loaded successfully. After you load the
  1575. driver, just run a program created with Fastgraph/Light as you would any other
  1576. program. If you try running a program that uses Fastgraph/Light without first
  1577. loading the video driver, the message "Fastgraph/Light video driver not
  1578. installed" will appear.
  1579.  
  1580.      You don't need to load the driver before running each program, just once
  1581. per system boot (in fact, the driver will display an "already loaded" message
  1582. if you try to load it more than once). If you want to unload the video driver,
  1583. just enter FGDRIVER /U at the DOS command prompt. The unload operation will
  1584. work completely only if the video driver was the last TSR loaded. If it wasn't
  1585. the last TSR, the driver will still unload, but the memory it uses will not be
  1586. released back to DOS.
  1587.