summaryrefslogtreecommitdiff
path: root/render.h
diff options
context:
space:
mode:
Diffstat (limited to 'render.h')
-rw-r--r--render.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/render.h b/render.h
index 3c8938f..e51478f 100644
--- a/render.h
+++ b/render.h
@@ -37,10 +37,23 @@ typedef struct Mesh {
typedef struct {
Colour* t;
int* d;
- int w, h, asp;
+ int asp, n;
+ int vp[4];
Rect clip;
} Renderer;
+int tri_os(
+ const Renderer* r,
+ const int* v0,
+ const int* v1,
+ const int* v2
+);
+int point_os(
+ const Renderer* r,
+ int x,
+ int y
+);
+
void ren_begin(Renderer* r, Colour* t, int* d, int w, int h);
void ren_end(Renderer* r);
void ren_clear(Renderer* r);
@@ -86,7 +99,14 @@ void ren_tri(
const int* v1,
const int* v2,
const Bitmap* tex
-);
+); /* Unsafe for 3D. Clips against the r->clip */
+void ren_tri3(
+ Renderer* r,
+ const int* v0,
+ const int* v1,
+ const int* v2,
+ const Bitmap* tex
+); /* Does perspective calculation and clips against the near. */
void ren_mesh(
Renderer* r,
const Mesh* mesh,