diff options
Diffstat (limited to 'examples/triangle.c')
| -rw-r--r-- | examples/triangle.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/triangle.c b/examples/triangle.c new file mode 100644 index 0000000..452dc94 --- /dev/null +++ b/examples/triangle.c @@ -0,0 +1,23 @@ +#include <math.h> + +#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); +} |
