示例#1
0
bool Window::createTransferWindow()
{
    LB_TS_THREAD( _pipeThread );
    LBASSERT( _systemWindow );

    if( _transferWindow )
        return true;

    // create another (shared) osWindow with no drawable
    WindowSettings settings = getSettings();
    settings.setIAttribute( WindowSettings::IATTR_HINT_DRAWABLE, OFF );
    const SystemWindow* sysWindow = _sharedContextWindow ?
                                    _sharedContextWindow->getSystemWindow() : 0;
    settings.setSharedContextWindow( sysWindow );
    const Pipe* pipe = getPipe();
    _transferWindow = pipe->getWindowSystem().createWindow( this, settings );

    if( _transferWindow )
    {
        if( !_transferWindow->configInit( ))
        {
            LBWARN << "Transfer window initialization failed" << std::endl;
            delete _transferWindow;
            _transferWindow = 0;
        }
        else
        {
            // #177: It looks like the driver realizes the context on the first
            // makeCurrent
            _transferWindow->makeCurrent();
            _transferWindow->doneCurrent();
        }
    }
    else
        LBERROR << "Window system " << pipe->getWindowSystem()
                << " not implemented or supported" << std::endl;

    makeCurrent();

    LBVERB << "Transfer window initialization finished" << std::endl;
    return _transferWindow != 0;
}
示例#2
0
bool Window::configInitSystemWindow( const uint128_t& )
{
    const Pipe* pipe = getPipe();
    WindowSettings settings = getSettings();
    const SystemWindow* sysWindow = _sharedContextWindow ?
                                    _sharedContextWindow->getSystemWindow() : 0;
    settings.setSharedContextWindow( sysWindow );
    SystemWindow* systemWindow =
        pipe->getWindowSystem().createWindow( this, settings );

    LBASSERT( systemWindow );
    if( !systemWindow->configInit( ))
    {
        LBWARN << "System window initialization failed" << std::endl;
        systemWindow->configExit();
        delete systemWindow;
        return false;
    }

    setPixelViewport( systemWindow->getPixelViewport( ));
    setSystemWindow( systemWindow );
    return true;
}