diff --git a/examples/wavy.glsl b/examples/wavy.glsl index 95a73c1..2c5a3a0 100644 --- a/examples/wavy.glsl +++ b/examples/wavy.glsl @@ -28,5 +28,5 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) { //hor_lines = sin(iTime * 3.0 +hor_lines * 2.0 + uv.y / 50.0); //fragColor = vec4(uv.x, uv.y, 1.0, 1.0); - fragColor = vec4(hor_lines * 0.7, inverse_distance, inverse_distance, 1.0); + fragColor = vec4(hor_lines * 0.7, inverse_distance * 0.55, inverse_distance * 0.75, 1.0); } diff --git a/glonkers.c b/glonkers.c index 632deea..9f7c0b0 100644 --- a/glonkers.c +++ b/glonkers.c @@ -11,6 +11,10 @@ #include "wayland.h" #include +void print_help(FILE *channel, char *bin_path) { + fprintf(channel, "Usage: %s [OPTION]... [PATH]\n", bin_path); +} + int main(int argc, char *argv[]) { char *shader_path = NULL; int output_type = OUTPUT_WINDOW; @@ -19,7 +23,11 @@ int main(int argc, char *argv[]) { int output_count; // syntax: --window for a normal window or --layer for a wallpaper for (int i = 1; i < argc; i++) { - if (strcmp("--window", argv[i]) == 0) { + if (strcmp("--help", argv[i]) == 0) { + print_help(stdout, argv[0]); + return 0; + } + else if (strcmp("--window", argv[i]) == 0) { output_type = OUTPUT_WINDOW; currently_reading_output = false; } @@ -41,14 +49,15 @@ int main(int argc, char *argv[]) { else if (!currently_reading_output) { // path to fragment shader if (shader_path != NULL) { - fprintf(stderr, "tried supplying '%s' as a shader file while one has already been selected\n", argv[i]); + fprintf(stderr, "Tried supplying '%s' as a shader file while one has already been selected.\n", argv[i]); return 1; } shader_path = argv[i]; } } if (shader_path == NULL) { - printf("need to supply path to shader\n"); + fprintf(stderr, "Need to supply path to shader!\n"); + print_help(stderr, argv[0]); return 1; }