# define superquadrics_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# define superquadrics_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
-{"superquadrics", "init_superquadrics", "draw_superquadrics", "release_superquadrics",
+{"superquadrics", "init_superquadrics", "draw_superquadrics", NULL,
"refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
1000, 25, 40, 1, 4, 1.0, "",
"Shows 3D mathematical shapes", 0, NULL};
"refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
1000, 25, 40, 1, 4, 1.0, "",
"Shows 3D mathematical shapes", 0, NULL};
- glViewport(0, 0, w, h);
+ int y = 0;
+
+ if (w > h * 5) { /* tiny window: show middle */
+ h = w;
+ y = -h/2;
+ }
+
+ glViewport(0, y, w, h);
- if (superquadrics == NULL) {
- if ((superquadrics = (superquadricsstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (superquadricsstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, superquadrics);