home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / 3DTOSHI2.ZIP / myapp / doc / mpgfx.txt < prev   
Text File  |  1996-04-09  |  7KB  |  227 lines

  1.  
  2. Multi-Platform Graphics Library ver 2.0
  3.  
  4. 1 Introduction
  5.  
  6.   The purpose of Multi-Platform Graphics library is to        
  7.   provide high-performance & flexible graphics to high-level  
  8.   programmers. So that they do not have to build their own  
  9.   graphics routines for each target-platforms.
  10.  
  11. 2 Requirement
  12.  
  13.   Hardware :
  14.  
  15.     Minimum - 486 DX 33+ Mhz, 4 MB RAM, VGA Graphics Card. 
  16.     Recomended - Pentium 90+ Mhz, 8-16 MB RAM, VESA    
  17.                  compatible SVGA.
  18.  
  19.   Supported Operating System :
  20.  
  21.     DOS, 32-Bit DOS, Windows 3.1, Windows 95, Windows NT,     
  22.     OS/2 3.0, Unix with X Windows system.    
  23.  
  24.   Supported Compilers :
  25.  
  26.     Watcom C/C++ 10.0+, Visual C/C++ 2.0+, Borland C/C++ 
  27.     4.0+, GNU C/C++ Compiler.
  28.  
  29. 3 Source Code
  30.  
  31.   The source code with gfx prefix is the C++ modules for 
  32.   this library. The source code with lgfx prefix is the 
  33.   Low-Level routine for this library.
  34.  
  35. GFX sources :  Extension C++ or CXX.
  36.  
  37.   gfxadst  - Abstract Data Structure class.
  38.   gfxanim  - Animated sprites class.
  39.   gfxbmp   - Windows BMP file tool.
  40.   gfxcltbl - Color Look-Up table.
  41.   gfxdev   - Device handling class.
  42.   gfxdisp  - Display driver class.
  43.   gfxdpmi  - DPMI handling class.
  44.   gfxdrv   - Driver Level class.
  45.   gfxerror - Error handling class.
  46.   gfxfiles - File handling class.
  47.   gfxflic  - FLI/FLC file tool.
  48.   gfxgif   - Compuserv GIF file tool.
  49.   gfxgdi   - Windows GDI driver.
  50.   gfxgpi   - OS/2 GPI driver.
  51.   gfxgraf  - Graphics System class.
  52.   gfxifile - Image file too.
  53.   gfximage - Image ( Virtual Screen ) class.
  54.   gfxinput - Input device handler.
  55.   gfxllist - Linked-List class.
  56.   gfxmodes - Graphics Modes.
  57.   gfxobj   - Base Object of evrything.
  58.   gfxpal   - Color Palette class.
  59.   gfxpcx   - PCX file tool.
  60.   gfxsddrv - Sound driver class.
  61.   gfxsys   - System handling class.
  62.   gfxtypes - Type definitions.
  63.   gfxvga   - VGA driver.
  64.   gfxvsa   - VESA driver.
  65.   gfxwinsd - Windows Sound driver.
  66.   gfxxwin  - X Windows driver.
  67.   
  68. Low-Level sources  : Extension ASM or CPP or CXX.
  69.  
  70.   lgfxdib? - Device Independent graphics routines.
  71.   lgfxvga? - VGA specific graphics routines.
  72.   lgfxvsa? - VESA specific graphics routines.
  73.  
  74.   * Note - ? will be replaced by one of the following 
  75.            characters. 
  76.  
  77.      b  -  For Borland compiler.
  78.      g  -  For GNU compiler.
  79.      v  -  For Visual C/C++ compiler.
  80.      w  -  For Watcom C/C++ compiler.
  81.  
  82.   Use appropriate low-level source for your compiler.
  83.  
  84.  
  85. 4  Setup for MPGFX Library.
  86.  
  87.   Follow these steps to start programming with MPGFX.
  88.  
  89.     1 - Create directory called "MPGFX" or something you 
  90.         like.
  91.     2 - Under this directory, create "source" and "include".
  92.     3 - From source disks, copy all the files with  
  93.         cpp,cxx,asm extensions to the directory 
  94.         mpgfx/source.
  95.     4 - From source disks, copy all the files with h  
  96.         extensions to the directory mpgfx/include.
  97.     5 - Include all the gfx?.cpp ( or cxx ) modules and 
  98.         appropriate low-level source files to your project 
  99.         or makefile.
  100.     6 - You must define a macro before start compiling. See 
  101.         below.
  102.  
  103.       Macros for Compiler :
  104.  
  105.         __FORBORLAND__  - Compiling for Borland.
  106.         __FORGCC__      - Compiling for GCC.
  107.         __FORVISUAL__   - Compiling for Visual.
  108.         __FORWATCOM__   - Compiling for Watcom.
  109.  
  110.       Macros for Target Operating System :
  111.  
  112.         __FORDOS__      - 16 Bit DOS.
  113.         __FORDOS4GW__   - 32 Bit DOS 4GW Extender.
  114.         __FORWIN16__    - 16 Bit Windows.
  115.         __FORWIN32__    - 32 Bit Windows. ( Windows 95, NT, 
  116.                           Win32s )
  117.         __FOROS2__      - 32 Bit OS/2.
  118.         __FORUNIX__     - Unix with X Wndows.
  119.  
  120.       Macros for Tools or class library :
  121.     
  122.         __FORMFC__      - Make it compatible to MFC class 
  123.                           library.      
  124.         __FOROWL__      - Make it compatible to OWL class 
  125.                           library.      
  126.         __FORMOTIF__    - Make it compatible to Motil 
  127.                           Toolkit.
  128.  
  129.      * Exmaple -  If you want to compile for Windows 95 
  130.                   using Watcom C/C++ with MFC library, 
  131.                   define :
  132.  
  133.              __FORWATCOM__ __FORWIN32__ __FORMFC__
  134.  
  135.    7 - Make mpgfx/include directory visible to your project.
  136.    8 - Include stdgfx.h and mpgfx.h file in your source 
  137.        code.
  138.       
  139.  
  140. 5 Programming with MPGFX
  141.  
  142. 5-1  Types
  143.  
  144.   BYTE   - Unsigned character. 1 Bytes
  145.   CHAR   - Character. 1 Byte.
  146.  
  147.   WORD   - Unsigned Short. 2 Bytes.
  148.   SHORT  - Short. 2 Bytes.
  149.  
  150.   INT    - Integer. ( 2/4 Bytes in 16/32 Bit Platform. )
  151.   UINT   - Unisgned Integer.  ( 2/4 Bytes in 16/32 Bit 
  152.            Platform. )
  153.  
  154.   LONG   - Long Integer. 4 Bytes.
  155.   ULONG  - Unsigned Long Integer. 4 Bytes.
  156.   DWORD  - Unsigned Long Integer. 4 Bytes.
  157.  
  158.   BOOLEAN - Boolean, (TRUE/FALSE) or (SUCCESS/FAILURE).
  159.   HDISPLAY - Displayable object. ( Source and destination of 
  160.                                    graphic operations. )
  161.   
  162.  
  163. 5-2  Constants
  164.  
  165.   TRUE    -  1
  166.   FALSE   -  0
  167.   SUCCESS -  1
  168.   FAILURE -  0
  169.  
  170.   HVGA    - Used as HDISPLAY of VGA(SVGA) memory. (Only used  
  171.             in DOS)
  172.  
  173.   M320x200x256    - Used for setting up VGA mode 320x200 by  
  174.                     256 Colors.
  175.   M640x400x256    - Used for setting up VESA mode 640x400 by 
  176.                     256 Colors.
  177.   M640x480x256    - Used for setting up VESA mode 640x480 by 
  178.                     256 Colors.
  179.   M800x600x256    - Used for setting up VESA mode 800x600 by 
  180.                     256 Colors.
  181.   M1024x768x256   - Used for setting up VESA mode 1024x768 
  182.                     by 256 Colors.
  183.   
  184. 5-3 Global Object
  185.  
  186.   Following objects are always visible and accessible to 
  187.   high-level programmers.
  188.  
  189.     GRAFIX Grafix   - Graphics System.
  190.     SOUND  Sound    - Sound System.  
  191.     INPUT  Input    - Input Handling System.
  192.    
  193. 5-4  Setting up display.
  194.  
  195.   Before any graphics operations, you must setup display by 
  196. calling
  197.  
  198.     Grafix.SetDisplay ( INT GraphicsMode, VOID *Data );
  199.  
  200.   GraphicsMode must one of the constant mentioned in 5-2 section.  If you are programming for X Windows, Data must be a pointer to Display type in X Windows. ( Not HDISPLAY )
  201.  
  202.   Just before your program terminate, you must call
  203.  
  204.     Grafix.ResetDisplay ();
  205.   
  206.   To reinitialize the graphics.
  207.  
  208.  
  209.   Example 1.
  210.  
  211.     Following is the example of using MPGFX in DOS. It will switch to VGA 320x200 256 color mode and wait for you keyboard then reset graphics to normal and quit. Assuming you have finished setting up the steps of section 4.
  212.  
  213.   //********** Example 1. ***********//
  214.  
  215.   #include "stdgfx.h"
  216.   #include "mpgfx.h"
  217.  
  218.   void main ()
  219.     {
  220.       Grafix.SetDisplay ( M320x200x256, NULL );
  221.       getch ();
  222.       Grafix.ResetDisplay (); 
  223.     } // End of main
  224.  
  225.  
  226.  
  227.