[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.18 Scripting Languages

Written by Eric Sunshine, sunshine@sunshineco.com.

Crystal Space features bindings for several popular scripting and higher-level languages. The list of bindings includes Java, Perl, and Python.

Some scripting language bindings are available as Crystal Space plugins. These can be loaded like any other plugins, and allow your C++ program to interact with scripting code. Such plugins implement the `iScript' interface (see section The iScript Interface), and it is by this interface that C++ code communicates with the scripting side. Conversely, scripting code can interact with Crystal Space itself since most of the Crystal Space classes and interfaces have been exported to the scripting side.

In addition, some of the bindings are available as pure scripting modules which can be imported directly into scripting code. This particularly powerful facility allows you to create Crystal Space applications entirely in the scripting language without writing any C++ code at all. Examples of these types of scripts can be found in the installed scripting support directories at:

${prefix}/share/crystalspace/bindings

where ${prefix} is the installation location (typically, `/usr/local'). If you have not installed Crystal Space, then see the various subdirectories of `CS/scripts'.

Crystal Space uses Swig (http://www.swig.org/) as the basis of its language bindings. The technology has been generalized enough that the supported languages share a common Swig interface definition (`ivaria/cspace.i'). Each language also has its own specific definition files (`ivaria/*.i'). Because the binding definitions are generalized, it should be possible to leverage off of `ivaria/cspace.i' to create additional language bindings for Crystal Space (any supported by Swig) with a minimal amount of effort, as compared to creating new bindings from scratch.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated using texi2html 1.76.