POLYX HELP
A fast briefing about POLYX

 /****/         /*
 /*   */        /*
 /*   */        /*
 /****/  /**/   /*    /*  */  /*  */
 /*     /*  */  /*    /*  */   /**/
 /*      /**/    /**/  /***/  /*  */
                          */
POLYX2D                  /*      CopyRight Ryan2000



Introduction
------------
       What is POLYX2D ?

            Polyx is a basic rendering system for use in 2D or 3D application with
       TMT ( both demo and full ).

       Its capabilities are :
           - Drawing flat and guroud polygon with texture or not.
           - Alpha blending ( mul, add, true )
           - Sorted drawing ( most 3D application use it )
           - 16 bit Frame (64K colors)
           - Dithering
           - Window clipping
           - etc

       Why POLYX2D ?
            TMT comes with a high technology compiler but its graphic unit does not
       support POLYX2D capabilities. And a DOS application can't use Direct3D or
       DirectX from Windows. So as pascal programmer which have passed a few year in
       graphics I decided to make POLYX.


POLYX architecture
------------------

            Polyx comes with its "easy use" architecture. Its only contain a few
       procedures. With easy initialzation. It doesnot come with its own video flip.
       It draw in a specific memory location.
            When initialization user give a memory location where Polyx Object will
       located.

  < Creating primitives >

       To comunicate with Polyx, use these procedures

          - GINIT (MemoryLocation:Dword)
          - BIO   (BASIC_IO_REQUEST)
          - INC_UNIT
          - ABORT_UNIT
          - QUERY_UNIT(Depth:Dword)


       I wont explain this more deeepth.... please read Source to understand more

       The main Function is BIO

           BASIC_IO_REQUEST can be :

        BFRESETPRIM             * Reset primitive buffer
        BFCLPAGE                * Clear frame buffer
        BFRENDER                * Render all primitive in <primitive buffer> ( unsorted )
        BFQUERYRENDER           * Render all primitive in <primitive buffer> ( sorted )
        BFRENDERNOW             * Render current primitive in <primitive buffer>


        BFRENDER and BFQUERYRENDER automatically clear primitive buffer

        so, now how to enter a primitive into <primitive buffer>.

        To do this, use DTGUROUD,PRIMPT

        DTGUROUD -+INFO   - UnitType       * Unit type
                  |       - AlphaType      * Alpha/ blend type
                  |       - NumVertex      * Number vertexs (3/4)
                  |       - FlCol          * Flat color
                  |       - TxNo           * Texture Handler
                  |       - AlpNo          * Blendtrue parameter
                  |       - TexCMB         * TextureCombine mode
                  +DATAS[0..3]
                          - X, Y, R, G, B, U, V : 2D VERTEX PROPERTIES

-Program---------------------

// adding a primitive
       ...
       DTGUROUD:=PRIMPT;
       WITH DTGUROUD^ DO BEGIN
            WITH INFO DO BEGIN
                 UNITTYPE := ...
                 ...
            END;
            WITH DATAS[0] DO BEGIN
                 X:=0;
                 Y:=...
            END;
            WITH DATAS[1] DO BEGIN
            ...
            END;
            ...
       END;
//     call inc_unit or query_unit
       INC_UNIT;    // or use QUERY_UNIT(depth) for sorted one
       ...
-----------------------------


       For now, its only support polygons. I dont know why I dont add support for
       Pixel,Line or other 2D primitives.

       UnitType = [ UTFLAT, UTGUROUD, UTFLATTEX, UTGUROUDTEX ]
       Alphamode= [ BLENDNONE, BLENDADD, BLENDMUL, BLENDTRUE ]
       TextureCombineMode = [ TCNONE, TCADDRGB, TCMULRGB ]


  < Add texture >
       To load texture just like this
-Program---------------------
       ...
       textures^[Notextures].Load(Filename);
       ...
-----------------------------
       Notextures can be 0..31
       File is a TXR format. To create TXR format from Windows BMP.

       First compile TEXTURE.PAS

--MsDos Prompt ------------------------------------
      C:\>TEXTURE
         PMODE/W DOS Extender v1.33
         Copyright (C) 1994-1997, Charles Scheffold and Thomas Pytel
         Enter BMP:                  < enter filename here >
         Enter Mode:                 < enter '1' here >
         Enter TXR:                  < enter output filename >
         Enter X size:               < enter 1..10, this mean 2^N if you enter 8 it mean 256
                                       Why ?
                                        * Because polyx only support 2^N texture size
                                     >
         Enter X size:               < Same as X size >
         Exter Colorkey:             < Enter color which not processed , 32 for none >
      C:\>
---------------------------------------------------

       ...
       For more detailed information, e-mail me at ryan@n2math.com