--------------------------------------------------------------------
| 284 | |
| 285 | //-------------------------------------------------------------------- |
| 286 | void ofxLua::scriptWindowResized(int w, int h) { |
| 287 | if(L == NULL || !isFunction("windowResized")) { |
| 288 | return; |
| 289 | } |
| 290 | lua_getglobal(L, "windowResized"); |
| 291 | lua_pushinteger(L, w); |
| 292 | lua_pushinteger(L, h); |
| 293 | if(lua_pcall(L, 2, 0, 0) != 0) { |
| 294 | std::string msg = "Error running windowResized(): " |
| 295 | + (std::string) lua_tostring(L, LUA_STACK_TOP); |
| 296 | errorOccurred(msg); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | void ofxLua::scriptKeyPressed(int key) { |
| 301 | if(L == NULL || !isFunction("keyPressed")) { |
no test coverage detected