diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index b9ee621..3e6fc7f 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -16,9 +16,12 @@ Application::Application(){ // TODO: Get rid of listeners, pipe application events from the example app ofAddListener(ofEvents().keyPressed, this, &Application::onKeyPressed); ofAddListener(ofEvents().keyReleased, this, &Application::onKeyReleased); + + /* ofAddListener(ofEvents().mousePressed, this, &Application::onMousePressed); ofAddListener(ofEvents().mouseReleased, this, &Application::onMouseReleased); ofAddListener(ofEvents().mouseDragged, this, &Application::onMouseDragged); + */ ofAddListener(Gui::instance()->jointPressedEvent, this, &Application::onJointPressed); ofAddListener(Gui::instance()->surfacePressedEvent, this, &Application::onSurfacePressed); diff --git a/src/Surfaces/BaseSurface.cpp b/src/Surfaces/BaseSurface.cpp index 039bf81..0425569 100644 --- a/src/Surfaces/BaseSurface.cpp +++ b/src/Surfaces/BaseSurface.cpp @@ -112,6 +112,10 @@ bool BaseSurface::getMoved(){ return _moved; } +float BaseSurface::getScale(){ + return _scale; +} + ofMesh & BaseSurface::getMesh(){ return mesh; } diff --git a/src/Surfaces/BaseSurface.h b/src/Surfaces/BaseSurface.h index b554d7b..c8c680d 100644 --- a/src/Surfaces/BaseSurface.h +++ b/src/Surfaces/BaseSurface.h @@ -44,8 +44,7 @@ class BaseSurface { BaseSource * getDefaultSource(); bool getMoved(); - - float getScale(){ return _scale; } + float getScale(); ofMesh & getMesh(); ofRectangle & getBoundingBox(); diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 15513e8..e6e81ca 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -14,6 +14,30 @@ void ofxPiMapper::draw(){ _application.draw(); } +void ofxPiMapper::mousePressed(int x, int y, int button){ + ofMouseEventArgs args; + args.x = x; + args.y = y; + args.button = button; + _application.onMousePressed(args); +} + +void ofxPiMapper::mouseReleased(int x, int y, int button){ + ofMouseEventArgs args; + args.x = x; + args.y = y; + args.button = button; + _application.onMouseReleased(args); +} + +void ofxPiMapper::mouseDragged(int x, int y, int button){ + ofMouseEventArgs args; + args.x = x; + args.y = y; + args.button = button; + _application.onMouseDragged(args); +} + void ofxPiMapper::registerFboSource(ofx::piMapper::FboSource & fboSource){ _application.addFboSource(fboSource); } diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 107feba..c5f61ac 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -39,6 +39,10 @@ class ofxPiMapper { void update(); void draw(); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void mouseDragged(int x, int y, int button); + void registerFboSource(ofx::piMapper::FboSource & fboSource); void registerFboSource(ofx::piMapper::FboSource * fboSource);