diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-20 21:44:07 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-20 21:44:07 +0000 |
commit | d8f71404ffd54af08bc84dbb04e60cb07e83a021 (patch) | |
tree | 51eea850a374f92569332ddb3bca7fcc021f6142 /util.c | |
parent | 2fd16cbf190d5c37fc627f79bf586f66129fea46 (diff) | |
download | libgraphics-d8f71404ffd54af08bc84dbb04e60cb07e83a021.tar.gz libgraphics-d8f71404ffd54af08bc84dbb04e60cb07e83a021.tar.bz2 libgraphics-d8f71404ffd54af08bc84dbb04e60cb07e83a021.zip |
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.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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) { |