From d8f71404ffd54af08bc84dbb04e60cb07e83a021 Mon Sep 17 00:00:00 2001 From: rodri Date: Fri, 20 Sep 2024 21:44:07 +0000 Subject: implement clipped drawing. take branching out of the upscaler loop. the rasterizers now produce a bbox of used fragments/pixels that are unified at the end of every job/frame. we use that when drawing so only the part that was rasterized gets sent to devdraw. --- util.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index e7a9544..babaaf4 100644 --- a/util.c +++ b/util.c @@ -8,6 +8,24 @@ #include "graphics.h" #include "internal.h" +Point +minpt(Point a, Point b) +{ + return (Point){ + min(a.x, b.x), + min(a.y, b.y) + }; +} + +Point +maxpt(Point a, Point b) +{ + return (Point){ + max(a.x, b.x), + max(a.y, b.y) + }; +} + Point2 modulapt2(Point2 a, Point2 b) { -- cgit v1.2.3