From 82888bed1931e83ed1401485033cb9f7acdadc94 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 13 Jul 2024 15:18:19 +0000 Subject: enable culling and add a camera knob for it. --- graphics.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'graphics.h') diff --git a/graphics.h b/graphics.h index 47a41cd..132b57b 100644 --- a/graphics.h +++ b/graphics.h @@ -6,24 +6,27 @@ typedef enum { } Projection; enum { - PPoint, + /* culling modes */ + CullNone, + CullFront, + CullBack, + + /* primitive types */ + PPoint = 0, PLine, PTriangle, -}; -enum { - LIGHT_POINT, + /* light types */ + LIGHT_POINT = 0, LIGHT_DIRECTIONAL, LIGHT_SPOT, -}; -enum { - RAWTexture, /* unmanaged */ + /* texture formats */ + RAWTexture = 0, /* unmanaged */ sRGBTexture, -}; -enum { - VAPoint, + /* vertex attribute types */ + VAPoint = 0, VANumber, }; @@ -282,12 +285,12 @@ struct Camera } clip; Matrix3 proj; /* VCS to clip space xform */ Projection projtype; + int cullmode; struct { uvlong min, avg, max, acc, n, v; uvlong nframes; } stats; - struct { Rendertime R[100], E[100], Tn[100], Rn[100]; int cur; -- cgit v1.2.3