Added option to vertically flip bars output, see #64

This commit is contained in:
Jarcode
2018-10-03 17:21:53 -07:00
parent 14747b1e75
commit 8102f99683
2 changed files with 8 additions and 3 deletions

View File

@@ -24,4 +24,6 @@
#define DIRECTION 0 #define DIRECTION 0
/* Whether to switch left/right audio buffers */ /* Whether to switch left/right audio buffers */
#define INVERT 0 #define INVERT 0
/* Whether to flip the output vertically */
#define FLIP 0

View File

@@ -29,9 +29,12 @@ out vec4 fragment;
#define PI 3.14159265359 #define PI 3.14159265359
void main() { void main() {
float /* (x, magnitude) of fragment */ float dx = (gl_FragCoord.x - (screen.x / 2));
dx = (gl_FragCoord.x - (screen.x / 2)), #if FLIP == 0
d = gl_FragCoord.y; float d = gl_FragCoord.y;
#else
float d = screen.y - gl_FragCoord.y;
#endif
float nbars = floor((screen.x * 0.5F) / float(BAR_WIDTH + BAR_GAP)) * 2; float nbars = floor((screen.x * 0.5F) / float(BAR_WIDTH + BAR_GAP)) * 2;
float section = BAR_WIDTH + BAR_GAP; /* size of section for each bar (including gap) */ float section = BAR_WIDTH + BAR_GAP; /* size of section for each bar (including gap) */
float center = section / 2.0F; /* half section, distance to center */ float center = section / 2.0F; /* half section, distance to center */