http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.14.tar.gz
[xscreensaver] / hacks / glx / stonerview.c
1 /* StonerView: An eccentric visual toy.
2    Copyright 1998-2001 by Andrew Plotkin (erkyrath@eblong.com)
3
4    For the latest version, source code, and links to more of my stuff, see:
5    http://www.eblong.com/zarf/stonerview.html
6
7    Permission to use, copy, modify, distribute, and sell this software and its
8    documentation for any purpose is hereby granted without fee, provided that
9    the above copyright notice appear in all copies and that both that
10    copyright notice and this permission notice appear in supporting
11    documentation.  No representations are made about the suitability of this
12    software for any purpose.  It is provided "as is" without express or 
13    implied warranty.
14 */
15
16 /* Ported away from GLUT (so that it can do `-root' and work with xscreensaver)
17    by Jamie Zawinski <jwz@jwz.org>, 22-Jan-2001.
18  */
19
20 #include "config.h"
21
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <sys/time.h>
25
26 #include <GL/gl.h>
27
28 #include "yarandom.h"
29 #include "usleep.h"
30 #include "stonerview-move.h"
31
32 extern int init_view(int *argc, char *argv[]);
33 extern void win_draw(void);
34
35
36 int main(int argc, char *argv[])
37 {
38
39   /* Randomize -- only need to do this here because this program
40      doesn't use the `screenhack.h' or `lockmore.h' APIs. */
41 # undef ya_rand_init
42   ya_rand_init (0);
43
44   if (!init_view(&argc, argv))
45     return -1;
46   if (!init_move())
47     return -1;
48
49   while (1)
50     {
51       win_draw();
52       move_increment();
53       usleep (20000);
54     }
55
56   return 0;
57 }