Nasal/CppBind: Difference between revisions

Jump to navigation Jump to search
m
m (not working on it ATM)
Line 73: Line 73:


<syntaxhighlight lang="cpp" enclose="div">
<syntaxhighlight lang="cpp" enclose="div">
if( !NasalDemo::isInit() )
initNasalDemo(_globals, _context);
initNasalDemo(_globals, _context);
</syntaxhighlight>
</syntaxhighlight>


Line 146: Line 145:
// to call the code, add this to FGNasalSys::init():
// to call the code, add this to FGNasalSys::init():
/*
/*
if( !NasalDemo::isInit() )
  initNasalDemo(_globals, _context);
  initNasalDemo(_globals, _context);
*/
*/
Line 153: Line 150:
naRef initNasalDemo(naRef globals, naContext c)
naRef initNasalDemo(naRef globals, naContext c)
{
{
  if(NasalDemo::isInit() ) return; // avoid re-init during reset/re-init
     // This only needs to be called once for each ghost, so make sure to use the ::isInit() check in FGNasalSys::init()
     // This only needs to be called once for each ghost, so make sure to use the ::isInit() check in FGNasalSys::init()
     NasalTest::init("Test") // this is the ghost's symbol used in error messages/diagnostics (it is NOT the namespace/symbol used by nasal code!)
     NasalTest::init("Test") // this is the ghost's symbol used in error messages/diagnostics (it is NOT the namespace/symbol used by nasal code!)

Navigation menu