From http://www.jwz.org/xscreensaver/xscreensaver-5.31.tar.gz
[xscreensaver] / hacks / glx / stonerview.h
1 /* StonerView: An eccentric visual toy.
2    Copyright 1998-2001 by Andrew Plotkin (erkyrath@eblong.com)
3
4    Permission to use, copy, modify, distribute, and sell this software and its
5    documentation for any purpose is hereby granted without fee, provided that
6    the above copyright notice appear in all copies and that both that
7    copyright notice and this permission notice appear in supporting
8    documentation.  No representations are made about the suitability of this
9    software for any purpose.  It is provided "as is" without express or 
10    implied warranty.
11 */
12
13 #ifndef __STONERVIEW_H__
14 # define __STONERVIEW_H__
15
16 #ifdef HAVE_CONFIG_H
17 # include "config.h"
18 #endif /* HAVE_CONFIG_H */
19
20 typedef struct stonerview_state stonerview_state;
21
22 #include "stonerview-osc.h"
23 #include "stonerview-move.h"
24
25 struct stonerview_state {
26
27   int wireframe;
28   int transparent;
29
30   /* The list of polygons. This is filled in by move_increment(), and rendered
31      by perform_render(). */
32   int num_els;
33   stonerview_elem_t *elist;
34
35   /* A linked list of all osc_t objects created. New objects are added
36      to the end of the list, not the beginning. */
37   osc_t *oscroot;
38   osc_t **osctail;
39
40   /* The polygons are controlled by four parameters. Each is represented by
41      an osc_t object, which is just something that returns a stream of numbers.
42      (Originally the name stood for "oscillator", but it does ever so much more
43      now... see osc.c.)
44      Imagine a cylinder with a vertical axis (along the Z axis), stretching
45      from Z=1 to Z=-1, and a radius of 1.
46   */
47   osc_t *theta; /* Angle around the axis. This is expressed in
48                    hundredths of a degree, so it's actually 0 to 36000. */
49   osc_t *rad;   /* Distance from the axis. This goes up to 1000,
50                    but we actually allow negative distances -- that just 
51                    goes to the opposite side of the circle -- so the range
52                    is really -1000 to 1000. */
53   osc_t *alti;  /* Height (Z position). This goes from -1000 to 1000. */
54   osc_t *color; /* Consider this to be an angle of a circle going 
55                    around the color wheel. It's in tenths of a degree
56                    (consistency is all I ask) so it ranges from 0 to 3600. */
57 };
58
59 #endif /* __STONERVIEW_H__ */