diff --git a/opengl_animation/warpzone_animation.c b/opengl_animation/warpzone_animation.c index fe7378663144371cfe8f06046189c6afeef9ddcd..ccfd43999f2006a02b9e02d067afd03abe140498 100644 --- a/opengl_animation/warpzone_animation.c +++ b/opengl_animation/warpzone_animation.c @@ -1,7 +1,7 @@ // Using legacy OpenGL to render our animated logo // ands -#define _BSD_SOURCE +#define _DEFAULT_SOURCE #include <unistd.h> #include <stdio.h> #include <math.h> @@ -100,6 +100,13 @@ static void draw_events(double time) int main(int argc, char **argv) { + if (argc < 2) + { + fprintf(stderr, "Usage: %s <events|noevents>", argv[0]); + exit(-1); + } + int show_events = argv[1][0] != 'n'; // lazy hack + // initialize window + opengl context SDL_Init(SDL_INIT_VIDEO); const SDL_VideoInfo* info = SDL_GetVideoInfo(); @@ -162,7 +169,7 @@ int main(int argc, char **argv) glRotatef(-90.0f, 0.0f, 0.0f, 1.0f); // beamer rotation glRotatef(180.0f, 0.0f, 1.0f, 0.0f); // horizontal "flip" - if ((int)(time/SWITCH_INTERVAL) & 1) + if (!show_events || (int)(time/SWITCH_INTERVAL) & 1) draw_logo(time); else draw_events(time);