MCPcopy Create free account
hub / github.com/danomatika/ofxLua / setup

Method setup

luaExample/src/ofApp.cpp:14–40  ·  view source on GitHub ↗

--------------------------------------------------------------

Source from the content-addressed store, hash-verified

12
13//--------------------------------------------------------------
14void 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//--------------------------------------------------------------
43void ofApp::update() {

Callers

nothing calls this directly

Calls 4

initMethod · 0.80
addListenerMethod · 0.80
doScriptMethod · 0.80
scriptSetupMethod · 0.80

Tested by

no test coverage detected