The source code of an Ayam custom object needs to include ayam.h
,
ayam.h
in turn includes Togl (OpenGL, Tcl/Tk, X11) and RI
(RenderMan Interface) headers.
When compiling your custom object, all you need to do is
to make sure the compiler finds all those includes.
See the Makefile of Ayam on how to collect all
necessary information to build -I directives.
The target csphere.so:
should provide enough information
on how to compile a custom object.
Compile your source with the -c switch. Then use the right switch for your compiler (-shared ?) to make a shared object (.so) from the .o(s) and you should be ready to test (>cc -shared -o foo.so foo.o).
Install the shared object along with the Tcl file containing the property GUI procedure and other stuff.
To load a custom object use the appropriate menu entry in the File menu
or the io_lc (load custom) command. Both methods will automatically
change the working directory to the location of the shared object to allow
it to find the accompanying Tcl script more easily. Do not use the
load
command of the Tcl core directly!
If you want your custom object to be loaded automatically
on startup of Ayam just create a small Tcl-script and load
that on startup using the preference setting Prefs/Main/Scripts
.
Example:
# this script loads the mfio-plugin into Ayam io_lc /home/randi/ays/plugins/mfio.so return