51b3d442e72e48e92c152c50f9852cee34d43aff
[xscreensaver] / hacks / glx / topblock.h
1 /* topblock - openGL based hack  */\r
2 \r
3 static void buildCarpet(ModeInfo *);\r
4 static void polygonPlane(int, int, int, int, int ,int);\r
5 static void buildBlock(ModeInfo *);\r
6 static void generateNewBlock(ModeInfo *);\r
7 static void followBlock(ModeInfo *);\r
8 static void buildBlobBlock(ModeInfo *);\r
9 static double quadrantCorrection(double,int,int,int,int);\r
10 \r
11 /* this structure holds all the attributes about a block */\r
12 typedef struct blockNode {\r
13         int color;              /* indexed */\r
14         int rotation;           /* indexed: 0=S-N, 1=W-E, 2=N-S, 3=E-W */\r
15         GLfloat height;\r
16         GLfloat x;\r
17         GLfloat y;\r
18         int falling;            \r
19         struct blockNode *next;\r
20 } NODE;\r
21 \r
22 \r
23 /* some handy macros and definitions */\r
24 #define blockHeight 1.49f\r
25 #define getHeight(a) (a * blockHeight)\r
26 \r
27 #define getOrientation(a) (a * 90)\r
28 \r
29 #define blockWidth 2.0f\r
30 #define getLocation(a) (a * blockWidth)\r
31 \r
32 #define TOLLERANCE 0.1\r
33 \r
34 #define cylSize 0.333334f\r
35 #define uddSize 0.4f\r
36 #define singleThick 0.29        /* defines the thickness of the carpet */\r
37 \r
38 \r
39 \r
40 \r
41 \r
42 \r
43 \r
44 \r
45 \r