X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fbubble3d.h;h=72ef5a50420d11136031ddb4e473f2f73dc21ec8;hb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;hp=4cbdd7540f417496c2365e5ece00ad1ea376e786;hpb=2a991a811de4c7b22f812682b267b616a809fd9a;p=xscreensaver diff --git a/hacks/glx/bubble3d.h b/hacks/glx/bubble3d.h index 4cbdd754..72ef5a50 100644 --- a/hacks/glx/bubble3d.h +++ b/hacks/glx/bubble3d.h @@ -3,8 +3,6 @@ #ifndef __bubbles3d_h__ #define __bubbles3d_h__ -#include - #ifdef STANDALONE # include # include "xlockmoreI.h" /* from the xscreensaver distribution */ @@ -12,21 +10,25 @@ # include "xlock.h" /* from the xlockmore distribution */ #endif /* !STANDALONE */ -#include -#include +#ifdef HAVE_COCOA +# include +# include +#else +# include +# include +#endif /* Static configuration. */ -#define GLB_SLOW_GL 1 /* Set this if you have a slow GL +#define GLB_SLOW_GL 0 /* Set this if you have a slow GL * implementation. If you have an accelerated * graphics card, set this to 0. */ -#define GLB_USE_BLENDING 0 /* Use alpha feature to create see-through - * bubbles. - */ #define GLB_VERTICES_EPSILON 0.0005 /* How close are identical vertices? */ /* Configuration structure. */ struct glb_config { + int transparent_p; /* Whether to use alpha blending */ + int subdivision_depth; /* Controls how many triangles are in * each bubble. 2 and 3 are good values. */ @@ -60,6 +62,8 @@ struct glb_config { GLfloat screen_top; /* Top of screen. */ GLfloat bg_colour[4]; /* Background colour. */ GLfloat bubble_colour[4]; /* Colour of the bubbles. */ + + int polygon_count; }; extern struct glb_config glb_config; @@ -67,19 +71,21 @@ extern struct glb_config glb_config; #define glb_drand() ((double)LRAND() / (double)MAXRAND) /*-- From glb_sphere.c. --*/ +typedef struct glb_data glb_data; typedef GLfloat glb_vertex[3]; typedef GLuint glb_triangle[3]; -extern void glb_sphere_init(void); -extern glb_vertex *glb_sphere_get_vertices(int *nr_vertices); -extern glb_triangle *glb_sphere_get_triangles(int *nr_triangles); -extern void glb_sphere_end(void); +extern glb_data * glb_sphere_init(void); +extern glb_vertex *glb_sphere_get_vertices(glb_data *, int *nr_vertices); +extern glb_triangle *glb_sphere_get_triangles(glb_data *, int *nr_triangles); +extern void glb_sphere_end(glb_data *); /*-- From glb_bubble.c. --*/ -extern void *glb_bubble_new(GLfloat x, GLfloat y, GLfloat z, GLfloat scale, +extern void *glb_bubble_new(glb_data *d, + GLfloat x, GLfloat y, GLfloat z, GLfloat scale, GLfloat y_incr, GLfloat scale_incr); extern void glb_bubble_delete(void *); extern void glb_bubble_step(void *); -extern void glb_bubble_draw(void *); +extern void glb_bubble_draw(glb_data *d, void *); extern GLfloat glb_bubble_get_y(void *); /*-- From glb_draw.c. --*/