summaryrefslogtreecommitdiff
path: root/tests/test_stroke.c
diff options
context:
space:
mode:
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;
+}