--------------------------------------------------------------
| 12 | |
| 13 | //-------------------------------------------------------------- |
| 14 | void ofApp::setup() { |
| 15 | ofSetVerticalSync(true); |
| 16 | ofSetFrameRate(30); |
| 17 | ofSetLogLevel("ofxLua", OF_LOG_VERBOSE); |
| 18 | |
| 19 | // scripts to run |
| 20 | scripts.push_back("scripts/graphicsExample.lua"); |
| 21 | scripts.push_back("scripts/imageLoaderExample.lua"); |
| 22 | scripts.push_back("scripts/polygonExample.lua"); |
| 23 | scripts.push_back("scripts/fontsExample.lua"); |
| 24 | currentScript = 0; |
| 25 | |
| 26 | // init the lua state |
| 27 | lua.init(true); // true because we want to stop on an error |
| 28 | |
| 29 | // listen to error events |
| 30 | lua.addListener(this); |
| 31 | |
| 32 | // run a script |
| 33 | // true = change working directory to the script's parent dir |
| 34 | // so lua will find scripts with relative paths via require |
| 35 | // note: changing dir does *not* affect the OF data path |
| 36 | lua.doScript(scripts[currentScript], true); |
| 37 | |
| 38 | // call the script's setup() function |
| 39 | lua.scriptSetup(); |
| 40 | } |
| 41 | |
| 42 | //-------------------------------------------------------------- |
| 43 | void ofApp::update() { |
nothing calls this directly
no test coverage detected