예제 #1
0
/* Delete a specific drawable */
static WSEGLError wseglDeleteDrawable(WSEGLDrawableHandle _drawable)
{
    PvrQwsDrawable *drawable = (PvrQwsDrawable *)_drawable;
    if (!drawable || drawable->type == PvrQwsScreen)
        return WSEGL_SUCCESS;
    if (pvrQwsDisplay.numFlipBuffers == 0)
        pvrQwsFreeBuffers(drawable);
    if (pvrQwsReleaseWindow(drawable))
        pvrQwsDestroyDrawable(drawable);
    return WSEGL_SUCCESS;
}
예제 #2
0
static void pvrQwsDestroyDrawableForced(PvrQwsDrawable *drawable)
{
    /* Remove the drawable from the display's winId list */
    PvrQwsDrawable *current = pvrQwsDisplay.firstWinId;
    PvrQwsDrawable *prev = 0;
    while (current != 0 && current != drawable) {
        prev = current;
        current = current->nextWinId;
    }
    if (current != 0) {
        if (prev)
            prev->nextWinId = current->nextWinId;
        else
            pvrQwsDisplay.firstWinId = current->nextWinId;
    }

    pvrQwsFreeBuffers(drawable);
    free(drawable);

    --pvrQwsDisplay.numDrawables;
    if (pvrQwsDisplay.numDrawables == 0)
        pvrQwsDestroyContext();
}