Howto:Add new fgcommands to FlightGear: Difference between revisions

Jump to navigation Jump to search
m
Line 161: Line 161:
   }
   }
   SG_LOG(SG_INPUT, SG_INFO, "Successfully read global preferences.");
   SG_LOG(SG_INPUT, SG_INFO, "Successfully read global preferences.");
  return true;
}
</syntaxhighlight>
== Hello World ==
<syntaxhighlight lang="cpp">
/**
* Built-in command: print hello world (name) to the console
*
* name (optional): the file name to load the panel from (relative
*
*/
static bool
do_hello_world (const SGPropertyNode * arg)
{
 
  try {
    SG_LOG(SG_GENERAL, SG_ALERT, "Hello World");
  } catch (const sg_exception &e) {
    guiErrorMessage("Error saying HELLO WORLD: ", e);
    return false;
  }
   return true;
   return true;
}
}

Navigation menu