Skip to content
Snippets Groups Projects
Commit dd3f2e86 authored by ands's avatar ands
Browse files

opengl_animation: fixed define, added option to show/hide events

parent c172aa35
No related branches found
No related tags found
No related merge requests found
// 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment