From http://www.jwz.org/xscreensaver/xscreensaver-5.16.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 #ifndef HAVE_COCOA
21 # include <GL/gl.h>
22 #endif
23
24 #ifdef HAVE_JWZGLES
25 # include "jwzgles.h"
26 #endif /* HAVE_JWZGLES */
27
28 typedef struct stonerview_state stonerview_state;
29
30 #include "stonerview-osc.h"
31 #include "stonerview-move.h"
32
33 struct stonerview_state {
34
35   int wireframe;
36   int transparent;
37
38   /* The list of polygons. This is filled in by move_increment(), and rendered
39      by perform_render(). */
40   int num_els;
41   elem_t *elist;
42
43   /* A linked list of all osc_t objects created. New objects are added
44      to the end of the list, not the beginning. */
45   osc_t *oscroot;
46   osc_t **osctail;
47
48   /* The polygons are controlled by four parameters. Each is represented by
49      an osc_t object, which is just something that returns a stream of numbers.
50      (Originally the name stood for "oscillator", but it does ever so much more
51      now... see osc.c.)
52      Imagine a cylinder with a vertical axis (along the Z axis), stretching
53      from Z=1 to Z=-1, and a radius of 1.
54   */
55   osc_t *theta; /* Angle around the axis. This is expressed in
56                    hundredths of a degree, so it's actually 0 to 36000. */
57   osc_t *rad;   /* Distance from the axis. This goes up to 1000,
58                    but we actually allow negative distances -- that just 
59                    goes to the opposite side of the circle -- so the range
60                    is really -1000 to 1000. */
61   osc_t *alti;  /* Height (Z position). This goes from -1000 to 1000. */
62   osc_t *color; /* Consider this to be an angle of a circle going 
63                    around the color wheel. It's in tenths of a degree
64                    (consistency is all I ask) so it ranges from 0 to 3600. */
65 };
66
67 #endif /* __STONERVIEW_H__ */