- gluBuild2DMipmaps(GL_TEXTURE_2D, 3, WoodTextureWidth, WoodTextureHeight,
- GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+
+#if 0
+ clear_gl_error();
+ status = gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
+ WoodTextureWidth, WoodTextureHeight,
+ GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+ if (status)
+ {
+ const char *s = (char *) gluErrorString (status);
+ fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n",
+ progname, WoodTextureWidth, WoodTextureHeight,
+ (s ? s : "(unknown)"));
+ exit (1);
+ }
+ check_gl_error("mipmapping");
+#else
+ {
+ XImage *img = image_data_to_ximage (mi->dpy, mi->xgwa.visual,
+ wood_png, sizeof(wood_png));
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA,
+ img->width, img->height, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, img->data);
+ check_gl_error("texture");
+ XDestroyImage (img);
+ }
+#endif
+