/* xlock-gl.c --- xscreensaver compatibility layer for xlockmore GL modules.
- * xscreensaver, Copyright (c) 1997-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1997-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#include "xlockmoreI.h"
#include "glxfonts.h"
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <GL/glx.h>
-
#ifndef isupper
# define isupper(c) ((c) >= 'A' && (c) <= 'Z')
#endif
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,
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...
}
}
-
\f
/* clear away any lingering error codes */