Пример #1
0
void Window::configExit()
{
    WindowRef window = getCarbonWindow();
    setCarbonWindow( 0 );

    AGLContext context = getAGLContext();

    if( getIAttribute( WindowSettings::IATTR_HINT_FULLSCREEN ) == ON )
    {
        LBASSERT( !window );
        exitEventHandler();
    }
    else if( window )
    {
        Global::enterCarbon();
        aglSetWindowRef( context, 0 );
        DisposeWindow( window );
        Global::leaveCarbon();
    }

    configExitFBO();
    exitGLEW();

    if( context )
    {
        Global::enterCarbon();
        aglSetCurrentContext( 0 );
        aglDestroyContext( context );
        Global::leaveCarbon();
        setAGLContext( 0 );
    }

    LBVERB << "Destroyed AGL window and context" << std::endl;
}
Пример #2
0
void Window::configExit( )
{
    if( !_xDisplay ) 
        return;

    leaveNVSwapBarrier();
    configExitFBO();
    exitGLEW();

    glXMakeCurrent( _xDisplay, None, 0 );

    GLXContext context  = getGLXContext();
    XID        drawable = getXDrawable();

    setGLXContext( 0 );
    setXDrawable( 0 );
    XSync( _xDisplay, False ); // WAR assert in glXDestroyContext/xcb_io.c:183

    if( context )
        glXDestroyContext( _xDisplay, context );

    if( drawable )
    {
        if( getIAttribute( eq::Window::IATTR_HINT_DRAWABLE ) == PBUFFER )
            glXDestroyPbuffer( _xDisplay, drawable );
        else
            XDestroyWindow( _xDisplay, drawable );
    }

    EQINFO << "Destroyed GLX context and X drawable " << std::endl;
}