summaryrefslogtreecommitdiff
path: root/tests/test_stroke.c
diff options
context:
space:
mode:
authorRoberto Esteves <contact@robertoesteves.dev>2026-01-05 14:11:50 +0000
committerRoberto Esteves <contact@robertoesteves.dev>2026-01-05 14:11:50 +0000
commit52c6a7635056ee78d282ba2a55eb26f2663bb577 (patch)
tree9d37d851e63e96e53ef3836321f03d4f2839edef /tests/test_stroke.c
parentda12440cabe270584ff650703e90db540d2ec4c9 (diff)
refactor some stuff:HEADmaster
- add meson build system - refactor executable to be a test - remove stdlib from base library
Diffstat (limited to 'tests/test_stroke.c')
-rw-r--r--tests/test_stroke.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_stroke.c b/tests/test_stroke.c
new file mode 100644
index 0000000..1bcafd1
--- /dev/null
+++ b/tests/test_stroke.c
@@ -0,0 +1,33 @@
+#include "common_linux.h"
+
+int main(int argc, char *argv[]) {
+ RGL_Context ctx;
+ RGL_Buffer buf;
+
+ buf.width = 800;
+ buf.height = 600;
+
+ ArenaInit(&ctx.queue.arena, 0);
+ ctx.queue.commands = (RGL_Command *)ctx.queue.arena.data;
+
+ BufferAlloc(&buf);
+
+ ctx.color = RGL_COLOR(255, 255, 255, 255);
+
+ RGL_BeginPath(&ctx, PathStroke);
+ RGL_PathMoveTo(&ctx, 0, 0);
+ RGL_PathMoveTo(&ctx, 799, 599);
+ RGL_PathMoveTo(&ctx, 799, 0);
+ RGL_PathMoveTo(&ctx, 0, 599);
+ RGL_EndPath(&ctx);
+
+ RGL_Draw(&ctx, &buf);
+
+ if (WritePPM(buf, "output.ppm"))
+ return 1;
+
+ ArenaDestroy(&ctx.queue.arena);
+ BufferDestroy(&buf);
+
+ return 0;
+}