diff options
| author | kkard2 <[email protected]> | 2025-09-07 15:55:17 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2025-09-07 15:55:17 +0200 |
| commit | 2e3a8b6b9b7c69a05b36286ef11bf4945e79c5b3 (patch) | |
| tree | 0745a93edf4c2f6bf13a9ee8eed7ef1e288c5c24 /examples | |
| parent | 45dd2bbab7ade35835075c7136b0473e6d8dcdb2 (diff) | |
triangle
Diffstat (limited to 'examples')
| -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); +} |
