home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
413b.lha
/
dkbtrace_v2.1
/
doc
/
Porting.doc
< prev
next >
Wrap
Text File
|
1990-08-27
|
3KB
|
80 lines
Porting DKBTrace to Other Platforms
The 2.0 version of DKBTrace is much more portable than pervious versions.
In order to port the ray tracer to different systems, you should only
need to create two files:
<system>-config.h - This is a system-specific header file which
defines all constants and macros for the
raytracer. Currently, there are config files
for the Amiga, IBM Turbo C, and Unix.
<system>.c - This module contains all system-specific
code and variables.
In the system.c file, you must define four functions:
void display_init (void);
- initialize the display for drawing the image
void display_plot (int x, int y, char Red, char Green, char Blue);
- display the given colour at the given x,y coordinates
void display_finished (void);
- perform any operations necessary after the raytracing is
finished.
void display_close (void);
- close the display
The display_finished routine is called before the raytracer prompts
the user to hit return to finish at the end of the raytrace. On the
Amiga, this function closes the requestor that allowed the raytracer
to be halted prematurely. On most other systems, this function would
be an empty function.
DKBTrace version 2.0 uses ANSI prototypes to perform parameter type
checking. If your compiler doesn't support ANSI prototypes, then
place the following line in your system-congig.h file:
#define PARAMS ()
If your compiler does support prototypes, place the following line
in the system-config.h file:
#define PARAMS x
NOTE: Before compiling on a new system, rename your system-config.h
file to config.h
One final request:
If you are porting to another system, PLEASE try to change only the
two files that you created. If you must make changes elsewhere in
the system, first ask yourself "Is there any way I can do this by
just changing the header file?" If there is, then do it. If there
is absolutely no way you can get it to work otherwise, then you can
change code elsewhere in the system. I would appreciate it if the
raytracer remained as portable as possible.
If you port the system to another platform, please send me the modified
files. I would like to keep them in case I get requests for ports to
that system. Keep in mind, that any ports must be made freely
distributable and source code must be available free of charge to anyone
who wants it.
Thanks.
David Buck