X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglplanet.c;h=ad26b3d667f7f4b44ed5814de1af04617c209540;hb=ebc241816cc8e3eec7270a594bb1a607df32bcd6;hp=7c71fc7d135c75e015801c462e70df6e16851c29;hpb=f65151994eba80ecabcdac6eef6fa0dde7e2d45b;p=xscreensaver diff --git a/hacks/glx/glplanet.c b/hacks/glx/glplanet.c index 7c71fc7d..ad26b3d6 100644 --- a/hacks/glx/glplanet.c +++ b/hacks/glx/glplanet.c @@ -237,8 +237,10 @@ setup_xbm_texture (char *bits, int width, int height, *out++ = (word & 0x0000FF); } + clear_gl_error(); glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); + check_gl_error("texture"); /* setup parameters for texturing */ glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -266,9 +268,11 @@ setup_file_texture (ModeInfo *mi, char *filename) { XImage *image = xpm_to_ximage (dpy, visual, cmap, xpm_data); + clear_gl_error(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image->width, image->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image->data); + check_gl_error("texture"); /* setup parameters for texturing */ glPixelStorei(GL_UNPACK_ALIGNMENT, 4); @@ -323,7 +327,7 @@ setup_file_texture (ModeInfo *mi, char *filename) exit (1); } - setup_xbm_texture (data, width, height, &gp->fg, &gp->bg); + setup_xbm_texture ((char *) data, width, height, &gp->fg, &gp->bg); } #else /* !XMU */ @@ -422,10 +426,10 @@ void generate_stars(int width, int height) glBegin(GL_POINTS); for(i = 0 ; i < NUM_STARS ; i++) { -/* size = (drand48()+size_range[0]) * size_range[1]/2.; */ +/* size = ((random()%size_range[0])) * size_range[1]/2.; */ /* glPointSize(size); */ - x = drand48()*width; - y = drand48()*height; + x = random() % width; + y = random() % height; glVertex2f(x,y); } glEnd();