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