Added option to vertically flip bars output, see #64
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user