

  
                           3D Foundation Classes



                              *** EXAMPLES ***



     -------------------
      Table of Contents
     -------------------



           Introduction

           List of examples



     --------------
      Introduction
     --------------

           
           
            The examples available are in directory EX.
            
            
            They can be compiled using: "make examples", from 3DFC root
            
            directory. Or each one can be compiled separetely
            
            using: "make example_label",

            where "example_label" is a name with sufix "ex", like "exstring".

            Try "make exstring", this make the example string.

            All executable files are in EX directory and have the prefix ".exe".

            
            The examples don't cover all classes of 3DFC, but are very helpfull.

            
            Is recomendable read the remarks in the code of the examples,
           
            the execution normaly don't bring many information.

            
            Many of the examples are not only simple examples, but

            are tools that can help to use 3DFC.

            
            Follow the sequence of examples as they apear on next section.



     ------------------
      List of examples
     ------------------

           
           
            There is a list of the current examples, with a brief description:

            
            GROUP 1: BASIC SET


               This examples cover some of the basic 3DFC data structures and

               keyboard functions.
            
               * Mem
                
                 example file: mem.cc

                 example label in makefile: exmem

                 executable: mem.exe
                
                 class covered: CMem

                 Use: show how to use buffers of bytes provided by CMem.
            
               * String
                
                 example file: string.cc

                 example label in makefile: exstring

                 executable: string.exe
                
                 class covered: CString

                 Use: show how to use strings provided by CString.
            
               * Array
                
                 example file: array.cc

                 example label in makefile: exarray

                 executable: array.exe
                
                 class covered: CArray

                 Use: show how to use arrays of templates provided by CArray.

               * List
                
                 example file: list.cc

                 example label in makefile: exlist

                 executable: list.exe
                
                 class covered: CList

                 Use: show how make simple manipulation with the double list

                 provided by the CList class.
            
               * Heap
                
                 example file: heap.cc

                 example label in makefile: exheap

                 executable: heap.exe
                
                 class covered: CHeap

                 Use: show how to use heaps.
            
               * Queue
                
                 example file: queue.cc

                 example label in makefile: exqueue

                 executable: queue.exe
                
                 class covered: CQueue

                 Use: show how to use queues.
            
               * Map
               
                 example file: map.cc

                 example label in makefile: exmap

                 executable: map.exe
                
                 class covered: CMap

                 Use: show how to use the CMap class than provide
                 
                 association between a key (double word) and a value.
            
               * Keyboard
               
                 example file: keyboarb.cc

                 example label in makefile: exkeyboarb

                 executable: keyboard.exe
                
                 class covered: CKeyboarb

                 Use: show how to use the keyboard handler provided
                 
                 by the class CKeyboard (only DOS).

            
            GROUP 2: INTERMEDIATE LEVEL


               This examples cover some classes used for file IO and

               2D graphics output.
            
               * File
                
                 example file: file.cc

                 example label in makefile: exfile

                 executable: file.exe
                
                 class covered: CFile

                 Use: show how to use simple files access functions.
            
               * FileRem
                
                 example file: filerem.cc

                 example label in makefile: exfilerem

                 executable: filerem.exe
                
                 class covered: CFileRem

                 Use: show how to use text files that ignore automaticaly
                 
                 the standard C remarks: /*  */.

               * Gr
                
                 example file: gr.cc

                 example label in makefile: exgr

                 executable: gr.exe
                
                 class covered: CGr

                 Use: show how to init the graphics mode, change palette
                 
                 and other basic graphics operations provided by CGr
                 
                 class (only for DOS target).

               * XWinApp
                
                 example file: xwinapp.cc

                 example label in makefile: exxwinapp

                 executable: xwinapp.exe
                
                 class covered: CXWindowApp

                 Use: show how to use this class to create and manage one

                 X aplication and its window (only for Linux X Window target).

               * ShowPCX
                
                 example file: showpcx.cc

                 example label in makefile: exshowpcx

                 executable: showpcx.exe
                
                 class covered: CScreen, CFilePCX, CTexture, CDraw

                 Use: show how to draw an image loaded from a PCX file

                 using a texture as an intermediate frame buffer.

                 Use this exemple as a tool to see PCX images.

               * Scale
                
                 example file: scale.cc

                 example label in makefile: exscale

                 executable: scale.exe
                
                 class covered: CScreen, CFilePCX, CTexture, CDraw

                 Use: show how to scale a texture.

                 Use this exemple as a tool to see small PCX images better.

               * Draw
                
                 example file: draw.cc

                 example label in makefile: exdraw

                 executable: draw.exe
                
                 class covered: CDraw, CFilePCX, CSreen

                 Use: show how to use draw functions provided by CDraw
                 
                 on a frame buffer: pixels, lines, flat shaded polys.

                 Show how to load a palette from a PCX file.

               * DrawGou
                
                 example file: drawgou.cc

                 example label in makefile: exdrawgou

                 executable: drawgou.exe
                
                 class covered: CDraw, CFilePCX, CSreen

                 Use: show how to draw gouraud like polygons and programm
                 
                 palette without file loading.

               * DrawTex
                
                 example file: drawtex.cc

                 example label in makefile: exdrawtex

                 executable: drawtex.exe
                
                 class covered: CDraw, CFilePCX, CTexture, CSreen

                 Use: show how to draw affine textured polygons without shades.

               * DrawGT
                
                 example file: drawgt.cc

                 example label in makefile: exdrawgt

                 executable: drawgt.exe
                
                 class covered: CDraw, CFilePCX, CTexture, CSreen, CLightTable

                 Use: show how to draw affine textured polygons with gouraud like
                 
                 shades. Use colored light tables.

               * Light
                
                 example file: light.cc

                 example label in makefile: exlight

                 executable: light.exe
                
                 class covered: CDraw, CLightTable

                 Use: show how the polygons light can be controlled
                 
                 when drawing textured polygons.

               * DrawClip
                
                 example file: drawclip.cc

                 example label in makefile: exdrawclip

                 executable: drawclip.exe
                
                 class covered: CDraw, CFilePCX, CTexture, CSreen

                 Use: show how to use the clip edge buffer provided by CDraw
                 
                 when drawing textured polygons.
            
               * Client/Server
                
                 example file: client.cc, server.cc

                 example label in makefile: exclient, exserver

                 executable: client.exe, server.exe
                
                 class covered: CSocket, CServerSocket

                 Use: show how to create a Internet socket stream. Sockets is a
                 
                 communication resource between 2 computers or 2 processes in 
                 
                 same computer. The examples are configured to run in a machine
                 
                 without a connection to Internet or a network card.
                 
                 They does not work under DOS, DJGPP compilation.
                 
                 To test run them on under X. Execute first server.exe
                 
                 in one terminal window and then client.exe in other.

            
            GROUP 3: ADVANCED GRAPHICS


               This examples show how to use the 3D graphics engine.
            
               * TestTxe
                
                 example file: testtxe.cc

                 example label in makefile: extesttxe

                 executable: testtxe.exe
                
                 class covered: CFileTXE, CScenery

                 Use: show how to load scenery files. Test if the scenery

                 file is ok to load.

                 Use this exemple as a tool to test the scenery files integrity.
            
               * Fly
                
                 example file: fly.cc

                 example label in makefile: exfly

                 executable: fly.exe
                
                 class covered: CFileTXE, CScenery, CFly

                 Use: load a scenery from a TXE file and generate images.

                 Use this exemple as a tool to see the scenery.

                        
            GROUP 4: ARTIFICIAL INTELIGENCE


               This examples show how to use the IA 3DFC resources:

               backpropagation neural networks.
            
               * BpnAND
                
                 example file: bpnand.cc

                 example label in makefile: exbpnand

                 executable: bpnand.exe
                
                 class covered: CBPN, CNeuron

                 Use: show how to create, traing and use a neural network
                 
                 for the boolean AND.
            
               * BpnOR
                
                 example file: bpnor.cc

                 example label in makefile: exbpnor

                 executable: bpnor.exe
                
                 class covered: CBPN, CNeuron

                 Use: show how to create, traing and use a neural network
                 
                 for the boolean OR.
            
               * BpnXOR
                
                 example file: bpnxor.cc

                 example label in makefile: exbpnxor

                 executable: bpnxor.exe
                
                 class covered: CBPN, CNeuron

                 Use: show how to create, traing and use a neural network
                 
                 for the boolean XOR.
            
               * Bpn
                
                 example file: bpn.cc

                 example label in makefile: exbpn

                 executable: bpn.exe
                
                 class covered: CBPN, CNeuron

                 Use: show how to create, traing and use a neural network
                 
                 for the boolean XOR. Allow user interaction with the network.
