gnome-games r8033 - branches/gnome-2-24/glchess/src/lib/scene/opengl



Author: rancell
Date: Wed Oct 15 10:11:11 2008
New Revision: 8033
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8033&view=rev

Log:
Handle invalid response from glRenderMode(GL_SELECT) (Bug #538252)

Modified:
   branches/gnome-2-24/glchess/src/lib/scene/opengl/opengl.py

Modified: branches/gnome-2-24/glchess/src/lib/scene/opengl/opengl.py
==============================================================================
--- branches/gnome-2-24/glchess/src/lib/scene/opengl/opengl.py	(original)
+++ branches/gnome-2-24/glchess/src/lib/scene/opengl/opengl.py	Wed Oct 15 10:11:11 2008
@@ -356,7 +356,17 @@
         # Don't render to screen, just select
         # Selection buffer is large in case we select multiple squares at once (it generates an exception)
         glSelectBuffer(20)
-        glRenderMode(GL_SELECT)
+        
+        # TEMP
+        # Handle the failure case in bug #538252. By catching this we convert a crash
+        # that would generate bugzilla report into the user input being ignored. This should
+        # be removed once the problem has been fixed (assumed to be in PyGTK/OpenGL drivers).
+        # Note that OpenGL may be in an invalid state when this fails.
+        try:
+            glRenderMode(GL_SELECT)
+        except IndexError:
+            glRenderMode(GL_RENDER)
+            return None
 
         glInitNames()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]