X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fcircuit.c;h=faa30df2c63099b24fa0754be0c39aa1ff7faf78;hp=0c28e9fb7a735097f26a22ff6606aedbfe5a87f3;hb=cccbddbc4140cf9a06d7d95cc5c0ca36eb5d6e28;hpb=a94197e76a5dea5cb60542840809d6c20d0abbf3 diff --git a/hacks/glx/circuit.c b/hacks/glx/circuit.c index 0c28e9fb..faa30df2 100644 --- a/hacks/glx/circuit.c +++ b/hacks/glx/circuit.c @@ -1708,7 +1708,7 @@ TexNum * fonttexturealloc (const char *str, float *fg, float *bg) { static char *strings[50]; /* max of 40 textures */ static int w[50], h[50]; - int i; + int i, status; static int init; XImage *ximage; char *c; @@ -1737,8 +1737,20 @@ TexNum * fonttexturealloc (const char *str, float *fg, float *bg) for (i = 1 ; strings[i] != NULL ; i++); /* set i to the next unused value */ glBindTexture(GL_TEXTURE_2D, i); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - gluBuild2DMipmaps(GL_TEXTURE_2D, 4, ximage->width, ximage->height, GL_RGBA, - GL_UNSIGNED_BYTE, ximage->data); + + clear_gl_error(); + status = gluBuild2DMipmaps(GL_TEXTURE_2D, 4, ximage->width, ximage->height, + GL_RGBA, GL_UNSIGNED_BYTE, ximage->data); + if (status) + { + const char *s = gluErrorString (status); + fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n", + progname, ximage->width, ximage->height, + (s ? s : "(unknown)")); + exit (1); + } + check_gl_error("mipmapping"); + t = malloc(sizeof(TexNum)); t->w = ximage->width; t->h = ximage->height;