[PyOpenGL-Devel] [ pyopengl-Bugs-3534110 ] hasGLExtension fail wrt circular import
Brought to you by:
mcfletch
From: SourceForge.net <no...@so...> - 2012-06-10 10:02:21
|
Bugs item #3534110, was opened at 2012-06-10 03:02 Message generated for change (Tracker Item Submitted) made by lxnt You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105988&aid=3534110&group_id=5988 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: GL Group: v3.0.0 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Alexander Sabourenkov (lxnt) Assigned to: Mike C. Fletcher (mcfletch) Summary: hasGLExtension fail wrt circular import Initial Comment: Given a 3.0+ forward-compatible context, that is, with glGetString barking at GL_EXTENSIONS, "from OpenGL.GL import *" may fail if one of OpenGL.GL.VERSION.GL_* submodules with version below 3.0 calls hasGLExtension() due to the fact that until "from OpenGL.GL.VERSION.GL_3_0 import *" line is executed in OpenGL/GL/__init__.py, the line "from OpenGL.GL import GL_NUM_EXTENSIONS, glGetStringi, glGetIntegerv" is guaranteed to throw an ImportError. Suggested solution: replace the aforementioned import statement in the hasExtension() function with the following two lines: from OpenGL.GL.VERSION.GL_3_0 import GL_NUM_EXTENSIONS, glGetStringi from OpenGL.GL import glGetIntegerv Works for me. Attached patch: the above fix plus a couple of nits to make it all work under Python 3.2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105988&aid=3534110&group_id=5988 |