diff options
author | rodri <rgl@antares-labs.eu> | 2024-05-03 13:32:48 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-05-03 13:32:48 +0000 |
commit | b429311ed087ee7cf7fc7771a8e1834ea074f8da (patch) | |
tree | ef05d69723ebcdf89a2d8a25b069075b2b51fc63 /internal.h | |
parent | cf3e0cb65c03955ef18624a50b9e33c3f6e8c6e5 (diff) | |
download | libgraphics-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.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 */ |