<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> <html> <!-- Created by texi2html 1.76 --> <!-- Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) Karl Berry <karl@freefriends.org> Olaf Bachmann <obachman@mathematik.uni-kl.de> and many others. Maintained by: Many creative people <dev@texi2html.cvshome.org> Send bugs and suggestions to <users@texi2html.cvshome.org> --> <head> <title>Crystal Space 1.2.1: 4.18 Scripting Languages</title> <meta name="description" content="Crystal Space 1.2.1: 4.18 Scripting Languages"> <meta name="keywords" content="Crystal Space 1.2.1: 4.18 Scripting Languages"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2html 1.76"> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} pre.display {font-family: serif} pre.format {font-family: serif} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: serif; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: serif; font-size: smaller} pre.smalllisp {font-size: smaller} span.sansserif {font-family:sans-serif; font-weight:normal;} ul.toc {list-style: none} --> </style> </head> <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <a name="Scripting-Languages"></a> <a name="0"></a> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="Playing-Sound.html#0" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="iScript-Interface.html#0" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="Working-with-Engine-Content.html#0" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="index.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[<a href="cs_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> <td valign="middle" align="left">[<a href="cs_Index.html#0" title="Index">Index</a>]</td> <td valign="middle" align="left">[<a href="cs_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <hr size="1"> <h2 class="section"> 4.18 Scripting Languages </h2> <p><em>Written by Eric Sunshine, <a href="mailto:sunshine@sunshineco.com">sunshine@sunshineco.com</a>.</em> </p> <p>Crystal Space features bindings for several popular scripting and higher-level languages. The list of languages includes Java, Perl, and Python. </p> <p>Some scripting language bindings also have corresponding 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 <samp>‘iScript’</samp> interface (see section <a href="iScript-Interface.html#0">The iScript Interface</a>), 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 <em>exported</em> to the scripting side with the bindings. </p> <p>Some of the bindings are available as <em>pure</em> scripting modules which can be <em>imported</em> 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: </p> <p><code>${prefix}/share/crystalspace/bindings</code> </p> <p>where ${prefix} is the installation location (typically, <tt>‘/usr/local’</tt>). If you have not installed Crystal Space, then see the various subdirectories of <tt>‘CS/scripts’</tt>. </p> <p>Crystal Space uses Swig (<a href="http://www.swig.org/">http://www.swig.org/</a>) to generate its language bindings. The technology has been generalized enough that the supported languages share a common Swig interface definition (<tt>‘include/bindings/cspace.i’</tt>). Each language also has its own specific definition files (<tt>‘include/bindings/*/*.i’</tt>). Because the binding definitions are generalized, it should be possible to leverage off of <tt>‘include/bindings/cspace.i’</tt> to create additional Crystal Space bindings for any of the other languages supported by Swig with a minimal amount of effort. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top"><a href="iScript-Interface.html#0">4.18.1 The iScript Interface</a></td><td> </td><td align="left" valign="top"></td></tr> <tr><td align="left" valign="top"><a href="Java-Bindings.html#0">4.18.2 Java Bindings</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="Perl-Bindings.html#0">4.18.3 Perl Bindings</a></td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top"><a href="Python-Bindings.html#0">4.18.4 Python Bindings</a></td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr size="1"> <table cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">[<a href="Playing-Sound.html#0" title="Previous section in reading order"> < </a>]</td> <td valign="middle" align="left">[<a href="iScript-Interface.html#0" title="Next section in reading order"> > </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Beginning of this chapter or previous chapter"> << </a>]</td> <td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Up section"> Up </a>]</td> <td valign="middle" align="left">[<a href="Working-with-Engine-Content.html#0" title="Next chapter"> >> </a>]</td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left"> </td> <td valign="middle" align="left">[<a href="index.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> <td valign="middle" align="left">[<a href="cs_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> <td valign="middle" align="left">[<a href="cs_Index.html#0" title="Index">Index</a>]</td> <td valign="middle" align="left">[<a href="cs_abt.html#SEC_About" title="About (help)"> ? </a>]</td> </tr></table> <p> <font size="-1"> This document was generated using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>. </font> <br> </p> </body> </html>