Download Tutorial C Files H Files

dg_framebuffer_update

This function is used to update the framebuffer (to display it). If not used, the changes will not appear on the window.

Usage

void dg_framebuffer_update(dg_framebuffer_t *fb, sfRenderWindow *window);

Example

dg_framebuffer_update(fb, window);

Source code

void dg_framebuffer_update(dg_framebuffer_t *fb, sfRenderWindow *window)
{
    sfTexture_updateFromPixels((sfTexture *) sfSprite_getTexture(fb->sp),
                               fb->pixels, fb->width, fb->height, 0, 0);
    sfRenderWindow_drawSprite(window, fb->sp, NULL);
}