Beispiel #1
0
bool Window::configInitSystemWindow( const eq::uint128_t& initID )
{
#ifndef Darwin
    if( !eq::Window::configInitSystemWindow( initID ))
        return false;

    // OpenGL version is less than 2.0.
    if( !GLEW_EXT_framebuffer_object )
    {
        if( getDrawableConfig().accumBits )
            return true;

        configExitSystemWindow();
#endif
        // try with 64 bit accum buffer
        setIAttribute( eq::WindowSettings::IATTR_PLANES_ACCUM, 16 );
        if( eq::Window::configInitSystemWindow( initID ))
            return true;

        // no anti-aliasing possible
        setIAttribute( eq::WindowSettings::IATTR_PLANES_ACCUM, eq::AUTO );
        return eq::Window::configInitSystemWindow( initID );

#ifndef Darwin
    }
    return true;
#endif
}
Beispiel #2
0
//----------------------------------------------------------------------
// configInit
//----------------------------------------------------------------------
bool Window::configInit( const uint128_t& initID )
{
    if( !getPixelViewport().isValid( ))
    {
        sendError( ERROR_WINDOW_PVP_INVALID );
        return false;
    }

    LBASSERT( !_systemWindow );

    int glMajorVersion = 1;
    int glMinorVersion = 1;
    if( getPipe()->getSystemPipe()->getMaxOpenGLVersion() != AUTO )
    {
        float maj, min;
        min = modff( getPipe()->getSystemPipe()->getMaxOpenGLVersion(), &maj );
        glMajorVersion = static_cast< int >( maj );
        glMinorVersion = static_cast< int >( min*10.f );
    }

    if( getIAttribute( WindowSettings::IATTR_HINT_OPENGL_MAJOR ) == AUTO )
        setIAttribute( WindowSettings::IATTR_HINT_OPENGL_MAJOR, glMajorVersion);
    if( getIAttribute( WindowSettings::IATTR_HINT_OPENGL_MINOR ) == AUTO )
        setIAttribute( WindowSettings::IATTR_HINT_OPENGL_MINOR, glMinorVersion);

    return configInitSystemWindow( initID ) && configInitGL( initID );
}
Beispiel #3
0
bool Window::createTransferWindow()
{
    LBASSERT( _systemWindow );

    if( _transferWindow )
        return true;

    // create another (shared) osWindow with no drawable, restore original
    const int32_t drawable = getIAttribute( IATTR_HINT_DRAWABLE );
    setIAttribute( IATTR_HINT_DRAWABLE, OFF );

    const Pipe* pipe = getPipe();
    _transferWindow = pipe->getWindowSystem().createWindow( this );

    if( _transferWindow )
    {
        if( !_transferWindow->configInit( ))
        {
            LBWARN << "Transfer window initialization failed" << std::endl;
            delete _transferWindow;
            _transferWindow = 0;
        }
        else
            makeCurrentTransfer();
    }
    else
        LBERROR << "Window system " << pipe->getWindowSystem()
                << " not implemented or supported" << std::endl;

    setIAttribute( IATTR_HINT_DRAWABLE, drawable );
    makeCurrent();

    LBVERB << "Transfer window initialization finished" << std::endl;
    return _transferWindow != 0;
}
Beispiel #4
0
bool Window::configInit( const eq::uint128_t& initID )
{
#if 0
    setIAttribute( IATTR_PLANES_ALPHA,   8 ); // enforce visual with alpha
    setIAttribute( IATTR_PLANES_STENCIL, 8 ); // enforce visual with stencil
#endif

    return eq::Window::configInit( initID );
}
Beispiel #5
0
void Window::deleteTransferSystemWindow()
{
    if( !_transferWindow )
        return;

    const int32_t drawable = getIAttribute( IATTR_HINT_DRAWABLE );
    setIAttribute( IATTR_HINT_DRAWABLE, OFF );

    _transferWindow->configExit();

    delete _transferWindow;
    _transferWindow = 0;

    setIAttribute( IATTR_HINT_DRAWABLE, drawable );
}
Beispiel #6
0
bool Node::_cmdConfigInit( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );

    const NodeConfigInitPacket* packet = 
        command.get<NodeConfigInitPacket>();
    LBLOG( LOG_INIT ) << "Init node " << packet << std::endl;

    _state = STATE_INITIALIZING;

    _currentFrame  = packet->frameNumber;
    _unlockedFrame = packet->frameNumber;
    _finishedFrame = packet->frameNumber;
    _setAffinity();

    transmitter.start();
    setError( ERROR_NONE );
    NodeConfigInitReplyPacket reply;
    reply.result = configInit( packet->initID );

    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::DRAW_SYNC );

    _state = reply.result ? STATE_RUNNING : STATE_INIT_FAILED;

    commit();
    send( command.getNode(), reply );
    return true;
}
Beispiel #7
0
bool Window::configInit( const eq::uint128_t& initID )
{
    // Enforce alpha channel, since we need one for rendering
    setIAttribute( eq::WindowSettings::IATTR_PLANES_ALPHA, 8 );

    return eq::Window::configInit( initID );
}
Beispiel #8
0
bool Node::_cmdConfigInit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Init node " << command << std::endl;

    _impl->state = STATE_INITIALIZING;

    const uint128_t& initID = command.read< uint128_t >();
    const uint32_t frameNumber = command.read< uint32_t >();

    _impl->currentFrame  = frameNumber;
    _impl->unlockedFrame = frameNumber;
    _impl->finishedFrame = frameNumber;
    _setAffinity();

    _impl->transmitter.start();
    const uint64_t result = configInit( initID );

    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::DRAW_SYNC );

    _impl->state = result ? STATE_RUNNING : STATE_INIT_FAILED;

    commit();
    send( command.getRemoteNode(), fabric::CMD_NODE_CONFIG_INIT_REPLY )
            << result;
    return true;
}
Beispiel #9
0
Pipe::Pipe( Node* parent )
        : Super( parent )
        , _active( 0 )
        , _state( STATE_STOPPED )
        , _lastDrawWindow( 0 )
{
    const Global* global = Global::instance();
    for( unsigned i = 0; i < IATTR_LAST; ++i )
    {
        const IAttribute attr = static_cast< IAttribute >( i );
        setIAttribute( attr, global->getPipeIAttribute( attr ));
    }
}
Beispiel #10
0
bool Window::configInit( const eq::uint128_t& initId )
{
    std::stringstream windowTitle;
    windowTitle << "Livre " << livrecore::Version::getString();
    setName( windowTitle.str( ));

    // Enforce alpha channel, since we need one for rendering
    setIAttribute( eq::WindowSettings::IATTR_PLANES_ALPHA, 8 );
    if( !eq::Window::configInit( initId ))
        return false;

    _impl->configInit();
    return true;
}
Beispiel #11
0
Channel::Channel( Window* parent )
        : Super( parent )
        , _active( 0 )
        , _view( 0 )
        , _segment( 0 )
        , _state( STATE_STOPPED )
        , _lastDrawCompound( 0 )
{
    const Global* global = Global::instance();
    for( unsigned i = 0; i < IATTR_ALL; ++i )
    {
        const IAttribute attr = static_cast< IAttribute >( i );
        setIAttribute( attr, global->getChannelIAttribute( attr ));
    }
}
Beispiel #12
0
bool Pipe::configInit( const eq::uint128_t& initId )
{
    setIAttribute( IATTR_HINT_CUDA_GL_INTEROP, eq::ON );
    if( !eq::Pipe::configInit( initId ))
        return false;

    Config*         config      = static_cast<Config*>( getConfig( ));
    const InitData& initData    = config->getInitData();
    const lunchbox::UUID  frameDataId = initData.getFrameDataId();

    const bool mapped = config->mapObject( &_frameData, frameDataId );
    LBASSERT( mapped );

    return mapped;
}
Beispiel #13
0
bool Node::configInit( const eq::uint128_t& initID )
{
    if( !eq::Node::configInit( initID ))
        return false;

    // All render data is static or multi-buffered, we can run asynchronously
    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::ASYNC );

    Config* config = static_cast< Config* >( getConfig( ));
    if( !isApplicationNode() && !config->loadInitData( eq::UUID( initID )))
    {
        sendError( ERROR_EVOLVE_MAPOBJECT_FAILED );
        return false;
    }
    return true;
}
Beispiel #14
0
bool Node::configInit( const eq::uint128_t& initID )
{
    // All render data is static or multi-buffered, we can run asynchronously
    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::ASYNC );

    if( !eq::Node::configInit( initID ))
        return false;

    Config* config = static_cast< Config* >( getConfig( ));
    if( !config->mapData( initID ))
    {
        setError( ERROR_EQPLY_MAPOBJECT_FAILED );
        return false;
    }
    return true;
}
Beispiel #15
0
bool Node::configInit( const eq::uint128_t& initID )
{
    if( !eq::Node::configInit( initID ))
        return false;

    // All render data is static or multi-buffered, we can run
    // asynchronously
    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
    {
        setIAttribute( IATTR_THREAD_MODEL, eq::ASYNC );
    }

    Config* config = static_cast< Config* >( getConfig( ));
    config->mapData( initID );

    return true;
}
Beispiel #16
0
Window::Window( Pipe* parent ) 
        : Super( parent )
        , _active( 0 )
        , _state( STATE_STOPPED )
        , _maxFPS( std::numeric_limits< float >::max( ))
        , _nvSwapBarrier( 0 )
        , _nvNetBarrier( 0 )
        , _lastDrawChannel( 0 )
        , _swapFinish( false )
        , _swap( false )
{
    const Global* global = Global::instance();
    for( unsigned i = 0; i < IATTR_ALL; ++i )
    {
        const IAttribute attr = static_cast< IAttribute >( i );
        setIAttribute( attr, global->getWindowIAttribute( attr ));
    }
}
Beispiel #17
0
bool Node::configInit( const eq::uint128_t& initId )
{
    // All render data is static or multi-buffered, we can run asynchronously
    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::ASYNC );

    if( !eq::Node::configInit( initId ))
        return false;

    livre::Client* client = static_cast<livre::Client*>( getClient( ).get());
    client->setIdleFunction( std::bind( &detail::Node::updateAndSendFrameRange,
                                        _impl));

    if( !isApplicationNode( ))
    {
        Config *config = static_cast< Config *>( getConfig() );
        config->mapFrameData( initId );
    }

    return _impl->configInit();
}