X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fxlock-gl-utils.c;h=e3aeff0b5462c43476f767bc10e7a582c3ba35fb;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hp=d72b4ebdd4aa4ad0d4884893441d05c3e4aecec0;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/glx/xlock-gl-utils.c b/hacks/glx/xlock-gl-utils.c index d72b4ebd..e3aeff0b 100644 --- a/hacks/glx/xlock-gl-utils.c +++ b/hacks/glx/xlock-gl-utils.c @@ -118,6 +118,21 @@ init_GL(ModeInfo * mi) glDrawBuffer (GL_FRONT); } + /* Sometimes glDrawBuffer() throws "invalid op". Dunno why. Ignore. */ + clear_gl_error (); + + /* Process the -background argument. */ + { + char *s = get_string_resource(mi->dpy, "background", "Background"); + XColor c = { 0, }; + if (! XParseColor (dpy, mi->xgwa.colormap, s, &c)) + fprintf (stderr, "%s: can't parse color %s; using black.\n", + progname, s); + glClearColor (c.red / 65535.0, + c.green / 65535.0, + c.blue / 65535.0, + 1.0); + } /* GLXContext is already a pointer type. Why this function returns a pointer to a pointer, I have no idea...