gnome-games r7544 - in branches/gnome-2-22/glchess: . src/lib/scene/opengl



Author: rancell
Date: Mon Mar 24 10:24:22 2008
New Revision: 7544
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7544&view=rev

Log:
Handle GLError->GLerror, GLUError -> GLUerror objects being renamed in PyOpenGL 3.0 (Bug #503238)


Modified:
   branches/gnome-2-22/glchess/ChangeLog
   branches/gnome-2-22/glchess/src/lib/scene/opengl/__init__.py
   branches/gnome-2-22/glchess/src/lib/scene/opengl/texture.py

Modified: branches/gnome-2-22/glchess/src/lib/scene/opengl/__init__.py
==============================================================================
--- branches/gnome-2-22/glchess/src/lib/scene/opengl/__init__.py	(original)
+++ branches/gnome-2-22/glchess/src/lib/scene/opengl/__init__.py	Mon Mar 24 10:24:22 2008
@@ -1,5 +1,6 @@
 try:
     import OpenGL.GL
+    import OpenGL.GLU    
 except ImportError:
     import glchess.scene
     
@@ -14,4 +15,10 @@
         def addChessPiece(self, chessSet, name, coord, feedback):
             return Piece()
 else:
+    # PyOpenGL 3.0 renamed GLError -> GLerror, support 2.0
+    if not hasattr(OpenGL.GL, 'GLerror'):
+        OpenGL.GL.GLerror = OpenGL.GLError
+    if not hasattr(OpenGL.GLU, 'GLUerror'):
+        OpenGL.GLU.GLUerror = OpenGL.GLU.GLUError        
+
     from opengl import *

Modified: branches/gnome-2-22/glchess/src/lib/scene/opengl/texture.py
==============================================================================
--- branches/gnome-2-22/glchess/src/lib/scene/opengl/texture.py	(original)
+++ branches/gnome-2-22/glchess/src/lib/scene/opengl/texture.py	Mon Mar 24 10:24:22 2008
@@ -110,7 +110,7 @@
         # Generate mipmaps
         try:
             gluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE, self.__width, self.__height, self.__format, GL_UNSIGNED_BYTE, self.__data)
-        except GLUError, e:
+        except GLUerror, e:
             glTexImage2D(GL_TEXTURE_2D,
                          0,                # Level
                          3,                # Depth



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