http://www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz
[xscreensaver] / hacks / glx / starwars.c
index 9823e03ab9a76d8fbc074fbd399076c4c749f016..69b1cf9cd073c83569e92a2081cc5a0c95c727df 100644 (file)
@@ -1,4 +1,4 @@
-/* starwars, Copyright (c) 1998-2008 Jamie Zawinski <jwz@jwz.org> and
+/* starwars, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org> and
  * Claudio Matsuoka <claudio@helllabs.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
 # include <unistd.h>
 #endif
 
-#ifdef HAVE_UNAME
-# include <sys/utsname.h>
-#endif /* HAVE_UNAME */
-
 #ifndef HAVE_COCOA
 # include <X11/Intrinsic.h>
 #endif
@@ -796,6 +792,8 @@ init_sws (ModeInfo *mi)
   if ((sc->glx_context = init_GL(mi)) != NULL) {
     gl_init(mi);
     reshape_sws (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+    clear_gl_error(); /* WTF? sometimes "invalid op" from glViewport! */
+
     init_stars (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
   }