summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-07-13 15:38:51 +0000
committerrodri <rgl@antares-labs.eu>2024-07-13 15:38:51 +0000
commit4966f25444d343ade4a6fbdd29f6175f372da09d (patch)
treebafce14916a462f155c17040cf0e3a5d085bae18
parent310042a543077ffc1f2325c75e99a5e772b908ff (diff)
download3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.tar.gz
3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.tar.bz2
3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.zip
vis: add knobs to control culling.
-rw-r--r--vis.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index 85aa01c..c9aca97 100644
--- a/vis.c
+++ b/vis.c
@@ -600,15 +600,27 @@ mmb(void)
{
enum {
MOVELIGHT,
+ SP0,
TSNEAREST,
TSBILINEAR,
+ SP1,
SHOWNORMALS,
+ SP2,
+ CULLFRONT,
+ CULLBACK,
+ CULLNO,
};
static char *items[] = {
[MOVELIGHT] "move light",
+ "",
[TSNEAREST] "use nearest sampler",
[TSBILINEAR] "use bilinear sampler",
+ "",
[SHOWNORMALS] "show normals",
+ "",
+ [CULLFRONT] "cull front faces",
+ [CULLBACK] "cull back faces",
+ [CULLNO] "no culling",
nil,
};
static Menu menu = { .item = items };
@@ -637,6 +649,15 @@ mmb(void)
case SHOWNORMALS:
shownormals ^= 1;
break;
+ case CULLFRONT:
+ maincam->cullmode = CullFront;
+ break;
+ case CULLBACK:
+ maincam->cullmode = CullBack;
+ break;
+ case CULLNO:
+ maincam->cullmode = CullNone;
+ break;
}
unlockdisplay(display);
nbsend(drawc, nil);