Ejemplo n.º 1
0
//
//  MARK: - RootNode
//
void RootNode::connect( ci::app::WindowRef window )
{
  storeConnection( window->getSignalTouchesBegan().connect( [this]( app::TouchEvent &event )
                                                           {
                                                             deepTouchesBegan( event );
                                                           } ) );
  storeConnection( window->getSignalTouchesMoved().connect( [this]( app::TouchEvent &event )
                                                           {
                                                             deepTouchesMoved( event );
                                                           } ) );
  storeConnection( window->getSignalTouchesEnded().connect( [this]( app::TouchEvent &event )
                                                           {
                                                             deepTouchesEnded( event );
                                                           } ) );

  storeConnection( window->getSignalMouseDown().connect( [this]( app::MouseEvent &event )
                                                        {
                                                          deepMouseDown( event );
                                                        } ) );
  storeConnection( window->getSignalMouseDrag().connect( [this]( app::MouseEvent &event )
                                                        {
                                                          deepMouseDrag( event );
                                                        } ) );
  storeConnection( window->getSignalMouseUp().connect( [this]( app::MouseEvent &event )
                                                      {
                                                        deepMouseUp( event );
                                                      } ) );
}
Ejemplo n.º 2
0
void connectWindow( ci::app::WindowRef window )
{
	sWindowConnections = {
		window->getSignalMouseDown().connect( mouseDown ),
		window->getSignalMouseUp().connect( mouseUp ),
		window->getSignalMouseDrag().connect( mouseDrag ),
		window->getSignalMouseMove().connect( mouseMove ),
		window->getSignalMouseWheel().connect( mouseWheel ),
		window->getSignalKeyDown().connect( keyDown ),
		window->getSignalKeyUp().connect( keyUp ),
		window->getSignalResize().connect( resize ),
	};
}
Ejemplo n.º 3
0
void PretzelRoot::connectSignals(ci::app::WindowRef window)
{
    if( !mMouseBeganCallback.isConnected() ){
        
        // uses default priority 0
        mMouseBeganCallback = window->getSignalMouseDown().connect(std::bind(&PretzelRoot::onMouseDown, this, std::placeholders::_1));
        mMouseDragCallback = window->getSignalMouseDrag().connect(std::bind(&PretzelRoot::onMouseDragged, this, std::placeholders::_1));
        mMouseEndCallback = window->getSignalMouseUp().connect(std::bind(&PretzelRoot::onMouseUp, this, std::placeholders::_1));
        mMouseMovedCallback = window->getSignalMouseMove().connect(std::bind(&PretzelRoot::onMouseMoved, this, std::placeholders::_1));
        mKeyDownCallback = window->getSignalKeyDown().connect(std::bind(&PretzelRoot::onKeyDown, this, std::placeholders::_1));
        mMouseWheelCallback = window->getSignalMouseWheel().connect(std::bind(&PretzelRoot::onMouseWheel, this, std::placeholders::_1));
        
        mUpdateCallback = ci::app::App::get()->getSignalUpdate().connect(std::bind(&PretzelRoot::update, this));
    }
}
Ejemplo n.º 4
0
void Quaternions::connect( ci::app::WindowRef window )
{
  auto change_orientations = [this] {
    auto apply_options = timeline( ).apply( &_apply_orientation );
    rotateMore( apply_options );

    auto append_options = timeline( ).append( &_append_orientation );
    rotateMore( append_options );
  };

  storeConnection( window->getSignalTouchesBegan().connect( [=] ( app::TouchEvent &event ) {
    change_orientations();
  } ) );

  storeConnection( window->getSignalMouseDown().connect( [=] ( app::MouseEvent &event ) {
    change_orientations();
  } ) );
}