Example #1
0
void DeleteVisualSurface2D(VisualSurface2D *surf)
{
    u32 i;
    ra_del(&surf->to_redraw);
    VS2D_ResetGraphics(surf);

    for (i=0; i<surf->alloc_contexts; i++)
        DeleteDrawableContext(surf->contexts[i]);

    free(surf->contexts);
    free(surf->nodes_to_draw);
    DeleteChain(surf->back_stack);
    DeleteChain(surf->view_stack);
    DeleteChain(surf->prev_nodes_drawn);
    VS2D_ResetSensors(surf);
    DeleteChain(surf->sensors);
    free(surf);
}
Example #2
0
void visual_del(GF_VisualManager *visual)
{
	ra_del(&visual->to_redraw);

	if (visual->raster_surface) visual->compositor->rasterizer->surface_delete(visual->raster_surface);
	visual->raster_surface = NULL;
	if (visual->raster_brush) visual->compositor->rasterizer->stencil_delete(visual->raster_brush);
	visual->raster_brush = NULL;

	while (visual->context) {
		DrawableContext *ctx = visual->context;
		visual->context = ctx->next;
		DeleteDrawableContext(ctx);
	}
	while (visual->prev_nodes) {
		struct _drawable_store *cur = visual->prev_nodes;
		visual->prev_nodes = cur->next;
		gf_free(cur);
	}

#ifndef GPAC_DISABLE_VRML
	if (visual->back_stack) BindableStackDelete(visual->back_stack);
	if (visual->view_stack) BindableStackDelete(visual->view_stack);
#endif /*GPAC_DISABLE_VRML*/

#ifndef GPAC_DISABLE_3D
	visual_3d_reset_graphics(visual);

#ifndef GPAC_DISABLE_VRML
	if (visual->navigation_stack) BindableStackDelete(visual->navigation_stack);
	if (visual->fog_stack) BindableStackDelete(visual->fog_stack);
#endif /*GPAC_DISABLE_VRML*/

	gf_list_del(visual->alpha_nodes_to_draw);
#endif
	gf_free(visual);
}