summaryrefslogtreecommitdiff
path: root/examples/triangle.c
blob: a39ee1b057fd2a81fc0fbd44008b68a8f0f86295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "../sponge.h"

#define SPEED (4)
static int32_t offset = 0;

void init() {}

void draw_frame(sponge_Texture c) {
    sponge_clear(c, 0xFF000000);
    offset += SPEED;

    if (offset > 100)
        offset = -100;

    sponge_draw_triangle_col3(
        c,
        30, 30 + offset,
        c.width - 30, 50 + offset,
        30, c.height - 30 + offset,
        0xFFFF0000, 0xFF00FF00, 0xFF0000FF);
}