static void _glitz_agl_context_destroy (void *abstract_context) { glitz_agl_context_t *context = (glitz_agl_context_t *) abstract_context; glitz_agl_drawable_t *drawable = (glitz_agl_drawable_t *) context->base.drawable; if (drawable->thread_info->cctx == &context->base) { aglSetCurrentContext (NULL); drawable->thread_info->cctx = NULL; } aglDestroyContext (context->context); _glitz_context_fini (&context->base); free (context); }
static void _glitz_egl_context_destroy (void *abstract_context) { glitz_egl_context_t *context = (glitz_egl_context_t *) abstract_context; glitz_egl_surface_t *drawable = (glitz_egl_surface_t *) context->base.drawable; if (drawable->screen_info->display_info->thread_info->cctx == &context->base) { eglMakeCurrent (drawable->screen_info->display_info->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); drawable->screen_info->display_info->thread_info->cctx = NULL; } eglDestroyContext (drawable->screen_info->display_info->egl_display, context->egl_context); _glitz_context_fini (&context->base); free (context); }