gnome-games r7570 - in branches/gnome-2-22/glchess: . src/lib/gtkui



Author: rancell
Date: Sat Apr  5 03:16:54 2008
New Revision: 7570
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7570&view=rev

Log:
Abort 3D render if widget_get_gl_context() returns None (Bug #512068)

Modified:
   branches/gnome-2-22/glchess/ChangeLog
   branches/gnome-2-22/glchess/src/lib/gtkui/chessview.py

Modified: branches/gnome-2-22/glchess/src/lib/gtkui/chessview.py
==============================================================================
--- branches/gnome-2-22/glchess/src/lib/gtkui/chessview.py	(original)
+++ branches/gnome-2-22/glchess/src/lib/gtkui/chessview.py	Sat Apr  5 03:16:54 2008
@@ -110,8 +110,12 @@
         glDrawable = gtk.gtkgl.widget_get_gl_drawable(self)
         glContext = gtk.gtkgl.widget_get_gl_context(self)
 
-        # OpenGL begin.
-        if glDrawable is None or not glDrawable.gl_begin(glContext):
+        # Check were able to get context
+        if glDrawable is None or glContext is None:
+            return
+
+        # OpenGL begin (can fail)
+        if not glDrawable.gl_begin(glContext):
             return
         
         self.__glDrawable = glDrawable



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