Download Tutorial C Files H Files

dg_framebuffer_destroy

This function is used to free the framebuffer in the memory.

Usage

int dg_framebuffer_destroy(dg_framebuffer_t *fb)

Example

dg_framebuffer_destroy(fb);

Source code

int dg_framebuffer_destroy(dg_framebuffer_t *fb)
{
    free(fb->pixels);
    sfTexture_destroy((sfTexture *) sfSprite_getTexture(fb->sp));
    sfSprite_destroy(fb->sp);
    free(fb);
    return 0;
}