aboutsummaryrefslogtreecommitdiff
path: root/internal.h
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 /internal.h
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 'internal.h')
-rw-r--r--internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 213326d..a982f2c 100644
--- a/internal.h
+++ b/internal.h
@@ -1,7 +1,15 @@
+typedef struct Polygon Polygon;
typedef struct Tilerparam Tilerparam;
typedef struct Rasterparam Rasterparam;
typedef struct Rastertask Rastertask;
+struct Polygon
+{
+ Vertex *v;
+ ulong n;
+ ulong cap;
+};
+
struct Tilerparam
{
int id;
@@ -42,9 +50,15 @@ void berpvertex(Vertex*, Vertex*, Vertex*, Vertex*, Point3);
void delvattrs(Vertex*);
void fprintvattrs(int, Vertex*);
+/* clip */
+int clipprimitive(Primitive*);
+void rectclipline(Rectangle, Point*, Point*);
+
/* util */
int min(int, int);
int max(int, int);
+void swapi(int*, int*);
+void swappt(Point*, Point*);
void memsetd(double*, double, usize);
/* nanosec */