ref: 4966f25444d343ade4a6fbdd29f6175f372da09d
parent: 310042a543077ffc1f2325c75e99a5e772b908ff
author: rodri <rgl@antares-labs.eu>
date: Sat Jul 13 11:38:51 EDT 2024
vis: add knobs to control culling.
--- a/vis.c
+++ b/vis.c
@@ -600,15 +600,27 @@
{
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 };
@@ -636,6 +648,15 @@
break;
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);