From dd3f2e86d31c5f4e966f25995660811f36b85119 Mon Sep 17 00:00:00 2001
From: ands <ands>
Date: Sat, 18 Oct 2014 22:44:47 +0200
Subject: [PATCH] opengl_animation: fixed define, added option to show/hide
 events

---
 opengl_animation/warpzone_animation.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/opengl_animation/warpzone_animation.c b/opengl_animation/warpzone_animation.c
index fe73786..ccfd439 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);
-- 
GitLab