This complete sample configures the application to the Lua based scripting plugin. Then it continues to test the scripting system by executing a small script which prints some text to the console.
#include <yapp/raf/yakeRaf.h> using namespace yake; /** Configuration of the application */ struct TheConfiguration : public raf::ApplicationConfiguration { virtual StringVector getLibraries() { return MakeStringVector() << "scriptingLua"; } virtual StringVector getScriptingSystems() { return MakeStringVector() << "lua"; } }; /** The mighty application itself! */ class TheApp : public raf::ExampleApplication<TheConfiguration> { public: TheApp() {} protected: virtual bool onInitialise() { scripting::IVM* pVM = getScriptingSystem("lua")->createVM(); pVM->execute("print('Hello from script!')"); delete pVM; return true; } }; int main( int argc, char** argv ) { return (raf::runApplication( TheApp() )) ? 0 : 1; }
…