Exemplo n.º 1
0
bool Channel::update( const uint128_t& frameID, const uint32_t frameNumber )
{
    if( !isRunning( ))
        return false; // not updated

    EQASSERT( isActive( ))
    EQASSERT( getWindow()->isActive( ));

    ChannelFrameStartPacket startPacket;
    startPacket.frameNumber = frameNumber;
    startPacket.version     = getVersion();
    _setupRenderContext( frameID, startPacket.context );

    send( startPacket );
    EQLOG( LOG_TASKS ) << "TASK channel " << getName() << " start frame  " 
                       << &startPacket << std::endl;

    bool updated = false;
    const Compounds& compounds = getCompounds();
    for( Compounds::const_iterator i = compounds.begin();
         i != compounds.end(); ++i )
    {
        const Compound* compound = *i;
        ChannelUpdateVisitor visitor( this, frameID, frameNumber );

        visitor.setEye( EYE_CYCLOP );
        compound->accept( visitor );

        visitor.setEye( EYE_LEFT );
        compound->accept( visitor );

        visitor.setEye( EYE_RIGHT );
        compound->accept( visitor );
        
        updated |= visitor.isUpdated();
    }

    ChannelFrameFinishPacket finishPacket;
    finishPacket.frameNumber = frameNumber;
    finishPacket.context = startPacket.context;

    send( finishPacket );
    EQLOG( LOG_TASKS ) << "TASK channel " << getName() << " finish frame  "
                           << &finishPacket << std::endl;
    _lastDrawCompound = 0;

    return updated;
}
Exemplo n.º 2
0
bool Channel::update( const uint128_t& frameID, const uint32_t frameNumber )
{
    if( !isRunning( ))
        return false; // not updated

    LBASSERT( isActive( ))
    LBASSERT( getWindow()->isActive( ));

    RenderContext context;
    _setupRenderContext( frameID, context );
    send( fabric::CMD_CHANNEL_FRAME_START )
            << context << getVersion() << frameNumber;
    LBLOG( LOG_TASKS ) << "TASK channel " << getName() << " start frame  "
                       << frameNumber << std::endl;

    bool updated = false;
    const Compounds& compounds = getCompounds();
    for( Compounds::const_iterator i = compounds.begin();
         i != compounds.end(); ++i )
    {
        const Compound* compound = *i;
        ChannelUpdateVisitor visitor( this, frameID, frameNumber );

        visitor.setEye( EYE_CYCLOP );
        compound->accept( visitor );

        visitor.setEye( EYE_LEFT );
        compound->accept( visitor );

        visitor.setEye( EYE_RIGHT );
        compound->accept( visitor );

        updated |= visitor.isUpdated();
    }

    send( fabric::CMD_CHANNEL_FRAME_FINISH ) << context << frameNumber;
    LBLOG( LOG_TASKS ) << "TASK channel " << getName() << " finish frame  "
                           << frameNumber << std::endl;
    _lastDrawCompound = 0;

    return updated;
}