Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Changes

Jump to: navigation, search

Howto:Extend Nasal

528 bytes added, 17:15, 27 June 2012
m
Passing Pointers to Nasal scripts
naRef naNumValue(naRef n);
naRef naStringValue(naContext c, naRef n);
 
= Wrapping Classes as Nasal Objects (ghosts) =
To be written by Hooray & Zakalawe. For the time being, it's a good idea to take a look at the FGPositioned wrappers for the navdb to see how this is done in Nasal, see [https://gitorious.org/fg/flightgear/blobs/next/src/Scripting/NasalPositioned.cxx $FG_SRC/Scripting/NasalPositioned.cxx].
 
There's a plan to eventually unify all those helpers and provide them as part of the FGNasalSys class, so that they automatically become available to all users of the Nasal subsystem.
= Passing Pointers to Nasal scripts =
This needs to be specifically implemented for each new "ghost" type.
For an example of how something like this is done in the FlightGear context, you may want to check out $FG_SRC/Scripting/nasal-props.cxx, which wraps the SGPropertyNode class ([[SimGear]]) inside a nasal ghost, so that the C++ class is exposed to Nasal scripts.
= Locking a Nasal context (threading) =
18,253
edits

Navigation menu