summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/triangle.c10
-rw-r--r--examples/triangles.c10
2 files changed, 10 insertions, 10 deletions
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));
}
}
}