Download Tutorial C Files H Files

dg_fb_putrectangle

This function draw a rectangle in a framebuffer.

Usage

void dg_fb_putrectangle(dg_framebuffer_t *fb, sfVector2u position, sfVector2u size, sfColor color);

Exemple

dg_fb_putrectangle(fb, pos, size, sfBlue);

Source code

void dg_fb_putrectangle(dg_framebuffer_t *fb, sfVector2u position,
                    sfVector2u size, sfColor color)
{
    for (int i = position.x; i < position.x + size.x; i++)
        for (int j = position.y; j < position.y + size.y; j++)
            dg_fb_putpx(fb, i, j, color);
}