http://www.jwz.org/xscreensaver/xscreensaver-5.09.tar.gz
[xscreensaver] / hacks / glx / xlock-gl-utils.c
index eb266f8a5c5e125b23b443d301541b72735408bc..3f41f9bf0905658e9630411864d63d5fc85091e8 100644 (file)
@@ -1,5 +1,5 @@
 /* xlock-gl.c --- xscreensaver compatibility layer for xlockmore GL modules.
- * xscreensaver, Copyright (c) 1997-2002, 2006 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1997-2008 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
@@ -16,6 +16,7 @@
 
 #include <stdio.h>
 #include "xlockmoreI.h"
+#include "glxfonts.h"
 
 #include <GL/gl.h>
 #include <GL/glu.h>
@@ -117,6 +118,8 @@ init_GL(ModeInfo * mi)
       glDrawBuffer (GL_FRONT);
   }
 
+  /* Sometimes glDrawBuffer() throws "invalid op". Dunno why. Ignore. */
+  clear_gl_error ();
 
   /* GLXContext is already a pointer type.
      Why this function returns a pointer to a pointer, I have no idea...