| 353 | } |
| 354 | |
| 355 | void ofxLua::scriptMousePressed(int x, int y, int button) { |
| 356 | if(L == NULL || !isFunction("mousePressed")) { |
| 357 | return; |
| 358 | } |
| 359 | lua_getglobal(L, "mousePressed"); |
| 360 | lua_pushinteger(L, x); |
| 361 | lua_pushinteger(L, y); |
| 362 | lua_pushinteger(L, button); |
| 363 | if(lua_pcall(L, 3, 0, 0) != 0) { |
| 364 | std::string msg = "Error running mousePressed(): " |
| 365 | + (std::string) lua_tostring(L, LUA_STACK_TOP); |
| 366 | errorOccurred(msg); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | void ofxLua::scriptMouseReleased(int x, int y, int button) { |
| 371 | if(L == NULL || !isFunction("mouseReleased")) { |
no test coverage detected