From a554485534c83c2ecfa98f8c651ad957358a4034 Mon Sep 17 00:00:00 2001 From: kkard2 Date: Sun, 14 Sep 2025 11:56:10 +0200 Subject: finish refactor (triangles) --- examples/triangle.c | 10 +++++----- examples/triangles.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/triangle.c b/examples/triangle.c index a39ee1b..a3559e9 100644 --- a/examples/triangle.c +++ b/examples/triangle.c @@ -6,7 +6,7 @@ static int32_t offset = 0; void init() {} void draw_frame(sponge_Texture c) { - sponge_clear(c, 0xFF000000); + sponge_clear(c, sponge_color32_make(0xFF000000)); offset += SPEED; if (offset > 100) @@ -14,8 +14,8 @@ void draw_frame(sponge_Texture c) { sponge_draw_triangle_col3( c, - 30, 30 + offset, - c.width - 30, 50 + offset, - 30, c.height - 30 + offset, - 0xFFFF0000, 0xFF00FF00, 0xFF0000FF); + sponge_vec2i_make(30, 30 + offset), + sponge_vec2i_make(c.width - 30, 50 + offset), + sponge_vec2i_make(30, c.height - 30 + offset), + sponge_colorf_make(0xFFFF0000), sponge_colorf_make(0xFF00FF00), sponge_colorf_make(0xFF0000FF)); } diff --git a/examples/triangles.c b/examples/triangles.c index 8515a28..271de5f 100644 --- a/examples/triangles.c +++ b/examples/triangles.c @@ -10,7 +10,7 @@ static int32_t speed = SPEED_ABS; void init() {} void draw_frame(sponge_Texture c) { - sponge_clear(c, 0xFF000000); + sponge_clear(c, sponge_color32_make(0xFF000000)); offset += speed; if (offset > 30) { @@ -29,10 +29,10 @@ void draw_frame(sponge_Texture c) { sponge_draw_triangle_col3( c, - x, y + offset_y, - x + offset_x, y, - x + (offset_x * 3 / 4), y + (offset_y * 3 / 4), - 0xFFFF0000, 0xFF00FF00, 0xFF0000FF); + sponge_vec2i_make(x, y + offset_y), + sponge_vec2i_make(x + offset_x, y), + sponge_vec2i_make(x + (offset_x * 3 / 4), y + (offset_y * 3 / 4)), + sponge_colorf_make(0xFFFF0000), sponge_colorf_make(0xFF00FF00), sponge_colorf_make(0xFF0000FF)); } } } -- cgit v1.3.1