示例#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 );
                                                      } ) );
}
示例#2
0
GestureManager::GestureManager( const ci::app::WindowRef &window )
: mIsPanning( false )
{
	App::get()->getSignalUpdate().connect( bind( &GestureManager::update, this ) );
	window->getSignalTouchesBegan().connect( -5, bind( &GestureManager::touchesBegan, this, placeholders::_1 ) );
	window->getSignalTouchesMoved().connect( -5, bind( &GestureManager::touchesMoved, this, placeholders::_1 ) );
	window->getSignalTouchesEnded().connect( -5, bind( &GestureManager::touchesEnded, this, placeholders::_1 ) );
}
示例#3
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();
  } ) );
}