http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.02.tar.gz
[xscreensaver] / hacks / glx / moebius.c
index bb08482006fd548d15f9a43d34f3ed300f1f8f61..0220cbbb2476a1c5b78a7092df334ce624968f9f 100644 (file)
@@ -84,8 +84,7 @@ static const char sccsid[] = "@(#)moebius.c   4.08 97/01/04 xlockmore";
 # define HACK_DRAW                     draw_moebius
 # define HACK_RESHAPE          reshape_moebius
 # define moebius_opts          xlockmore_opts
-# define DEFAULTS                      "*cycles:               1       \n"                     \
-                                                       "*delay:                20000   \n"                     \
+# define DEFAULTS                      "*delay:                20000   \n"                     \
                                                        "*showFPS:      False   \n"                     \
                                                        "*wireframe:    False   \n"
 # include "xlockmore.h"                /* from the xscreensaver distribution */
@@ -585,6 +584,7 @@ reshape_moebius(ModeInfo * mi, int width, int height)
 static void
 pinit(void)
 {
+    int status;
        glClearDepth(1.0);
        glClearColor(0.0, 0.0, 0.0, 1.0);
 
@@ -610,8 +610,21 @@ pinit(void)
        glDisable(GL_CULL_FACE);
 
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-       gluBuild2DMipmaps(GL_TEXTURE_2D, 3, WoodTextureWidth, WoodTextureHeight,
-                         GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+
+    clear_gl_error();
+       status = gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
+                               WoodTextureWidth, WoodTextureHeight,
+                               GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+    if (status)
+      {
+        const char *s = gluErrorString (status);
+        fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n",
+                 progname, WoodTextureWidth, WoodTextureHeight,
+                 (s ? s : "(unknown)"));
+        exit (1);
+      }
+    check_gl_error("mipmapping");
+
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
@@ -725,10 +738,6 @@ init_moebius(ModeInfo * mi)
     mp->ddy = 0.00006 + frand(0.00003);
     mp->ddz = 0.00006 + frand(0.00003);
 
-    mp->ddx = 0.00001;
-    mp->ddy = 0.00001;
-    mp->ddz = 0.00001;
-
        if ((mp->glx_context = init_GL(mi)) != NULL) {
 
                reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));