コード例 #1
0
void
nsGLPbufferGLX::Destroy()
{
    sCurrentContextToken = nsnull;
    mThebesSurface = nsnull;

    if (mPbuffer) {
        gGLXWrap.fDestroyPbuffer(mDisplay, mPbuffer);
        mPbuffer = nsnull;
    }
}
コード例 #2
0
nsGLPbufferGLX::~nsGLPbufferGLX()
{
    MakeContextCurrent();
#ifndef GL_FRAMEBUFFER
#define GL_FRAMEBUFFER 0x8D40
#endif
    // workaround for segfault on glXDestroyContext
    mGLWrap.fBindFramebuffer(GL_FRAMEBUFFER, 0);

    Destroy();

    if (mPbuffer)
        gGLXWrap.fDestroyPbuffer(mDisplay, mPbuffer);
    if (mPbufferContext)
        gGLXWrap.fDestroyContext(mDisplay, mPbufferContext);
#if !(defined(MOZ_WIDGET_GTK2) && defined(MOZ_X11))
    if (mDisplay)
        XCloseDisplay(mDisplay);
#endif

    gActiveBuffers--;
    fprintf (stderr, "nsGLPbufferGLX: gActiveBuffers: %d\n", gActiveBuffers);
    fflush (stderr);
}