aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-05-03 13:32:48 +0000
committerrodri <rgl@antares-labs.eu>2024-05-03 13:32:48 +0000
commitb429311ed087ee7cf7fc7771a8e1834ea074f8da (patch)
treeef05d69723ebcdf89a2d8a25b069075b2b51fc63 /util.c
parentcf3e0cb65c03955ef18624a50b9e33c3f6e8c6e5 (diff)
downloadlibgraphics-b429311ed087ee7cf7fc7771a8e1834ea074f8da.tar.gz
libgraphics-b429311ed087ee7cf7fc7771a8e1834ea074f8da.tar.bz2
libgraphics-b429311ed087ee7cf7fc7771a8e1834ea074f8da.zip
add a general primitive with support for points, lines and triangles.
also got rid of the dependency on OBJ for the entire renderer, instead letting the user load a Model from any given OBJ. this modularity will allow for other formats to be used in the same way, relying on a single, internal representation for the entire pipeline.
Diffstat (limited to 'util.c')
-rw-r--r--util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/util.c b/util.c
index 0cd4354..e114da5 100644
--- a/util.c
+++ b/util.c
@@ -33,6 +33,26 @@ fmax(double a, double b)
}
void
+swapi(int *a, int *b)
+{
+ int t;
+
+ t = *a;
+ *a = *b;
+ *b = t;
+}
+
+void
+swappt(Point *a, Point *b)
+{
+ Point t;
+
+ t = *a;
+ *a = *b;
+ *b = t;
+}
+
+void
memsetd(double *p, double v, usize len)
{
double *dp;