示例#1
0
void glXDestroyContext(Display *pDisplay, GLXContext ctx)
{
    auto *pState = reinterpret_cast<OGL::State *>(ctx);

    if (contexts.find(pState) == currentContext)
    {
        currentContext = contexts.end();
    }

    contexts.erase(pState);

    OGL::Destroy(*pState);
    pState->~State();

    _aligned_free(pState);
}
示例#2
0
文件: wgl.cpp 项目: prabindh/openswr
WINGDIAPI BOOL WINAPI DrvDeleteContext(HGLRC hglrc)
{
    int rc = (int)hglrc;
    SWRContext &context = gContexts[rc];

    OGL::State *pState = context.pState;

    pState->~State();
    _aligned_free(pState);

    OGL::GetDDProcTable().pfnDestroyContext(OGL::GetDDHandle());
    gContexts.erase(rc);

    OGL::DestroyGlobals();

    return 1;
}