X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fxlock-gl-utils.c;h=f2e01b669b6c19dc536d256cd745995841a0c369;hb=d5186197bc394e10a4402f7f6d23fbb14103bc50;hp=3f41f9bf0905658e9630411864d63d5fc85091e8;hpb=f0261d8acab611f3433160e4f07367b870439739;p=xscreensaver diff --git a/hacks/glx/xlock-gl-utils.c b/hacks/glx/xlock-gl-utils.c index 3f41f9bf..f2e01b66 100644 --- a/hacks/glx/xlock-gl-utils.c +++ b/hacks/glx/xlock-gl-utils.c @@ -1,5 +1,5 @@ /* xlock-gl.c --- xscreensaver compatibility layer for xlockmore GL modules. - * xscreensaver, Copyright (c) 1997-2008 Jamie Zawinski + * xscreensaver, Copyright (c) 1997-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -16,11 +16,7 @@ #include #include "xlockmoreI.h" -#include "glxfonts.h" - -#include -#include -#include +#include "texfont.h" #ifndef isupper # define isupper(c) ((c) >= 'A' && (c) <= 'Z') @@ -60,6 +56,10 @@ init_GL(ModeInfo * mi) XVisualInfo vi_in, *vi_out; int out_count; +# ifdef HAVE_JWZGLES + jwzgles_reset(); +# endif + vi_in.screen = screen_number (screen); vi_in.visualid = XVisualIDFromVisual (visual); vi_out = XGetVisualInfo (dpy, VisualScreenMask|VisualIDMask, @@ -121,6 +121,19 @@ init_GL(ModeInfo * mi) /* 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... */ @@ -131,7 +144,6 @@ init_GL(ModeInfo * mi) } } - /* clear away any lingering error codes */