home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff397.lzh / DKBTrace / Porting.doc < prev    next >
Text File  |  1990-10-30  |  3KB  |  80 lines

  1.  
  2.  
  3.  
  4.                        Porting DKBTrace to Other Platforms
  5.  
  6.  
  7.    The 2.0 version of DKBTrace is much more portable than pervious versions.
  8.    In order to port the ray tracer to different systems, you should only
  9.    need to create two files:
  10.  
  11.      <system>-config.h    - This is a system-specific header file which
  12.                             defines all constants and macros for the
  13.                             raytracer.  Currently, there are config files
  14.                             for the Amiga, IBM Turbo C, and Unix.
  15.  
  16.      <system>.c           - This module contains all system-specific
  17.                             code and variables.
  18.  
  19.    In the system.c file, you must define four functions:
  20.  
  21.      void display_init (void);
  22.             - initialize the display for drawing the image
  23.  
  24.      void display_plot (int x, int y, char Red, char Green, char Blue);
  25.             - display the given colour at the given x,y coordinates
  26.  
  27.      void display_finished (void);
  28.             - perform any operations necessary after the raytracing is
  29.               finished.
  30.  
  31.      void display_close (void);
  32.             - close the display
  33.  
  34.  
  35.     The display_finished routine is called before the raytracer prompts
  36.     the user to hit return to finish at the end of the raytrace.  On the
  37.     Amiga, this function closes the requestor that allowed the raytracer
  38.     to be halted prematurely.  On most other systems, this function would
  39.     be an empty function.
  40.  
  41.  
  42.     DKBTrace version 2.0 uses ANSI prototypes to perform parameter type
  43.     checking.  If your compiler doesn't support ANSI prototypes, then
  44.     place the following line in your system-congig.h file:
  45.  
  46.        #define PARAMS ()
  47.  
  48.     If your compiler does support prototypes, place the following line
  49.     in the system-config.h file:
  50.  
  51.        #define PARAMS x
  52.  
  53.  
  54.  
  55.     NOTE:  Before compiling on a new system, rename your system-config.h
  56.            file to config.h
  57.  
  58.  
  59.  
  60.     One final request:
  61.  
  62.       If you are porting to another system, PLEASE try to change only the
  63.       two files that you created.  If you must make changes elsewhere in
  64.       the system, first ask yourself "Is there any way I can do this by
  65.       just changing the header file?"  If there is, then do it.  If there
  66.       is absolutely no way you can get it to work otherwise, then you can
  67.       change code elsewhere in the system.  I would appreciate it if the
  68.       raytracer remained as portable as possible.
  69.  
  70.  
  71.    If you port the system to another platform, please send me the modified
  72.    files.  I would like to keep them in case I get requests for ports to
  73.    that system.  Keep in mind, that any ports must be made freely
  74.    distributable and source code must be available free of charge to anyone
  75.    who wants it.
  76.  
  77.  
  78. Thanks.
  79. David Buck
  80.