20,741
edits
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Template:Nasal Internals}} | {{Template:Nasal Internals}} | ||
== Status (cppbind) == | |||
As of 03/2013, this article should be considered depreciated, we have a new C++-based API for exposing C/C++ functions/data structures to Nasal and vice versa in [https://gitorious.org/fg/simgear/trees/next/simgear/nasal/cppbind $SG_SRC/nasal/cppbind]. Usually, there should be no need to use the bare Nasal APIs anymore for exposing functions/data to Nasal or Nasal-space types to C++, except for people working on the '''cppbind''' framework itself. | |||
The cppbind framework is much more generic and high level than the bare APIs, it includes unit testing support and makes use of modern C++ features like templates and STL support, including SimGear specific types like SGPath etc, its overhead is fairly small (not just performance, but also LoC to create new bindings). | |||
The cppbind framework is already extensively used by the [[Canvas]] system, which is a good place to look for code examples. | |||
== Scope == | |||
This article is dedicated to describing how to write custom C/C++ extension functions in order to extend the [[Nasal]] scripting interpreter in FlightGear, for example in order to expose new or existing FlightGear APIs to the Nasal scripting engine, so that Nasal scripts can access additional FlightGear internals. | This article is dedicated to describing how to write custom C/C++ extension functions in order to extend the [[Nasal]] scripting interpreter in FlightGear, for example in order to expose new or existing FlightGear APIs to the Nasal scripting engine, so that Nasal scripts can access additional FlightGear internals. | ||