⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 svgabc25.txt

📁 Quick Basic DOS Compilers
💻 TXT
📖 第 1 页 / 共 5 页
字号:







                                  REFERENCE MANUAL


                                   FOR SVGAQB.LIB


                                   AND SVGAPV.LIB


                                    THE SUPER VGA


                                  GRAPHICS LIBRARY


                                   TO BE USED WITH


                                MICROSOFT QUICKBASIC,


                                VISUAL BASIC FOR DOS


                               AND BASIC PROFESSIONAL


                                 DEVELOPMENT SYSTEM






















          1993-1996 by Zephyr Software - Stephen L. Balkum and Daniel A.
          Sill

          All rights reserved.  No part of this book shall be reproduced or
          transmitted by any means, electronic, mechanical, photocopying,
          recording or otherwise, without written permission from Zephyr
          Software - Stephen L. Balkum and Daniel A. Sill.

          Although every effort has been made to insure the accuracy of the
          material in this book, Zephyr Software, Stephen L. Balkum and
          Daniel A. Sill assume no responsibility for errors or omissions.
          In addition no liability is assumed for damages resulting from
          the use of the information contained herein.

          Printed in the United States of America

          Trademarks

          Sound Blaster and Sound Blaster Pro are trademarks of Creative
          Labs, Inc.
          All others are trademarks of their respective owners.



















                                                                         ii








                             SOFTWARE LICENSE AGREEMENT

               By using this software, you agree to the terms of this
                                     agreement.

               No warranties are expressed or implied.  In no event
               shall Zephyr Software, Stephen L. Balkum or Daniel A.
               Sill be held liable for damages resulting from the use
               or misuse of this product, including but not limited to
               implied warranties of fitness for a particular purpose.

               The shareware version may be freely distributed as long
               as all files stay together and are not modified in any
               way.  No cost may be charged for the shareware version
               beyond normal and reasonable copying and distribution
               expenses.

               No products developed with this software shall be sold
               unless this software has been registered with Zephyr
               Software, Stephen L. Balkum or Daniel A. Sill.

               At no time for any reason shall this software be
               reverse engineered, decompiled or disassembled.

               This software may not be rented or leased.

               This software may be used only on one terminal or one
               computer at any one given moment in time.  This
               software may not be installed on a network of any type.
               Contact Zephyr Software, Stephen L. Balkum or Daniel A.
               Sill for networking options.

               United States Government Restricted Rights:
               Use, duplication or disclosure of this software and
               documentation by the U.S. Government is subject to the
               restrictions as set forth in subparagraph (c)(1)(ii) of
               the Rights in Technical Data and Computer Software
               clause at DFARS 252.227-7013.  Contractor/manufacturer
               is Stephen L. Balkum and Daniel A. Sill, P.O. Box 7704,
               Austin, Texas 78713-7704.

               The ownership of this software may be transferred as
               long as Zephyr Software, Stephen L. Balkum or Daniel A.
               Sill is notified in writing of the transfer date and
               new owner.  The new owner must agree to this contract.
               The transfer must include all registered updates and
               previously registered versions.  The original owner may
               not retain any copies in any form of the registered
               software or its documents.





                                                                        iii






          INTRODUCTION

          We spent weeks searching the depths of the internet ftp sites for
          a library that would allow the programmer full access to the
          abilities of Super VGA.  We wanted the colors VGA could provide
          and better resolution than EGA could provide.  Professionally
          developed libraries with this ability were definitely out of our
          price range.  After our searches continuously returned nothing,
          we decided to fill the apparent void in the shareware market.

          Our searches did give two useful packages:  John Bridges' VGAKIT
          and Finn Thoegersen's VGADOC.  We began with these two works and
          developed a graphics library intended to allow the programmer
          access to the huge world of high resolution programming.

          On the surface the task appeared quite simple.  However, it
          quickly became obvious that the routines in this library would be
          required to affect extremely large amounts of data.  Operations
          must be quick to be successful.  Therefore, every effort was made
          to create the fastest code possible - even at the expense of
          size.  For this reason we opted to write code with the 32 bit
          instructions of the 80386 and better processors.  It is our
          opinion that anyone with a hi-res card in a lesser machine may
          have some priorities out of order. All routines are written in
          assembly and use absolutely no floating point values.  Anytime a
          real number was required, fixed point notation was used.  In
          addition we attempted to write the routines such that any
          reasonable argument passed can be interpreted intelligently by
          the library.

          With the numerous Super VGA cards available and no well
          established standard we chose John Bridges' identification and
          bank switching routines as a beginning.  These two routines have
          undergone some modification, but not enough to justify
          copyrighting this portion of the library's code by Zephyr
          Software.  We have no intentions of releasing our changes to
          these routines into the public domain.  From that point onward
          all code is original.  In some instances common algorithms were
          researched and original code written according to that algorithm.

          This Super VGA library gives the programmer transparent access to
          twenty different Super VGA cards.  These cards include Acumos,
          Ahead, ATI Technologies, Avance, Chips and Technologies, Cirrus
          Logic, Everex, Genoa, MXIC, NCR, Oak Technologies,
          Paradise/Western Digital, Primus, Realtek, Trident, Tseng Labs,
          Video 7 and the VESA standard.  Please see the WHICHVGA function
          for the specific chipsets.  The programmer only needs to verify
          that the end user's card has been identified, but not which card
          was recognized.  After proper identification, all functions react
          in exactly the same fashion.  The library contains functions to
          draw all of the major primitives.  In addition there are
          functions that modify the screen palette, write text on the
          screen with a choice of fonts and modify the reaction of the
          primitives.  Identification routines include not only the video


                                                                          2






          card, but also the amount of video memory, type of processor and
          installed pointing devices.  Advanced functions provide full
          mouse support (when used with a Microsoft compatible driver) and
          joystick support.  Finally, support for two dimensional and three
          dimensional coordinate systems is provided including rotation,
          translation, scaling and projection.


















































                                                                          3






          SUGGESTED METHODS FOR USING THIS LIBRARY

          USE WITHIN THE BASIC ENVIRONMENT

          We assume that the programmer is familiar with all of the
          capabilities of the Microsoft QuickBasic, Visual Basic (VBDOS) or
          Basic Professional Development System (PDS) compiler and
          environment.  Understanding of the LIB and LINK commands is
          encouraged as well as the use of QuickLibraries.  However, to
          ensure you are able to get up and running quickly, the following
          commands may be helpful:

          To create a QuickLibrary from SVGAQB/PV.LIB, type the command:

              LINK /QU SVGAQB/PV.LIB, SVGAQB/PV.QLB, NUL, QUICKQLB.LIB

          where QUICKQLB.LIB is the name for your compiler's QuickLibrary
          (BQLB45.LIB for QuickBasic 4.5, VBDOSQLB.LIB for VBDOS and
          QBXQLB.LIB for PDS).

          If you wish to create a QuickLibrary from SVGAQB/PV.LIB and
          additional libraries, type the command:

              LINK /QU SVGAQB/PV.LIB + ????.LIB (continue as desired),
                            NEWLIB.QLB, NUL, QUICKQLB.LIB

          where QUICKQLB.LIB is the same as above and ????.LIB represents
          the additional desired libraries.

          After the QuickLibrary has been created, you should start your
          development environment by typing:

                    QuickBasic:    QB /L SVGAQB
                    VBDOS:         VBDOS /L SVGAPV
                    PDS:           QBX /L SVGAPV

          This will tell the compiler to use the QuickLibrary when running
          and when creating an executable.

          VERIFICATION OF A COMPUTER'S HARDWARE

          It is strongly recommended that any program written with this
          library first verifies that the computer is a 80386 or better by
          calling the WHICHCPU function.  Many of the library's functions
          use 386 exclusive code which may cause a computer with a lesser
          processor to crash.  In addition WHICHMOUSE must be called before
          calling any of the mouse functions.  Lastly, it is recommended
          that WHICHJOYSTICK be called before a program uses the joystick
          routines.

          It is required that a program call WHICHVGA prior to any function
          that communicates with the video card.  If WHICHVGA returns a
          zero for unknown card type, the program should not call any
          graphics function.  Without proper identification of the video


                                                                          4






          card any graphics function will likely cause a system failure.
          It is recommended, although not necessary, that a program call
          WHICHMEM prior to calling any RES function.  Although the video
          card was properly identified, it may not have sufficient onboard
          memory to support the desired resolution.  As a second check the
          RES functions will do nothing if the video card has not been
          identified or if the video card does not support the specified
          resolution for memory or hardware reasons.

          THE 256 COLOR PALETTE

          The 256 color palette of the Super VGA cards is a six bit
          palette.  Each of the 256 colors of the palette are described by
          three values representing the intensity of the colors red, blue
          and green.  These values can range from 0 to 63.  Anytime a value
          outside of this range is used, the video card simply ignores the
          upper two bits.  Therefore, 64 is the same as 0.  This should be
          taken into consideration when manipulating the palette or when
          importing a palette from an external source such as a PCX image.

          USE OF 2-D AND 3-D FUNCTIONS

          In the interest of speed, the 2-D and 3-D functions were written
          to best work on multiple points at once.  We refer to these
          functions as object-oriented.  This means that the points
          defining an object (a box, a house, etc.) should be contained
          within one array or part of an array and calls to the functions
          should act on all of the points in the array.  Calls to functions
          have a high speed overhead, therefore, placing more than one
          object in the same array and passing the entire array to the
          functions can be beneficial.  However, these functions will work
          on a single point as well.

          A consequence of our object-oriented 2-D and 3-D functions is the
          use of the scaling functions.  When scaling objects, we recommend
          the object be defined about the origin.  D2SCALE and D3SCALE both
          work with respect to the origin.  This eliminates a significant
          number of translations that would otherwise be required by having
          a definable scale origin.  For example, to draw two boxes, one
          scaled by one-half of the other, each rotated by 45 degrees at
          the center of the screen, the recommended procedure is as
          follows:

            define an array BOX containing the 2-D points: (100, 100), (-
               100, 100), (-100, -100), (100, -100), (note: the box is
               centered about the origin.)
            rotate BOX by 45 degrees about (0, 0) and place the output in
               RBOX,
            scale RBOX by 50% (scaling factor would be 128, or 80 hex) and
               place output in SRBOX,
            translate RBOX to the center of the screen - a translation of
               320, 240 in 640x480 resolution - and place output in TRBOX,
            translate SRBOX to the center of the screen - same translation
               as for RBOX - and place output in TSRBOX,


                                                                          5






            draw TRBOX and TSRBOX on the screen.

          Notice that by defining the box centered about the origin the
          translation values were extremely intuitive.  Also notice that if
          we had scaled the second box after the translation, it would have
          been draw in the upper left quadrant of the screen instead of the
          center.

          In mathematics and many sciences it is customary that in a 2-D
          coordinate system the Y axis increases upward and the X axis
          increases to the right.  The computer industry has decided the Y
          axis should increase downward.  The 2-D functions are not
          affected by the choice in coordinate systems.  However, it is
          important to remember that a positive rotation in D2ROTATE
          rotates from the positive X axis to the positive Y axis.
          Therefore, when using mathematical conventions, a positive
          rotation moves counter-clockwise.  On the computer screen a
          positive rotation moves clockwise.

          The 3-D coordinate system follows mathematical conventions by
          using a right-handed coordinate system.  The easiest way to
          visualize this coordinate system is by using your right hand.
          Place your index finger and thumb at a right angle to one another
          as if to form an imaginary pistol.  Now place your second finger

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -