summaryrefslogtreecommitdiff
path: root/triangle.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-01-30 12:01:01 +0000
committerrodri <rgl@antares-labs.eu>2024-01-30 12:01:01 +0000
commit37da5f0a27740bb43bac67a2eb98f725beca975e (patch)
tree2e403bbd2f477e65c8b82f10e950721b4103c895 /triangle.c
parentdf792cbb5cf94abf0d286ebfd73bad9714dce509 (diff)
downloadlibgraphics-37da5f0a27740bb43bac67a2eb98f725beca975e.tar.gz
libgraphics-37da5f0a27740bb43bac67a2eb98f725beca975e.tar.bz2
libgraphics-37da5f0a27740bb43bac67a2eb98f725beca975e.zip
import the new renderer and clean things up.
i integrated the renderer i've been developing on the tinyrend repo and got rid of a bunch of stuff that's no longer necessary. also began structuring things to fit the new interface i have in mind. there are still some artifacts with the projection xforms that cause issues with clipping and division by zero.
Diffstat (limited to 'triangle.c')
-rw-r--r--triangle.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/triangle.c b/triangle.c
deleted file mode 100644
index 9c49651..0000000
--- a/triangle.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <u.h>
-#include <libc.h>
-#include <draw.h>
-#include <geometry.h>
-#include <graphics.h>
-
-Triangle
-Trian(int x0, int y0, int x1, int y1, int x2, int y2)
-{
- return (Triangle){Pt(x0, y0), Pt(x1, y1), Pt(x2, y2)};
-}
-
-Triangle
-Trianpt(Point p0, Point p1, Point p2)
-{
- return (Triangle){p0, p1, p2};
-};
-
-void
-triangle(Image *dst, Triangle t, int thick, Image *src, Point sp)
-{
- Point pl[4];
-
- pl[0] = t.p0;
- pl[1] = t.p1;
- pl[2] = t.p2;
- pl[3] = pl[0];
-
- poly(dst, pl, nelem(pl), 0, 0, thick, src, sp);
-}
-
-void
-filltriangle(Image *dst, Triangle t, Image *src, Point sp)
-{
- Point pl[3];
-
- pl[0] = t.p0;
- pl[1] = t.p1;
- pl[2] = t.p2;
-
- fillpoly(dst, pl, nelem(pl), 0, src, sp);
-}